Re: [PATCH 4/4] Make Emulex lpfc driver legacy I/O port free

Rajesh Shah
2006-06-07T17:31:08Z

On Wed, Jun 07, 2006 at 03:52:03PM +0100, Christoph Hellwig wrote:
> On Wed, Jun 07, 2006 at 10:56:07PM +0900, Kenji Kaneshige wrote:
> > Christoph Hellwig wrote:
> > >On Wed, Jun 07, 2006 at 10:11:12PM +0900, Kenji Kaneshige wrote:
> > >
> > >>I mean the right order is
> > >>
> > >> (1) pci_request_regions()
> > >> (2) pci_enable_device*()
> > >
> > >
> > >no, pci_enable_device should be first.
> > >
> > >
> >
> > I had the same wrong assumption before. But to prevent two
> > devices colliding on the same address range, pci_request_regions()
> > should be called first. Please see the following discussions:
>
> No. That's what the pci_driver matching is for. Without pci_enable_device
> pci_request_regions could do the wrong thing when fixups aren't run.

I don't see how driver matching will help here. It seems wrong to
enable a device first, and then check if the resources it is
decoding actually conflict with some other device's resources.
Regarding quirks, all the ones that mess around with resources
are marked as HEADER quirks. So they should be called right
after a device is probed and before its driver can call
pci_request_regions(). What problems do you see if regions are
requested before the device is enabled?

Rajesh