Re: platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe

From: Andy Shevchenko
Date: Mon Nov 18 2024 - 09:10:09 EST


On Mon, Nov 18, 2024 at 02:29:42PM +0100, Hans de Goede wrote:
> On 18-Nov-24 2:24 PM, Andy Shevchenko wrote:
> > On Mon, Nov 18, 2024 at 12:40:16PM +0000, Daniel Walker (danielwa) wrote:
> >> On Mon, Nov 18, 2024 at 11:30:59AM +0000, Shinichiro Kawasaki wrote:

...

> > Still wondering if we simply unhide it early
> > (if it was hidden) and assume the p2sb device is always present. In this case
> > p2sb_bar() will become almost an equivalent to the pci_resource_start().
>
> That would basically open it up for normal PCI drivers to bind to. Which is not
> necessarily a problem, but I wonder if we already have such drivers which then
> all of a sudden will start binding to it ?

AFAIK we have no P2SB device drivers in the kernel.

> Note that e.g. the GPIO code in lpc_ich.c checks if the GPIO controller is not
> ACPI enumerated before calling p2sb_bar(). Unconditionally unhiding the P2SB
> would not mean that at least the GPIO part will be enumerated twice, once
> through ACPI and once through PCI. I'm not sure if that is a good idea.

I agree, but how can it be in practice if p2sb is enumerated without creating
any devices behind it? I mean if we have the p2sb driver for solely purpose of
p2sb_bar() call.

> My vote would go to fix the problem of the PCI device being removed by
> the p2sb.c code when it was not hidden.

--
With Best Regards,
Andy Shevchenko