Skip to contentSkip to conversation

powerpc: select HAVE_PATA_PLATFORM in PPC instead of creating a PPC dependency

PATCH In review Lukas Bulwahn 4 participants 10 messages Sep 9, 2022 – Sep 11, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc: select HAVE_PATA_PLATFORM in PPC instead of creating a PPC dependency

Commit cc18e0fea790 ("LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver") introduces config HAVE_PATA_PLATFORM, and expects that all architectures simply select this config when the architecture supports using the PATA_PLATFORM driver.

This is properly implemented already for all architectures except for the powerpc architecture. Implement this for powerpc now.

Adjust the config of the powerpc architecture to use the config HAVE_PATA_PLATFORM and simplify the config PATA_PLATFORM to not mention any specific architecture anymore.

---
 arch/powerpc/Kconfig | 1 +
 drivers/ata/Kconfig  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -0
index 39d71d7701bd..2575e21b6e6b 100644
@@ -237,6 +237,7 @@ config PPC
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI				if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
 	select HAVE_OPTPROBES
+	select HAVE_PATA_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_EVENTS_NMI		if PPC64
 	select HAVE_PERF_REGS
drivers/ata/Kconfig +1 -1
index 1c9f4fb2595d..ed3547165528 100644
@@ -1103,7 +1103,7 @@ config PATA_PCMCIA
 
 config PATA_PLATFORM
 	tristate "Generic platform device PATA support"
-	depends on EXPERT || PPC || HAVE_PATA_PLATFORM
+	depends on EXPERT || HAVE_PATA_PLATFORM
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems.
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 ppc: select HAVE_PATA_PLATFORM in PPC instead of creating a PPC dependency

Commit cc18e0fea790 ("LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver") introduces config HAVE_PATA_PLATFORM, and expects that all architectures simply select this config when the architecture supports using the PATA_PLATFORM driver.

This is properly implemented already for all architectures except for the powerpc architecture. Implement this for powerpc now.

Adjust the config of the powerpc architecture to use the config HAVE_PATA_PLATFORM and simplify the config PATA_PLATFORM to not mention any specific architecture anymore.

---
 arch/powerpc/Kconfig | 1 +
 drivers/ata/Kconfig  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -0
index 39d71d7701bd..2575e21b6e6b 100644
@@ -237,6 +237,7 @@ config PPC
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI				if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
 	select HAVE_OPTPROBES
+	select HAVE_PATA_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_EVENTS_NMI		if PPC64
 	select HAVE_PERF_REGS
drivers/ata/Kconfig +1 -1
index 1c9f4fb2595d..ed3547165528 100644
@@ -1103,7 +1103,7 @@ config PATA_PCMCIA
 
 config PATA_PLATFORM
 	tristate "Generic platform device PATA support"
-	depends on EXPERT || PPC || HAVE_PATA_PLATFORM
+	depends on EXPERT || HAVE_PATA_PLATFORM
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems.
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH] ppc: select HAVE_PATA_PLATFORM in PPC instead of creating a PPC dependency

Quoted 6 lines · Lukas Bulwahn

Commit cc18e0fea790 ("LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver") introduces config HAVE_PATA_PLATFORM, and expects that all architectures simply select this config when the architecture supports using the PATA_PLATFORM driver.

Quoted 8 lines

This is properly implemented already for all architectures except for the powerpc architecture. Implement this for powerpc now.

Adjust the config of the powerpc architecture to use the config HAVE_PATA_PLATFORM and simplify the config PATA_PLATFORM to not mention any specific architecture anymore.

Please ignore this patch and pick:

https://lore.kernel.org/linuxppc-dev/[email protected]/

Lukas

Quoted 33 lines
---
 arch/powerpc/Kconfig | 1 +
 drivers/ata/Kconfig  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -0
index 39d71d7701bd..2575e21b6e6b 100644
@@ -237,6 +237,7 @@ config PPC
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_NMI                         if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
        select HAVE_OPTPROBES
+       select HAVE_PATA_PLATFORM
        select HAVE_PERF_EVENTS
        select HAVE_PERF_EVENTS_NMI             if PPC64
        select HAVE_PERF_REGS
