Re: [PATCH v17 5/6] spi: pxa2xx-pci: restore LPSS private register state across S3 resume

From: Andy Shevchenko

Date: Thu Dec 03 2026 - 12:44:10 EST


On Wed, Dec 02, 2026 at 08:00:23PM +0800, Shih-Yuan Lee (FourDollars) wrote:
> On Thu, Oct 1, 2026 at 3:20 PM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Thu, Oct 01, 2026 at 12:06:28AM +0800, Shih-Yuan Lee wrote:

...

> > No, as I told earlier please find a way how to not add a code duplication.
>
> Agreed — I will avoid duplicating the LPSS private register save/restore
> logic in v18.
>
> As noted in my reply to Mika, on MacBook8,1 (Wildcat Point-LP) the
> controller at 00:15.4 [8086:9ce6] is enumerated as an independent PCI
> function rather than via intel-lpss-pci, and drivers/acpi/x86/lpss.c
> also skips its ACPI companion (\_SB_.PCI0.SPI1 / INT33C1) because it
> uses PCI BAR0 on pci_bus_type.

Yes, I have just read that.

> For v18, I am preparing a prerequisite patch that extracts the common
> LPSS private register definitions (LPSS_RESETS*, LPSS_PRV_REG_COUNT) and
> helpers (lpss_deassert_reset(), lpss_save_ctx(), lpss_restore_ctx())
> from drivers/acpi/x86/lpss.c into include/linux/platform_data/x86/lpss.h,
> so both drivers/acpi/x86/lpss.c and drivers/spi/spi-pxa2xx-pci.c share
> the exact same implementation without duplication.

At least it sounds better than v17 approach. Let's see v18 how it will look
like.

> Would extracting these helpers into <linux/platform_data/x86/lpss.h> be
> acceptable, or would you prefer unifying the PCI-mode LPT/WPT LPSS
> save/restore at the PCI PM layer (similar to drivers/pci/pci-mid.c)?

Maybe. Let's research your v18 approach first and then we can see if further
improvements are possible.

> (Also, for the other patches in the series: I have dropped Patch 2
> entirely as you and Mark suggested, fixed the probe ordering in Patch 3,
> and applied your style cleanups to Patch 1.)

OK.

--
With Best Regards,
Andy Shevchenko