kernel - limit DMA for older ALI chips to 256KB
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 19 Jan 2015 17:09:05 +0000 (09:09 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 19 Jan 2015 17:09:05 +0000 (09:09 -0800)
* For ancient machines using old ALI chipsets which do
  not support 48-bit DMA, also limit the maximum DMA
  size to 256KB.

sys/dev/disk/nata/ata-chipset.c

index 4401053..9548580 100644 (file)
@@ -1166,8 +1166,11 @@ ata_ali_allocate(device_t dev)
        return ENXIO;
 
     /* older chips can't do 48bit DMA transfers */
-    if (ctlr->chip->chiprev <= 0xc4)
+    if (ctlr->chip->chiprev <= 0xc4) {
        ch->flags |= ATA_NO_48BIT_DMA;
+       if (ch->dma->max_iosize > 256 * 512)
+               ch->dma->max_iosize = 256 * 512;
+    }
 
     return 0;
 }