Skip to contentSkip to conversation

ACPI / LPSS: Add guards against CONFIG_PCI

PATCH Superseded Sinan Kaya 3 participants 18 messages Dec 22, 2018 – Dec 25, 2018 2 messages not in the archive

Subsystems (13)
DRM drivers x86 Sound DRM misc +9 more subsystems

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sinan Kaya

author
#1 lore raw

PATCH 1/11 ACPI / LPSS: Add guards against CONFIG_PCI

In reply to a message not in the archive

We can now compile ACPI without PCI support. If code depends on CONFIG_PCI, it needs to explicitly guard that piece.

---
 drivers/acpi/acpi_lpss.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/acpi/acpi_lpss.c +4 -1
index 5f94c35d165f..4148abcdf9ef 100644
@@ -534,8 +534,11 @@ static struct device *acpi_lpss_find_device(const char *hid, const char *uid)
 	dev = bus_find_device(&platform_bus_type, NULL, &data, match_hid_uid);
 	if (dev)
 		return dev;
-
+#ifdef CONFIG_PCI
 	return bus_find_device(&pci_bus_type, NULL, &data, match_hid_uid);
+#else
+	return NULL;
+#endif
 }
 
 static bool acpi_lpss_dep(struct acpi_device *adev, acpi_handle handle)
Signature · 1 line
2.19.0
author
#2 lore raw

PATCH 2/11 ata: make PCI dependency explicit for PATA_ACPI

In reply to a message not in the archive

PATA_ACPI is a PCI device driver but the PCI dependency has not been explicitly called out.

---
 drivers/ata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/Kconfig +1 -1
index 4ca7a6b4eaae..8218db17ebdb 100644
@@ -1091,7 +1091,7 @@ comment "Generic fallback / legacy drivers"
 
 config PATA_ACPI
 	tristate "ACPI firmware driver for PATA"
-	depends on ATA_ACPI && ATA_BMDMA
+	depends on ATA_ACPI && ATA_BMDMA && PCI
 	help
 	  This option enables an ACPI method driver which drives
 	  motherboard PATA controller interfaces through the ACPI
Signature · 1 line
2.19.0
author
#3 lore raw

PATCH 3/11 vga-switcheroo: make PCI dependency explicit

In reply to a message not in the archive

This driver depends on the PCI infrastructure but the dependency has not been explicitly called out.

---
 drivers/gpu/vga/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/vga/Kconfig +1 -0
index b677e5d524e6..d5f1d8e1c6f8 100644
@@ -21,6 +21,7 @@ config VGA_SWITCHEROO
 	bool "Laptop Hybrid Graphics - GPU switching support"
 	depends on X86
 	depends on ACPI
+	depends on PCI
 	select VGA_ARB
 	help
 	  Many laptops released in 2008/9/10 have two GPUs with a multiplexer
Signature · 6 lines
2.19.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#5 lore raw

PATCH 4/11 platform/x86: make PCI dependency explicit

In reply to a message not in the archive

ipss driver is a PCI device driver but this has not been mentioned anywhere in Kconfig.

---
 drivers/platform/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/Kconfig +1 -1
index e3b62c2ee8d1..b36ea14b41ad 100644
@@ -1009,7 +1009,7 @@ config INTEL_MFLD_THERMAL
 
 config INTEL_IPS
 	tristate "Intel Intelligent Power Sharing"
-	depends on ACPI
+	depends on ACPI && PCI
 	---help---
 	  Intel Calpella platforms support dynamic power sharing between the
 	  CPU and GPU, maximizing performance in a given TDP.  This driver,
Signature · 1 line
2.19.0
author
#6 lore raw

PATCH 5/11 platform/x86: intel_pmc: Hide PCI specific pieces behind CONFIG_PCI

In reply to a message not in the archive

In the configuration where CONFIG_PCI is unset, this driver is failing to compile due to PCI framework dependencies. Hide these behind CONFIG_PCI ifdef.

