Re: [patch 2/2] PNP: don't check disabled PCI BARs for conflicts in quirk_system_pci_resources()

Bjorn Helgaas
2008-09-30T19:18:00Z

On Tuesday 30 September 2008 12:01:38 pm Linus Torvalds wrote:
>
> On Tue, 30 Sep 2008, Linus Torvalds wrote:
> >
> > In contrast, the PnP fixup thing is called from pnp_fixup_device, called
> > from __pnp_add_device(), called from pnp_add_device() (and
> > pnp_add_card(), but that should be later), and those in turn from
> > pnpacpi_add_device and pnpacpi_init().
> >
> > And pnpacpi_init is _also_ a subsys_initcall [...]
>
> Btw, why is that? We very much have a separate
>
> /**
> * Reserve motherboard resources after PCI claim BARs,
> * but before PCI assign resources for uninitialized PCI devices
> */
> fs_initcall(pnp_system_init);
>
> which is called much later. That seems to be the _right_ point for any
> quirks. It seems that the _real_ problem here is that the PnP device fixup
> is simply called from the wrong point. Ie, why do we do device discovery -
> and thus PnP quirks - in pnp_init (before the PCI bus is actually fully
> initialized!), rather than in pnp_system_init?

Right. The point of this quirk (quirk_system_pci_resources()) is to
prevent the PNP system driver from claiming resources that are actually
used by PCI. So I don't think there's any reason to run it before we
bind the driver to the device. PNP doesn't currently have any early/
late concept for quirks, but we probably should add one.

Feels like a post-2.6.27 project though.

Bjorn