Re: platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe
From: Hans de Goede
Date: Wed Nov 13 2024 - 11:24:38 EST
Hi,
On 13-Nov-24 4:42 PM, Daniel Walker (danielwa) wrote:
>
> Hi,
>
> I bisected an issue of a missing pci device to commit 2841631 the commit title
> in the subject line which was included in v6.1 stable branch.
>
> There was a later fix for a similar missing pci device commit 36c676e2 which
> appears to be for Goldmont/Apollo Lake. The hardware I'm using is
> Goldmont/Denverton. This fix did not appear to change the behavior I'm seeing.
>
> The pci device which is disappearing is a custom gpio device.
>
> I tested v6.12-rc5-next to see if any other changes had fixed the issue, but there was
> no change in behavior since commit 2841631 .
>
> When booting up the device is shown in the pci boot messages but the device
> doesn't end up making it to lspci once you get to a prompt.
Please give the attached patch a try, this will hopefully fix things.
Once I have confirmation that this fixes things I'll post it to the list.
Note this will not backport to the 6.1 stable branch cleanly due to
changes in the x86_cpu_id macros in mainline. Backporting it should
be trivial. Please send a backport to stable@xxxxxxxxxxxxxxx yourself
once this has been merged upstream.
If you backport this, please also backport 36c676e2 first.
Regards,
Hans
From fa351c7614dd97713b26342c96c61fc28699d8d4 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@xxxxxxxxxx>
Date: Wed, 13 Nov 2024 17:14:10 +0100
Subject: [PATCH] platform/x86: p2sb: Cache correct PCI bar for P2SB on
Denverton and Gemini Lake
Denverton and Gemini Lak are Goldmont derived designs and as such have
the P2SB at device.function 13.0, rather then at the default 31.1.
At a mapping to P2SB_DEVFN_GOLDMONT to p2sb_cpu_ids[] for these 2 Goldmont
variants so that the correct PCI bar gets cached.
This fixes P2SB unhiding not working on these devices which fixes
GPIO and SPI (Gemini Lake only) support not working on devices where
these were hidden by the BIOS.
Fixes: 2841631a0365 ("platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe")
Reported-by: Daniel Walker (danielwa) <danielwa@xxxxxxxxx>
Closes: https://lore.kernel.org/lkml/ZzTI+biIUTvFT6NC@goliath/
Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
drivers/platform/x86/p2sb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/platform/x86/p2sb.c b/drivers/platform/x86/p2sb.c
index 31f38309b389..beb94c492eec 100644
--- a/drivers/platform/x86/p2sb.c
+++ b/drivers/platform/x86/p2sb.c
@@ -25,6 +25,8 @@
static const struct x86_cpu_id p2sb_cpu_ids[] = {
X86_MATCH_VFM(INTEL_ATOM_GOLDMONT, P2SB_DEVFN_GOLDMONT),
+ X86_MATCH_VFM(INTEL_ATOM_GOLDMONT_D, P2SB_DEVFN_GOLDMONT),
+ X86_MATCH_VFM(INTEL_ATOM_GOLDMONT_PLUS, P2SB_DEVFN_GOLDMONT),
{}
};
--
2.47.0