---
 drivers/platform/x86/intel_pmc_ipc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/platform/x86/intel_pmc_ipc.c +6 -0
index 7964ba22ef8d..d85dfed3bf9c 100644
@@ -504,6 +504,7 @@ static irqreturn_t ioc(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_PCI
 static int ipc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct intel_pmc_ipc_dev *pmc = &ipcdev;
@@ -556,6 +557,7 @@ static struct pci_driver ipc_pci_driver = {
 	.id_table = ipc_pci_ids,
 	.probe = ipc_pci_probe,
 };
+#endif
 
 static ssize_t intel_pmc_ipc_simple_cmd_store(struct device *dev,
 					      struct device_attribute *attr,
@@ -1007,18 +1009,22 @@ static int __init intel_pmc_ipc_init(void)
 		pr_err("Failed to register PMC ipc platform driver\n");
 		return ret;
 	}
+#ifdef CONFIG_PCI
 	ret = pci_register_driver(&ipc_pci_driver);
 	if (ret) {
 		pr_err("Failed to register PMC ipc pci driver\n");
 		platform_driver_unregister(&ipc_plat_driver);
 		return ret;
 	}
+#endif
 	return ret;
 }
 
 static void __exit intel_pmc_ipc_exit(void)
 {
+#ifdef CONFIG_PCI
 	pci_unregister_driver(&ipc_pci_driver);
+#endif
 	platform_driver_unregister(&ipc_plat_driver);
 }
 
Signature · 1 line
2.19.0
author
#7 lore raw

PATCH 6/11 platform/x86: apple-gmux: hide PCI specific code

In reply to a message not in the archive

Code is scanning PCI bus to find out if it is switchable or not. If CONFIG_PCI is not set, assume unswitchable.

---
 drivers/platform/x86/apple-gmux.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/apple-gmux.c +4 -0
index fd2ffebc868f..b552b54bf58b 100644
@@ -742,8 +742,12 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
 	 * If Thunderbolt is present, the external DP port is not fully
 	 * switchable. Force its AUX channel to the discrete GPU.
 	 */
+#ifdef CONFIG_PCI
 	gmux_data->external_switchable =
 		!bus_for_each_dev(&pci_bus_type, NULL, NULL, is_thunderbolt);
+#else
+	gmux_data->external_switchable = false;
+#endif
 	if (!gmux_data->external_switchable)
 		gmux_write8(gmux_data, GMUX_PORT_SWITCH_EXTERNAL, 3);
 
Signature · 1 line
2.19.0
author
#12 lore raw

PATCH 7/11 drivers: thermal: Hide PCI driver when CONFIG_PCI is unset

In reply to a message not in the archive

This driver is both a platform and PCI driver. Hide PCI specific pieces when CONFIG_PCI is unset.

---
 .../intel/int340x_thermal/processor_thermal_device.c      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +6 -2
