Re: [PATCH] missing pci_disable_device()

From: Greg KH
Date: Thu Sep 09 2004 - 01:24:12 EST


On Thu, Sep 09, 2004 at 02:55:39PM +0900, Kenji Kaneshige wrote:
> Alan Cox wrote:
> > On Mer, 2004-09-08 at 04:14, Kenji Kaneshige wrote:
> >> > 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
> >>
> >> I don't understand what you are worried about. Could you tell me
> >> what would be a problem with frame buffers or PCI devices with
> >> multiple functions?
> >
> > If I have a framebuffer driver loaded for my video card in bitmap mode
> > all is well. If I unload it you then disable the video hardware even
> > though it would still be otherwise usable in text mode.
> >
> > The same occurs when one PCI device has multiple functions (not PCI
> > functions but linux drivers using it). There are some examples of this
> > such as the CS5520 where one BAR is the IDE controller.
> >
>
> Thank you for answering.
>
> I understand that there are some devices that need to be enabled
> even after their drivers are unloaded, and my approach might not
> be safe in this case. I think the best way to solve the problem
> (missing pci_disable_device) is to fix broken drivers one by one.
> I think debug printk will helpful to fix those drivers, but I
> don't know what kind of message is appropriate...

Yes, this should be pointed out with a warning message, which will be
safer. How about something like:

dev_warn(&pci_dev->dev, "Device was removed without properly "
"calling pci_disable_device(), please fix.\n");
WARN_ON(1);

Care to redo your patch with that?

thanks,

greg k-h
-
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/