Re: SII SATA request size limit

From: Eduardo Casino
Date: Fri Sep 12 2003 - 15:46:54 EST


Hi All,

I had a look at the NetBSD pciide.c driver and found this interesting
bit of code:

/*
* Rev. <= 0x01 of the 3112 have a bug that can cause data
* corruption if DMA transfers cross an 8K boundary. This is
* apparently hard to tickle, but we'll go ahead and play it
* safe.
*/
if (PCI_REVISION(pa->pa_class) <= 0x01) {
sc->sc_dma_maxsegsz = 8192;
sc->sc_dma_boundary = 8192;
}

This is basically the same as setting hwif->rqsize to 15, but the NetBSD
folks apply the restriction only if the SiI3112 chipset revision is 1 or
lower. As I have a rev. 2 chip, I raised the rqsize to 128 and made some
disk intensive tests: kernel compilation while recursively copying some
huge (~400MB) files. A couple of hours later, my system remained stable
and getting transfers over 55MB/s with my 120GB Seagate. I'm running
2.4.22-ac1.

This silly patch makes the siimage driver to set rqsize to 15 only for
older, supposedly buggy chips, and leaves the default for the rest.

Regards,
Eduardo.


--- siimage.c.orig 2003-09-12 11:52:26.000000000 +0200
+++ siimage.c 2003-09-12 15:42:20.000000000 +0200
@@ -1065,7 +1065,12 @@ static void __init init_iops_siimage (id
hwif->hwif_data = 0;

hwif->rqsize = 128;
- if (is_sata(hwif))
+ /*
+ * From the NetBSD driver:
+ * "Rev. <= 0x01 of the 3112 have a bug that can cause data
+ * corruption if DMA transfers cross an 8K boundary."
+ */
+ if (dev->device == PCI_DEVICE_ID_SII_3112 && class_rev < 0x02)
hwif->rqsize = 15;

if (pci_get_drvdata(dev) == NULL)



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/