Re: [PATCH] missing pci_disable_device()

From: Alan Cox
Date: Tue Sep 07 2004 - 05:53:53 EST


On Maw, 2004-09-07 at 02:26, Kenji Kaneshige wrote:
> Hi,
>
> As mentioned in Documentaion/pci.txt, pci device driver should call
> pci_disable_device() to deallocate any IRQ resources, disable PCI
> bus-mastering and etc. when it decides to stop using the device.
> But there seems to be many drivers that don't use pci_disable_device()
> properly so far.

Think about unloading frame buffers or PCI devices with multiple
functions and multiple drivers. I agree the drivers definitely want
fixing where appropriate. I'm not sure your approach is safe (although a
debug printk would work wonders perhaps ?)

Another question: When I suggested doing exactly this for kexec I got
flamed by people claiming that disabling bus mastering isnt a defined
operation only enabling it. I'm still unconvinced by their protestations
but wonder what the PCI gurus can answer here.


-
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/