[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <obttk4pp3uw53blfvaolwakzhqij2xyqbu67b3li7dseni6kb4@ipvay77dd753>
Date: Wed, 20 Nov 2024 04:03:31 +0000
From: Shinichiro Kawasaki <shinichiro.kawasaki@....com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
CC: "Daniel Walker (danielwa)" <danielwa@...co.com>, Hans de Goede
<hdegoede@...hat.com>, Ilpo J�rvinen
<ilpo.jarvinen@...ux.intel.com>, Klara Modin <klarasmodin@...il.com>, Greg
Kroah-Hartman <gregkh@...uxfoundation.org>, Danil Rybakov
<danilrybakov249@...il.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "xe-linux-external(mailer list)"
<xe-linux-external@...co.com>
Subject: Re: platform/x86: p2sb: Allow p2sb_bar() calls during PCI device
probe
On Nov 19, 2024 / 11:37, Andy Shevchenko wrote:
> On Tue, Nov 19, 2024 at 02:20:48AM +0000, Shinichiro Kawasaki wrote:
> > On Nov 18, 2024 / 17:15, Daniel Walker (danielwa) wrote:
> > > On Mon, Nov 18, 2024 at 05:00:52PM +0100, Hans de Goede wrote:
>
> [...]
>
> > > > > Hans, there will be no need to fix anything if they implement correct access
> > > > > to the GPIO, i.e. via driver and board code with GPIO lookup tables.
> > > >
> > > > Agreed, still I'm not sure how I feel about us hiding the previously unhidden P2SB.
> > > >
> > > > OTOH I guess it may have only been unhidden in the BIOS to make the hack they
> > > > are using possible in the first place.
> > >
> > > From a flexibility POV I would suggest if you can not hide it if it's not already
> > > hidden by the BIOS that would be better since some company may have a good
> > > reason to make a custom driver or to export the pci device to userspace thru
> > > UIO. The current situation is you can't make a custom driver if p2sb is enable
> > > with this additional patch even if you unhide the device inside the BIOS.
> > >
> > > In our case it seems like we could use the already existing solution with
> > > pinctrl, but others may not be able to do that or may not want to for different
> > > reasons.
> >
> > I don't have strong opinion about the choice, but I wonder how the p2sb code
> > will be if we keep the unhidden P2SB. I created a trial patch below. If the
> > device is not hidden, it does not call pci_scan_single_device() and
> > pci_stop_and_remove_bus_device(). Instead, it calls pci_get_slot() and
> > pci_dev_put(). I don't have the environment which unhides P2SB. Daniel, if you
> > have time to afford, please try it out.
>
> ...
>
> > - ret = p2sb_scan_and_cache(bus, devfn_p2sb);
> > + ret = p2sb_scan_and_cache(bus, devfn_p2sb, hidden);
>
>
> If you still want to implement this, rather make the two different calls here
>
> if (hidden)
> ret = p2sb_scan_and_cache(bus, devfn_p2sb);
> else
> ret = p2sb_read_and_cache(...);
>
> otherwise the code looks much uglier... :-(
Per the comment by Hans, I will create and post the formal version of the patch.
I will try to reflect your comment above. p2sb_scan_and_cache() and
p2sb_read_and_cache() will do almost same thing, then will need some tweak to
avoid code duplication. I will cook something for review.
Powered by blists - more mailing lists