On Tue, Nov 26, 2013 at 10:35:26AM -0700, Bjorn Helgaas wrote: > On Tue, Nov 26, 2013 at 9:40 AM, Khalid Aziz <khalid.aziz@xxxxxxxxxx> wrote: > > Disabling Bus Master bit is effectively a brute force and not an elegant way > > to stop unwanted DMA. It can have side effects as Alan and others pointed > > out in the original discussion, and we are now seeing one with Lynx Point on > > Acer. > > I'm getting more queasy all the time about disabling Bus Master. I > don't think RHEL does it, and that's probably where most kexec use is. > So I doubt we really have much experience with it yet. Does Windows disable the BM bit on shutdown? If not, it's likely that there are platforms where the SMM code assumes it's still enabled. We also know that there are devices that hang if BM is disabled while their DMA engines are still running. Unless we verify that Windows does this, I think there's no way we can guarantee that firmware won't make assumptions about the state of PCI. The easiest compromise would probably be to set a flag that disables busmastering purely when we're performing a kexec. > > Eric had pointed out in original discussion - > > <http://marc.info/?l=linux-pci&m=133901193430829&w=2> that this code change > > moves failure from a random point in the kexec'd kernel to a predictable > > point on shutdown path where it becomes lot easier to debug than a random > > memory overwrite. > > That is probably true in some cases, but not this one. I have no idea > how to debug this poweroff hang. Poweroff is a path *everybody* uses, > so it's much more important to have that work reliably than it is to > have kexec work. If it's hanging after we've performed the io writes that trap us into SMM, there's no meaningful way for us to debug it. We're violating assumptions that the firmware is making, and the only way to fix that is to cease violating those assumptions. -- Matthew Garrett | mjg59@xxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html