drivers/ata/Kconfig +1 -2
index 1c9f4fb2595d..ed3547165528 100644
@@ -1103,7 +1103,7 @@ config PATA_PCMCIA
 
 config PATA_PLATFORM
        tristate "Generic platform device PATA support"
-       depends on EXPERT || PPC || HAVE_PATA_PLATFORM
+       depends on EXPERT || HAVE_PATA_PLATFORM
        help
          This option enables support for generic directly connected ATA
          devices commonly found on embedded systems.
--

2.17.1

#3 lore raw
In reply to Lukas Bulwahn
Quoted 23 lines · Lukas Bulwahn

Commit cc18e0fea790 ("LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver") introduces config HAVE_PATA_PLATFORM, and expects that all architectures simply select this config when the architecture supports using the PATA_PLATFORM driver.

This is properly implemented already for all architectures except for the powerpc architecture. Implement this for powerpc now.

Adjust the config of the powerpc architecture to use the config HAVE_PATA_PLATFORM and simplify the config PATA_PLATFORM to not mention any specific architecture anymore.

---
 arch/powerpc/Kconfig | 1 +
 drivers/ata/Kconfig  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig +0 -0
index 39d71d7701bd..2575e21b6e6b 100644

arch/powerpc/Kconfig config PPC · line 243

Quoted 7 lines
arch/powerpc/Kconfig +1 -0
@@ -237,6 +237,7 @@ config PPC
 	select HAVE_MOD_ARCH_SPECIFIC
 	select HAVE_NMI				if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
 	select HAVE_OPTPROBES
+	select HAVE_PATA_PLATFORM
 	select HAVE_PERF_EVENTS
 	select HAVE_PERF_EVENTS_NMI		if PPC64
 	select HAVE_PERF_REGS