index 284cf2c5a8fd..b84a475a1162 100644
@@ -374,6 +374,7 @@ static int int3401_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PCI
 static irqreturn_t proc_thermal_pci_msi_irq(int irq, void *devid)
 {
 	struct proc_thermal_device *proc_priv;
@@ -482,6 +483,7 @@ static struct pci_driver proc_thermal_pci_driver = {
 	.remove		= proc_thermal_pci_remove,
 	.id_table	= proc_thermal_pci_ids,
 };
+#endif
 
 static const struct acpi_device_id int3401_device_ids[] = {
 	{"INT3401", 0},
@@ -505,16 +507,18 @@ static int __init proc_thermal_init(void)
 	ret = platform_driver_register(&int3401_driver);
 	if (ret)
 		return ret;
-
+#ifdef CONFIG_PCI
 	ret = pci_register_driver(&proc_thermal_pci_driver);
-
+#endif
 	return ret;
 }
 
 static void __exit proc_thermal_exit(void)
 {
 	platform_driver_unregister(&int3401_driver);
+#ifdef CONFIG_PCI
 	pci_unregister_driver(&proc_thermal_pci_driver);
+#endif
 }
 
 module_init(proc_thermal_init);
Signature · 1 line
2.19.0
author
#13 lore raw

PATCH 8/11 ASoC: Intel: Make PCI dependency explicit

In reply to a message not in the archive

IOSF_MBI driver depends on CONFIG_PCI set but this is not specified anywhere.

---
 sound/soc/intel/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/Kconfig +1 -1
index 2fd1b61e8331..b0764b2fe001 100644
@@ -91,7 +91,7 @@ config SND_SST_ATOM_HIFI2_PLATFORM_PCI
 config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
 	tristate "ACPI HiFi2 (Baytrail, Cherrytrail) Platforms"
 	default ACPI
-	depends on X86 && ACPI
+	depends on X86 && ACPI && PCI
 	select SND_SST_IPC_ACPI
 	select SND_SST_ATOM_HIFI2_PLATFORM
 	select SND_SOC_ACPI_INTEL_MATCH
Signature · 1 line
2.19.0
author
#17 lore raw

PATCH 9/11 mmc: add PCI dependency into IOSF_MBI

In reply to a message not in the archive

Select IOSF_MBI only when PCI is set.

---
 drivers/mmc/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/Kconfig +1 -1
index e26b8145efb3..4c5f037b246d 100644
@@ -117,7 +117,7 @@ config MMC_RICOH_MMC
 config MMC_SDHCI_ACPI
 	tristate "SDHCI support for ACPI enumerated SDHCI controllers"
 	depends on MMC_SDHCI && ACPI
-	select IOSF_MBI if X86
+	select IOSF_MBI if (X86 && PCI)
 	help
 	  This selects support for ACPI enumerated SDHCI controllers,
 	  identified by ACPI Compatibility ID PNP0D40 or specific
Signature · 1 line
2.19.0
author
#18 lore raw

PATCH 10/11 x86: select IOSF_MBI only when CONFIG_PCI is set

In reply to a message not in the archive

Need CONFIG_PCI to be set in order to be able to use IOSF_MBI functionality.

---
 arch/x86/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/Kconfig +1 -1
index cc4f0c6ee1ed..322a58ababb0 100644
@@ -617,7 +617,7 @@ config X86_INTEL_QUARK
 
 config X86_INTEL_LPSS
 	bool "Intel Low Power Subsystem Support"
-	depends on X86 && ACPI
+	depends on X86 && ACPI && PCI
 	select COMMON_CLK
 	select PINCTRL
 	select IOSF_MBI
Signature · 1 line
2.19.0
author
#19 lore raw

PATCH 11/11 drivers: thermal: Make PCI dependency explicit

In reply to a message not in the archive

IOSF_CORE depends on PCI. This was never mentioned.

---
 drivers/thermal/intel/int340x_thermal/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/intel/int340x_thermal/Kconfig +1 -1
index 0582bd12a239..0ca908d12750 100644
@@ -4,7 +4,7 @@
 
 config INT340X_THERMAL
 	tristate "ACPI INT340X thermal drivers"
-	depends on X86 && ACPI
+	depends on X86 && ACPI && PCI
 	select THERMAL_GOV_USER_SPACE
 	select ACPI_THERMAL_REL
 	select ACPI_FAN
Signature · 1 line
2.19.0
#14 lore raw

Re: [PATCH v1 08/11] ASoC: Intel: Make PCI dependency explicit

In reply to Sinan Kaya
Quoted 2 lines · Sinan Kaya

IOSF_MBI driver depends on CONFIG_PCI set but this is not specified anywhere.

wrong patch description...?

Quoted 19 lines
---
 sound/soc/intel/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/Kconfig +1 -1
index 2fd1b61e8331..b0764b2fe001 100644
@@ -91,7 +91,7 @@ config SND_SST_ATOM_HIFI2_PLATFORM_PCI
 config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
 	tristate "ACPI HiFi2 (Baytrail, Cherrytrail) Platforms"
 	default ACPI
-	depends on X86 && ACPI
+	depends on X86 && ACPI && PCI
 	select SND_SST_IPC_ACPI
 	select SND_SST_ATOM_HIFI2_PLATFORM
 	select SND_SOC_ACPI_INTEL_MATCH
Signature · 1 line
~Randy
author
#15 lore raw

Re: [PATCH v1 08/11] ASoC: Intel: Make PCI dependency explicit

Quoted 6 lines · Randy Dunlap
Quoted 2 lines · Sinan Kaya

IOSF_MBI driver depends on CONFIG_PCI set but this is not specified anywhere.

wrong patch description...?

Not really...
Code does unconditional select for IOSF_MBI.

Quoted 24 lines
Quoted 12 lines
---
 sound/soc/intel/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/Kconfig +0 -0
index 2fd1b61e8331..b0764b2fe001 100644

sound/soc/intel/Kconfig config SND_SST_ATOM_HIFI2_PLATFORM_PCI · line 97

Quoted 8 lines
sound/soc/intel/Kconfig +1 -1
@@ -91,7 +91,7 @@ config SND_SST_ATOM_HIFI2_PLATFORM_PCI
 config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
      tristate "ACPI HiFi2 (Baytrail, Cherrytrail) Platforms"
      default ACPI
-     depends on X86 && ACPI
+     depends on X86 && ACPI && PCI
      select SND_SST_IPC_ACPI
      select SND_SST_ATOM_HIFI2_PLATFORM
      select SND_SOC_ACPI_INTEL_MATCH

--
~Randy

Reviewed-by on v1 3/11
#4 lore raw

Re: [PATCH v1 03/11] vga-switcheroo: make PCI dependency explicit

In reply to Sinan Kaya
Quoted 4 lines · Sinan Kaya

This driver depends on the PCI infrastructure but the dependency has not been explicitly called out.

Quoted 18 lines
---
 drivers/gpu/vga/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/vga/Kconfig +1 -0
index b677e5d524e6..d5f1d8e1c6f8 100644
@@ -21,6 +21,7 @@ config VGA_SWITCHEROO
 	bool "Laptop Hybrid Graphics - GPU switching support"
 	depends on X86
 	depends on ACPI
+	depends on PCI
 	select VGA_ARB
 	help
 	  Many laptops released in 2008/9/10 have two GPUs with a multiplexer
Signature · 1 line
2.19.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Re: [PATCH v1 06/11] platform/x86: apple-gmux: hide PCI specific code

In reply to Sinan Kaya
Quoted 14 lines · Sinan Kaya

Code is scanning PCI bus to find out if it is switchable or not. If CONFIG_PCI is not set, assume unswitchable.

---
 drivers/platform/x86/apple-gmux.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/apple-gmux.c +0 -0
index fd2ffebc868f..b552b54bf58b 100644
@@ -742,8 +742,12 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
 	 * If Thunderbolt is present, the external DP port is not fully

drivers/platform/x86/apple-gmux.c static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) · line 752

