Skip to contentSkip to conversation

ahci: Enable SB600 64bit DMA on MSI K9AGM2 (MS-7327)

PATCH New Mark Nelson 1 participant 1 message Jun 26, 2012 libata

lore
Share & tools
lore
#0 lore raw

cover ahci: Enable SB600 64bit DMA on MSI K9AGM2 (MS-7327)

I've come across another motherboard that uses an SB600 southbridge so I figured I'd run some tests to see if it worked correctly with 64bit DMA enabled in the AHCI driver. And it does indeed work properly, so this patch enables 64bit DMA on the MSI K9AGM2 (MS-7327).

Similar to my earlier patches that enabled 64bit DMA on the MSI K9A2 Platinum (e65cc194f7628ecaa02462f22f42fb09b50dcd49) and the Asus M3A (3c4aa91f21f65b7b40bdfb015eacbcb8453ccae2) this patch matches on a Board Product Name DMI field of "MS-7327" which stays constant across all BIOS versions.

Testing was done in exactly the same way as it was for the other patches
(http://patchwork.ozlabs.org/patch/36881) - with 4GB RAM installed in the machine (which had ~1GB remapped above the 4GB boundary) a large (~8GB) file was copied and the checksums of the copy and original were compared. To make sure that we were actually DMAing to a high enough address for the copy the following simple patch was used:

---
 drivers/ata/libahci.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/ata/libahci.c +5 -0
Index: linux-2.6/drivers/ata/libahci.c
===================================================================
@@ -1395,6 +1395,11 @@ static unsigned int ahci_fill_sg(struct
 	for_each_sg(qc->sg, sg, qc->n_elem, si) {
 		dma_addr_t addr = sg_dma_address(sg);
 		u32 sg_len = sg_dma_len(sg);
+		static int cnt;
+
+		if (addr > 0xffffffffULL && !(cnt++ % 500))
+			printk("ahci: dma'ing to address 0x%llx\n",
+				(unsigned long long)addr);
 
 		ahci_sg[si].addr = cpu_to_le32(addr & 0xffffffff);
 		ahci_sg[si].addr_hi = cpu_to_le32((addr >> 16) >> 16);

For the testing I had an old enough CPU that I could flash to and test all the BIOS releases going all the way back to 1.0. I ended up testing 7 BIOS releases from 1.0 to 1.6 (all those that MSI publicly released) to make sure that there weren't any regressions lurking in there.

And all worked flawlessly. Thus this patch :)

Thanks!
Mark