GO:0045016:   mitochondrial magnesium ion transmembrane transport
The process in which a magnesium ion (Mg2+) is transported across a mitochondrial membrane, into or out of the mitochondrion.