Quoted 10 lines
drivers/platform/x86/apple-gmux.c +4 -0
 	 * switchable. Force its AUX channel to the discrete GPU.
 	 */
+#ifdef CONFIG_PCI
 	gmux_data->external_switchable =
 		!bus_for_each_dev(&pci_bus_type, NULL, NULL, is_thunderbolt);
+#else
+	gmux_data->external_switchable = false;
+#endif
 	if (!gmux_data->external_switchable)
 		gmux_write8(gmux_data, GMUX_PORT_SWITCH_EXTERNAL, 3);

This driver is only used on 2008+ MacBook Pros and the 2013+ Mac Pro, all of which have PCI and are pretty much unusable with CONFIG_PCI=n.

So it is okay to just add "depends on PCI" for this driver, as you did with other drivers, and I think that's preferrable to an #ifdef.

You can also drop the "platform/x86: " prefix from the subject if you like, all previous commits to this driver just use "apple-gmux: ".

If you are okay with these changes, feel free to add my Reviewed-by when respinning.

Thanks,

Lukas

author Reviewed-by Lukas Wunner
#9 lore raw

Re: [PATCH v1 06/11] platform/x86: apple-gmux: hide PCI specific code

Quoted 29 lines · Lukas Wunner
Quoted 14 lines · Sinan Kaya

