summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>2024-11-28 09:28:34 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-27 13:52:52 +0100
commitd552e2e0687228be734cefa57310d9a3b9f081c2 (patch)
tree3c864c667ec5a6f6cbec29396da5e4a46400cc19 /drivers/platform
parentda3d454cd56dd618eec470dece249d165e6c6845 (diff)
downloadlinux-d552e2e0687228be734cefa57310d9a3b9f081c2.tar.gz
linux-d552e2e0687228be734cefa57310d9a3b9f081c2.tar.bz2
linux-d552e2e0687228be734cefa57310d9a3b9f081c2.zip
p2sb: Introduce the global flag p2sb_hidden_by_bios
[ Upstream commit ae3e6ebc5ab046d434c05c58a3e3f7e94441fec2 ] To prepare for the following fix, introduce the global flag p2sb_hidden_by_bios. Check if the BIOS hides the P2SB device and store the result in the flag. This allows to refer to the check result across functions. Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20241128002836.373745-3-shinichiro.kawasaki@wdc.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Stable-dep-of: 360c400d0f56 ("p2sb: Do not scan and remove the P2SB device when it is unhidden") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/p2sb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/platform/x86/p2sb.c b/drivers/platform/x86/p2sb.c
index d6ee4b34f911..d015ddc9f30e 100644
--- a/drivers/platform/x86/p2sb.c
+++ b/drivers/platform/x86/p2sb.c
@@ -42,6 +42,7 @@ struct p2sb_res_cache {
};
static struct p2sb_res_cache p2sb_resources[NR_P2SB_RES_CACHE];
+static bool p2sb_hidden_by_bios;
static void p2sb_get_devfn(unsigned int *devfn)
{
@@ -157,13 +158,14 @@ static int p2sb_cache_resources(void)
* Unhide the P2SB device here, if needed.
*/
pci_bus_read_config_dword(bus, devfn_p2sb, P2SBC, &value);
- if (value & P2SBC_HIDE)
+ p2sb_hidden_by_bios = value & P2SBC_HIDE;
+ if (p2sb_hidden_by_bios)
pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0);
ret = p2sb_scan_and_cache(bus, devfn_p2sb);
/* Hide the P2SB device, if it was hidden */
- if (value & P2SBC_HIDE)
+ if (p2sb_hidden_by_bios)
pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, P2SBC_HIDE);
pci_unlock_rescan_remove();