[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Disable Bus Master on PCI device shutdown
> This protects against the case where a piece of hardware is continuing 
> to DMA even after the driver shutdown method has been called? I'm not

It doesn't. We also have hardware which craps itself if you clear the bus
mastering bit and we have platforms where the BIOS gets most upset if you
do that on suspend paths. There are also lots of devices that simply
ignore the bus mastering bit !

> convinced this is safe. Some Broadcom parts will crash if busmastering
> is disabled while they're still performing DMA, and they'll then hang
> the bus if reenabled.

This is very common, disabling the bus master bit isn't exactly a
tested or well defined pathway. A lot of device FIFOs will also happily
belch out their queue when you flip the bit. So it might look like
progress but it probably isn't.

Unfortunately if you've got a device peeing into memory you need to fix
the driver, or sometimes the firmware. You can probably use the IOMMU for
some protection on newer systems.

And then you get things like the CS5520 where disabling bus mastering on
the IDE controller crashes the machine, and some UMA video devices that
honour the bit for video fetch.

From the IDE experience you really need to be careful here. Changing the
default is asking for nasty and weird regressions.

This isn't a fix, its a band aid to cover over broken driver shutdown
methods. Those driver shutdown methods need fixing.


 \ /
  Last update: 2012-06-06 23:21    [W:0.133 / U:4.152 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site