Code is scanning PCI bus to find out if it is switchable or not. If CONFIG_PCI is not set, assume unswitchable.

---
  drivers/platform/x86/apple-gmux.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/platform/x86/apple-gmux.c +0 -0
index fd2ffebc868f..b552b54bf58b 100644
@@ -742,8 +742,12 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
  	 * If Thunderbolt is present, the external DP port is not fully

drivers/platform/x86/apple-gmux.c static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) · line 752

Quoted 10 lines
drivers/platform/x86/apple-gmux.c +4 -0
  	 * switchable. Force its AUX channel to the discrete GPU.
  	 */
+#ifdef CONFIG_PCI
  	gmux_data->external_switchable =
  		!bus_for_each_dev(&pci_bus_type, NULL, NULL, is_thunderbolt);
+#else
+	gmux_data->external_switchable = false;
+#endif
  	if (!gmux_data->external_switchable)
  		gmux_write8(gmux_data, GMUX_PORT_SWITCH_EXTERNAL, 3);

This driver is only used on 2008+ MacBook Pros and the 2013+ Mac Pro, all of which have PCI and are pretty much unusable with CONFIG_PCI=n.

Quoted 9 lines

So it is okay to just add "depends on PCI" for this driver, as you did with other drivers, and I think that's preferrable to an #ifdef.

You can also drop the "platform/x86: " prefix from the subject if you like, all previous commits to this driver just use "apple-gmux: ".

If you are okay with these changes, feel free to add my Reviewed-by when respinning.

This is how I updated this patch:

commit 867d96cb6b75124b7ce11014425b8c57a8350e61 (HEAD)

Author: Sinan Kaya <[email protected]>
Date:   Fri Dec 21 23:24:13 2018 +0000

apple-gmux: Make PCI dependency explicit

This driver depends on the PCI infrastructure but the dependency has not been explicitly called out.

drivers/platform/x86/Kconfig +1 -0
index b36ea14b41ad..86b75fa55dbc 100644
@@ -1136,6 +1136,7 @@ config SAMSUNG_Q10
 config APPLE_GMUX
        tristate "Apple Gmux Driver"
        depends on ACPI
+       depends on PCI
        depends on PNP
        depends on BACKLIGHT_CLASS_DEVICE
        depends on BACKLIGHT_APPLE=n || BACKLIGHT_APPLE
Quoted 4 lines

Thanks,

Lukas

author
#16 lore raw

Re: [PATCH v1 08/11] ASoC: Intel: Make PCI dependency explicit

In reply to Sinan Kaya
Quoted 8 lines · Sinan Kaya
Quoted 4 lines · Randy Dunlap
Quoted 2 lines · Sinan Kaya

IOSF_MBI driver depends on CONFIG_PCI set but this is not specified anywhere.

wrong patch description...?

Not really...
Code does unconditional select for IOSF_MBI.

I'll put the above comment into the commit message to make this change cleaner.

author
#11 lore raw

Re: [PATCH v1 06/11] platform/x86: apple-gmux: hide PCI specific code

In reply to a message not in the archive
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Lukas Wunner
Quoted 3 lines · Sinan Kaya

Code is scanning PCI bus to find out if it is switchable or not. If CONFIG_PCI is not set, assume unswitchable.

Quoted 8 lines
Quoted 6 lines

You can also drop the "platform/x86: " prefix from the subject if you like, all previous commits to this driver just use "apple-gmux: ".

If you are okay with these changes, feel free to add my Reviewed-by when respinning.

I'm not okay with dropping prefix. You can but may not, please, remove the prefix.

You mean 'keep the prefix' above, right?

What is the consensus?

Quoted 6 lines

--
With Best Regards,
Andy Shevchenko