Enabling DMA mode transfers with Linux

Ordinarily, a UDMA-aware Linux kernel automatically enables UDMA for any UDMA-capable drives and interfaces it finds. If a recent Linux kernel does not automatically enable UDMA, it’s usually because the kernel doesn’t understand how to use the UDMA features of the chipset or it thinks UDMA is not safe to use. However, a BIOS glitch or similar minor problem may fool the kernel into believing falsely that DMA is not supported or is unsafe to use. If that happens, it may be useful to enable DMA manually.

With any kernel 2.1.113 or later, you can enable DMA manually by using kernel boot parameters. To do so, add the command ide0=dma or ide1=dma to your startup script, where ide0 is the primary ATA interface and ide1 the secondary ATA interface. We have never used this method for a tertiary or higher ATA interface, and we suspect that it would not work reliably, if at all, for anything except the primary and secondary interfaces. As always, enabling DMA for an interface means that all devices attached to that interface must support DMA. Using this command for an interface to which a PIO mode device is attached results in unpredictable operation at best, and may cause data corruption or boot failures.

The problem with using kernel boot parameters to enable DMA is that they merely ask the kernel to use DMA rather than ordering it to do so. Even after adding a DMA kernel boot parameter to your startup script, you may find the drive is not using DMA. ...

Get PC Hardware in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.