Re: avoiding pci_disable_device()...

From: Jeff Garzik (jgarzik_at_pobox.com)
Date: 02/14/05

  • Next message: Roland Dreier: "Re: avoiding pci_disable_device()..."
    Date:	Mon, 14 Feb 2005 14:54:56 -0500
    To: Takashi Iwai <tiwai@suse.de>
    
    

    Takashi Iwai wrote:
    > At Mon, 14 Feb 2005 11:34:13 -0800,
    > Greg KH wrote:
    >
    >>On Mon, Feb 14, 2005 at 08:24:29PM +0100, Takashi Iwai wrote:
    >>
    >>>At Mon, 14 Feb 2005 11:06:19 -0800,
    >>>Greg KH wrote:
    >>>
    >>>>>As a result, I have committed the attached patch to libata-2.6. In many
    >>>>>cases, it is a "semantic fix", addressing the case
    >>>>>
    >>>>> * pci_request_regions() indicates hardware is in use
    >>>>> * we rudely disable the in-use hardware
    >>>>>
    >>>>>that would not occur in practice.
    >>>>>
    >>>>>But better safe than sorry. Code cuts cut-n-pasted all over the place.
    >>>>>
    >>>>>I'm hoping one or two things will happen now:
    >>>>>* janitors fix up the other PCI drivers along these lines
    >>>>>* improve the PCI API so that pci_request_regions() is axiomatic
    >>>>
    >>>>Do you have any suggestions for how to do this?
    >>>
    >>>How about to add an exclusiveness check in pci_enable_device()?
    >>>Most drivers suppose that the given pci resources are exclusively
    >>>available.
    >>
    >>You mean only allow pci_enable_device() to work for the first caller of
    >>it? I don't see how that would help this issue out.
    >
    >
    > Well, for example, add a new pointer to indicate the driver accessing
    > exclusively. And pci_enable_device() (maybe a new variant would be
    > better for compatibility) checks whether this is free.
    >
    > The second caller wouldn't reach even to pci_request_regions() because
    > of this check. So, no side-effect of pci_disable_device() in the
    > error path.

    This doesn't work with a driver that is properly using
    request_resource(), but not using the PCI API.

            Jeff

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Roland Dreier: "Re: avoiding pci_disable_device()..."

    Relevant Pages

    • Re: PCI driver
      ... >any pci dev your driver can handle. ... >You don't need to cast a pointer to void* or vice versa. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: SysFS, module names and .name
      ... Greg KH wrote: ... I would know which driver name corresponds to ... > changing every single pci driver to enable it. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: small patch: enable pwc usb camera driver
      ... > Greg KH wrote: ... Ick ick ick! ... time to mark the driver broken again... ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH][2.6][CFT] rmmod floppy kills box fixes + default_device_remove
      ... On Mon, 8 Sep 2003, Greg KH wrote: ... >> Basically i'd like a pointer as to what to do with these release ... i was confused over which memory references had to be ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 2/4] Driver core: add driver_probe_device
      ... I really like the "driver" part in the device. ... (will be a few hours, have real work to do for a bit, sorry...) ... greg k-h ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)