I don't see a single powerpc machine that creates a
name="pata_platform" platform_device. I suspect this was
only needed bwfore 2007 commit 9cd55be4d223 ("[POWERPC] pasemi:
Move electra-ide to pata_of_platform"), so the "|| PPC" bit should just get removed without adding the HAVE_PATA_PLATFORM bit.

Arnd

#4 lore raw
Quoted 31 lines · Arnd Bergmann
Quoted 29 lines · Lukas Bulwahn

Commit cc18e0fea790 ("LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver") introduces config HAVE_PATA_PLATFORM, and expects that all architectures simply select this config when the architecture supports using the PATA_PLATFORM driver.

This is properly implemented already for all architectures except for the powerpc architecture. Implement this for powerpc now.

Adjust the config of the powerpc architecture to use the config HAVE_PATA_PLATFORM and simplify the config PATA_PLATFORM to not mention any specific architecture anymore.

---
 arch/powerpc/Kconfig | 1 +
 drivers/ata/Kconfig  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -0
index 39d71d7701bd..2575e21b6e6b 100644
@@ -237,6 +237,7 @@ config PPC
      select HAVE_MOD_ARCH_SPECIFIC
      select HAVE_NMI                         if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
      select HAVE_OPTPROBES
+     select HAVE_PATA_PLATFORM
      select HAVE_PERF_EVENTS
      select HAVE_PERF_EVENTS_NMI             if PPC64
Quoted 9 lines

arch/powerpc/Kconfig config PPC · line 243

Quoted 1 line
arch/powerpc/Kconfig +0 -0
      select HAVE_PERF_REGS

I don't see a single powerpc machine that creates a
name="pata_platform" platform_device. I suspect this was
only needed bwfore 2007 commit 9cd55be4d223 ("[POWERPC] pasemi:
Move electra-ide to pata_of_platform"), so the "|| PPC" bit should just get removed without adding the HAVE_PATA_PLATFORM bit.

Thanks for your investigation. I will send a corresponding patch v3.

Lukas

#5 lore raw
In reply to Arnd Bergmann

Le 09/09/2022 à 13:09, Arnd Bergmann a écrit :

Quoted 30 lines · Lukas Bulwahn
Quoted 29 lines

Commit cc18e0fea790 ("LIBATA: Add HAVE_PATA_PLATFORM to select PATA_PLATFORM driver") introduces config HAVE_PATA_PLATFORM, and expects that all architectures simply select this config when the architecture supports using the PATA_PLATFORM driver.

This is properly implemented already for all architectures except for the powerpc architecture. Implement this for powerpc now.

Adjust the config of the powerpc architecture to use the config HAVE_PATA_PLATFORM and simplify the config PATA_PLATFORM to not mention any specific architecture anymore.

---
  arch/powerpc/Kconfig | 1 +
  drivers/ata/Kconfig  | 2 +-
  2 files changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -0
index 39d71d7701bd..2575e21b6e6b 100644
@@ -237,6 +237,7 @@ config PPC
  	select HAVE_MOD_ARCH_SPECIFIC
  	select HAVE_NMI				if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
  	select HAVE_OPTPROBES
+	select HAVE_PATA_PLATFORM
  	select HAVE_PERF_EVENTS
  	select HAVE_PERF_EVENTS_NMI		if PPC64
Quoted 8 lines

arch/powerpc/Kconfig config PPC · line 243

Quoted 1 line
arch/powerpc/Kconfig +0 -0
  	select HAVE_PERF_REGS

I don't see a single powerpc machine that creates a
name="pata_platform" platform_device. I suspect this was
only needed bwfore 2007 commit 9cd55be4d223 ("[POWERPC] pasemi:
Move electra-ide to pata_of_platform"), so the "|| PPC" bit should just get removed without adding the HAVE_PATA_PLATFORM bit.

But that was added in 2008 by commit 61f7162117d4 ("libata:
pata_of_platform: OF-Platform PATA device driver")

#6 lore raw
Quoted 10 lines · Christophe Leroy

Le 09/09/2022 à 13:09, Arnd Bergmann a écrit :

Quoted 8 lines · Lukas Bulwahn

I don't see a single powerpc machine that creates a
name="pata_platform" platform_device. I suspect this was
only needed bwfore 2007 commit 9cd55be4d223 ("[POWERPC] pasemi:
Move electra-ide to pata_of_platform"), so the "|| PPC" bit should just get removed without adding the HAVE_PATA_PLATFORM bit.

Quoted 2 lines

But that was added in 2008 by commit 61f7162117d4 ("libata:
pata_of_platform: OF-Platform PATA device driver")

Ah, I see. In that case, I think we should probably just always allow PATA_OF_PLATFORM to be enabled regardless of HAVE_PATA_PLATFORM, something like

drivers/ata/Kconfig +3 -3
index 1c9f4fb2595d..c93d97455744 100644
@@ -1102,8 +1102,7 @@ config PATA_PCMCIA
 	  If unsure, say N.
 
 config PATA_PLATFORM
-	tristate "Generic platform device PATA support"
-	depends on EXPERT || PPC || HAVE_PATA_PLATFORM
+	tristate "Generic platform device PATA support" if EXPERT || HAVE_PATA_PLATFORM
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems.
@@ -1112,7 +1111,8 @@ config PATA_PLATFORM
 
 config PATA_OF_PLATFORM
 	tristate "OpenFirmware platform device PATA support"
-	depends on PATA_PLATFORM && OF
+	depends on OF
+	select PATA_PLATFORM
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems with OpenFirmware

and then also drop the "select HAVE_PATA_PLATFORM" from arm64 and arm/versatile.

Or we can go one step further, and either split out the 'pata_platform_driver' into a separate file from '__pata_platform_probe', or merge pata_of_platform.c back into pata_platform.c.

Arnd

#7 lore raw
Quoted 23 lines · Arnd Bergmann
Quoted 10 lines · Christophe Leroy

Le 09/09/2022 à 13:09, Arnd Bergmann a écrit :

Quoted 8 lines · Lukas Bulwahn

I don't see a single powerpc machine that creates a
name="pata_platform" platform_device. I suspect this was
only needed bwfore 2007 commit 9cd55be4d223 ("[POWERPC] pasemi:
Move electra-ide to pata_of_platform"), so the "|| PPC" bit should just get removed without adding the HAVE_PATA_PLATFORM bit.

Quoted 2 lines

But that was added in 2008 by commit 61f7162117d4 ("libata:
pata_of_platform: OF-Platform PATA device driver")

Ah, I see. In that case, I think we should probably just always allow PATA_OF_PLATFORM to be enabled regardless of HAVE_PATA_PLATFORM, something like

drivers/ata/Kconfig +0 -0
index 1c9f4fb2595d..c93d97455744 100644

drivers/ata/Kconfig config PATA_PCMCIA · line 1105

Quoted 6 lines
drivers/ata/Kconfig +1 -2
@@ -1102,8 +1102,7 @@ config PATA_PCMCIA
 	  If unsure, say N.
 
 config PATA_PLATFORM
-	tristate "Generic platform device PATA support"
-	depends on EXPERT || PPC || HAVE_PATA_PLATFORM
+	tristate "Generic platform device PATA support" if EXPERT || HAVE_PATA_PLATFORM

Shouldn't this be:

	tristate "Generic platform device PATA support" if EXPERT || PPC

?

And while at it, it would be nice to add "|| COMPILE_TEST" too.

Quoted 23 lines
drivers/ata/Kconfig +2 -1
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems.
@@ -1112,7 +1111,8 @@ config PATA_PLATFORM
 
 config PATA_OF_PLATFORM
 	tristate "OpenFirmware platform device PATA support"
-	depends on PATA_PLATFORM && OF
+	depends on OF
+	select PATA_PLATFORM
 	help
 	  This option enables support for generic directly connected ATA
 	  devices commonly found on embedded systems with OpenFirmware

and then also drop the "select HAVE_PATA_PLATFORM" from arm64 and arm/versatile.

Or we can go one step further, and either split out the 'pata_platform_driver' into a separate file from '__pata_platform_probe', or merge pata_of_platform.c back into pata_platform.c.

Arnd

Signature · 2 lines
Damien Le Moal
Western Digital Research
#8 lore raw
Quoted 9 lines · Damien Le Moal

drivers/ata/Kconfig config PATA_PCMCIA · line 1105

Quoted 5 lines · Arnd Bergmann

config PATA_PLATFORM

drivers/ata/Kconfig +1 -2
-	tristate "Generic platform device PATA support"
-	depends on EXPERT || PPC || HAVE_PATA_PLATFORM
+	tristate "Generic platform device PATA support" if EXPERT || HAVE_PATA_PLATFORM

Shouldn't this be:

Quoted 5 lines
	tristate "Generic platform device PATA support" if EXPERT || PPC

?

And while at it, it would be nice to add "|| COMPILE_TEST" too.

The idea was that this can be selected by CONFIG_PATA_OF_PLATFORM in any configuration that has CONFIG_OF enabled. Since PPC has CONFIG_OF enabled unconditionally, there is no need to make this option visible separately.

Same for compile-testing: since CONFIG_OF can be enabled on any architecture, PATA_OF_PLATFORM is already covered by allmodconfig builds anywhere. The separate HAVE_PATA_PLATFORM is only needed for machines that want the non-OF pata-platform module (sh, m68k-mac, mips-sibyte arm-s3c-simtec).

Arnd

#9 lore raw
Quoted 21 lines · Arnd Bergmann
Quoted 9 lines · Damien Le Moal

drivers/ata/Kconfig config PATA_PCMCIA · line 1105

Quoted 5 lines · Arnd Bergmann

config PATA_PLATFORM

drivers/ata/Kconfig +1 -2
-	tristate "Generic platform device PATA support"
-	depends on EXPERT || PPC || HAVE_PATA_PLATFORM
+	tristate "Generic platform device PATA support" if EXPERT || HAVE_PATA_PLATFORM

Shouldn't this be:

Quoted 5 lines
	tristate "Generic platform device PATA support" if EXPERT || PPC

?

And while at it, it would be nice to add "|| COMPILE_TEST" too.

The idea was that this can be selected by CONFIG_PATA_OF_PLATFORM in any configuration that has CONFIG_OF enabled. Since PPC has CONFIG_OF enabled unconditionally, there is no need to make this option visible separately.

Quoted 5 lines

Same for compile-testing: since CONFIG_OF can be enabled on any architecture, PATA_OF_PLATFORM is already covered by allmodconfig builds anywhere. The separate HAVE_PATA_PLATFORM is only needed for machines that want the non-OF pata-platform module (sh, m68k-mac, mips-sibyte arm-s3c-simtec).

Got it. Thanks for the details.

Quoted 2 lines

Arnd

Signature · 2 lines
Damien Le Moal
Western Digital Research