Skip to contentSkip to conversation

MIPS: ralink: enable PCI support only if driver for mt7621 SoC is selected

PATCH RESEND In review Sergio Paracuellos 2 participants 3 messages Oct 31, 2019 – Nov 1, 2019

Subsystems (4)
lore
Share & tools
lore

Sergio Paracuellos

author maintainer
#0 lore raw

PATCH RESEND 1/1 MIPS: ralink: enable PCI support only if driver for mt7621 SoC is selected

Some versions of SoC MT7621 have three PCI express hosts. Some boards make use of those PCI through the staging driver mt7621-pci. Recently PCI support has been removed from MT7621 Soc kernel configuration due to a build error. This makes imposible to compile staging driver and produces a regression for gnubee based boards. Enable support for PCI again but enable it only if staging mt7621-pci driver is selected.

Fixes c4d48cf5e2f0 ("MIPS: ralink: deactivate PCI support for SOC_MT7621")
---
 arch/mips/ralink/Kconfig           | 1 +
 drivers/staging/mt7621-pci/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/mips/ralink/Kconfig +1 -0
index 1434fa60f3db..94e9ce994494 100644
@@ -51,6 +51,7 @@ choice
 		select MIPS_GIC
 		select COMMON_CLK
 		select CLKSRC_MIPS_GIC
+		select HAVE_PCI if PCI_MT7621
 endchoice
 
 choice
drivers/staging/mt7621-pci/Kconfig +0 -1
index af928b75a940..ce58042f2f21 100644
@@ -2,7 +2,6 @@
 config PCI_MT7621
 	tristate "MediaTek MT7621 PCI Controller"
 	depends on RALINK
-	depends on PCI
 	select PCI_DRIVERS_GENERIC
 	help
 	  This selects a driver for the MediaTek MT7621 PCI Controller.
Signature · 1 line
2.19.1
#1 lore raw

Hi Sergio,

Quoted 17 lines · Sergio Paracuellos
arch/mips/ralink/Kconfig +1 -0
index 1434fa60f3db..94e9ce994494 100644
@@ -51,6 +51,7 @@ choice
 		select MIPS_GIC
 		select COMMON_CLK
 		select CLKSRC_MIPS_GIC
+		select HAVE_PCI if PCI_MT7621
 endchoice
 
 choice
drivers/staging/mt7621-pci/Kconfig +0 -0
index af928b75a940..ce58042f2f21 100644

drivers/staging/mt7621-pci/Kconfig line 7

Quoted 7 lines
drivers/staging/mt7621-pci/Kconfig +0 -1
@@ -2,7 +2,6 @@
 config PCI_MT7621
 	tristate "MediaTek MT7621 PCI Controller"
 	depends on RALINK
-	depends on PCI
 	select PCI_DRIVERS_GENERIC
 	help
 	  This selects a driver for the MediaTek MT7621 PCI Controller.

This doesn't seem right to me - doesn't this now allow the PCI controller driver to build without PCI support enabled? Are you sure that won't allow more build failures?

How does enabling the driver change whether or not the SoC has PCI support? The SoC is always the same hardware regardless of whether you enable the driver for it, so this doesn't seem right to me.

Hauke - do you recall what the build failure you mentioned in commit c4d48cf5e2f0 ("MIPS: ralink: deactivate PCI support for SOC_MT7621") was?

Thanks,
Paul

author maintainer
#2 lore raw

Hi Paul,

Thanks for the review.

Quoted 24 lines · Paul Burton

Hi Sergio,

Quoted 20 lines · Sergio Paracuellos
arch/mips/ralink/Kconfig +1 -0
index 1434fa60f3db..94e9ce994494 100644
@@ -51,6 +51,7 @@ choice
              select MIPS_GIC
              select COMMON_CLK
              select CLKSRC_MIPS_GIC
+             select HAVE_PCI if PCI_MT7621
 endchoice
 
 choice
drivers/staging/mt7621-pci/Kconfig +0 -0
index af928b75a940..ce58042f2f21 100644
@@ -2,7 +2,6 @@
 config PCI_MT7621
      tristate "MediaTek MT7621 PCI Controller"
      depends on RALINK
Quoted 8 lines

drivers/staging/mt7621-pci/Kconfig line 7

Quoted 4 lines
drivers/staging/mt7621-pci/Kconfig +0 -1
-     depends on PCI
      select PCI_DRIVERS_GENERIC
      help
        This selects a driver for the MediaTek MT7621 PCI Controller.

This doesn't seem right to me - doesn't this now allow the PCI controller driver to build without PCI support enabled? Are you sure that won't allow more build failures?

No, I am not really sure. I don't really know what is the best approach to be able to avoid the build failure reported in c4d48cf5e2f0 ("MIPS: ralink: deactivate PCI support for SOC_MT7621") but this commit is a regression and avoid to properly build the MediaTek MT7621 PCI Controller driver located in staging.

Quoted 4 lines

How does enabling the driver change whether or not the SoC has PCI support? The SoC is always the same hardware regardless of whether you enable the driver for it, so this doesn't seem right to me.

So, this SOC has three PCI's, so "select HAVE_PCI" seems the right thing to do for the SoC config but it seems in some versions that has build failures.

Quoted 4 lines

Hauke - do you recall what the build failure you mentioned in commit c4d48cf5e2f0 ("MIPS: ralink: deactivate PCI support for SOC_MT7621") was?

It would be awesome to know that to be able to get a general valid solution.

Quoted 3 lines

Thanks,
Paul

Best regards,
Sergio Paracuellos