Skip to contentSkip to conversation

mtd: fixup CFI on ixp4xx

RFC PATCH Applied Arnd Bergmann 3 participants 6 messages Sep 27, 2021 – Oct 15, 2021 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 mtd: fixup CFI on ixp4xx

From: Arnd Bergmann <[email protected]>

drivers/mtd/maps/ixp4xx.c requires MTD_CFI_BE_BYTE_SWAP to be set in order to compile.

drivers/mtd/maps/ixp4xx.c:57:4: error: #error CONFIG_MTD_CFI_BE_BYTE_SWAP required

This patch avoids the #error output by enforcing the policy in Kconfig. Not sure if this is the right approach, but it helps doing randconfig builds.

---
Any other ideas for how to address it?

---
 drivers/mtd/chips/Kconfig | 2 ++
 drivers/mtd/maps/Kconfig  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/chips/Kconfig +2 -0
index aef14990e5f7..19726ebd973d 100644
@@ -55,12 +55,14 @@ choice
 	  LITTLE_ENDIAN_BYTE, if the bytes are reversed.
 
 config MTD_CFI_NOSWAP
+	depends on !ARCH_IXP4XX || CPU_BIG_ENDIAN
 	bool "NO"
 
 config MTD_CFI_BE_BYTE_SWAP
 	bool "BIG_ENDIAN_BYTE"
 
 config MTD_CFI_LE_BYTE_SWAP
+	depends on !ARCH_IXP4XX
 	bool "LITTLE_ENDIAN_BYTE"
 
 endchoice
drivers/mtd/maps/Kconfig +1 -1
index aaa164b977fe..4945caa88345 100644
@@ -302,7 +302,7 @@ config MTD_DC21285
 
 config MTD_IXP4XX
 	tristate "CFI Flash device mapped on Intel IXP4xx based systems"
-	depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
+	depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX && MTD_CFI_ADV_OPTIONS
 	help
 	  This enables MTD access to flash devices on platforms based
 	  on Intel's IXP4xx family of network processors such as the
Signature · 1 line
2.29.2
maintainer
#1 lore raw

Hi Arnd,

[email protected] wrote on Mon, 27 Sep 2021 16:10:37 +0200:

Quoted 7 lines

From: Arnd Bergmann <[email protected]>

drivers/mtd/maps/ixp4xx.c requires MTD_CFI_BE_BYTE_SWAP to be set in order to compile.

drivers/mtd/maps/ixp4xx.c:57:4: error: #error CONFIG_MTD_CFI_BE_BYTE_SWAP required

Quoted 7 lines

This patch avoids the #error output by enforcing the policy in Kconfig. Not sure if this is the right approach, but it helps doing randconfig builds.

---
Any other ideas for how to address it?

I am fine with the approach. Should I wait for someone else's Ack?

Thanks,
Miquèl

Quoted 37 lines
---
 drivers/mtd/chips/Kconfig | 2 ++
 drivers/mtd/maps/Kconfig  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/chips/Kconfig +2 -0
index aef14990e5f7..19726ebd973d 100644
@@ -55,12 +55,14 @@ choice
 	  LITTLE_ENDIAN_BYTE, if the bytes are reversed.
 
 config MTD_CFI_NOSWAP
+	depends on !ARCH_IXP4XX || CPU_BIG_ENDIAN
 	bool "NO"
 
 config MTD_CFI_BE_BYTE_SWAP
 	bool "BIG_ENDIAN_BYTE"
 
 config MTD_CFI_LE_BYTE_SWAP
+	depends on !ARCH_IXP4XX
 	bool "LITTLE_ENDIAN_BYTE"
 
 endchoice
drivers/mtd/maps/Kconfig +1 -1
index aaa164b977fe..4945caa88345 100644
@@ -302,7 +302,7 @@ config MTD_DC21285
 
 config MTD_IXP4XX
 	tristate "CFI Flash device mapped on Intel IXP4xx based systems"
-	depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
+	depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX && MTD_CFI_ADV_OPTIONS
 	help
 	  This enables MTD access to flash devices on platforms based
 	  on Intel's IXP4xx family of network processors such as the
#2 lore raw
Quoted 16 lines · Miquel Raynal

Hi Arnd,

[email protected] wrote on Mon, 27 Sep 2021 16:10:37 +0200:

Quoted 11 lines

From: Arnd Bergmann <[email protected]>

drivers/mtd/maps/ixp4xx.c requires MTD_CFI_BE_BYTE_SWAP to be set in order to compile.

drivers/mtd/maps/ixp4xx.c:57:4: error: #error CONFIG_MTD_CFI_BE_BYTE_SWAP required

This patch avoids the #error output by enforcing the policy in Kconfig. Not sure if this is the right approach, but it helps doing randconfig builds.

Quoted 5 lines
Quoted 3 lines

---
Any other ideas for how to address it?

I am fine with the approach. Should I wait for someone else's Ack?

Maybe wait a few days to see if there are objections or any better ideas then. I'd certainly be happy to never run into this problem again.

Arnd

Acked-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

drivers/mtd/maps/ixp4xx.c requires MTD_CFI_BE_BYTE_SWAP to be set in order to compile.

Quoted 7 lines

drivers/mtd/maps/ixp4xx.c:57:4: error: #error CONFIG_MTD_CFI_BE_BYTE_SWAP required

This patch avoids the #error output by enforcing the policy in Kconfig. Not sure if this is the right approach, but it helps doing randconfig builds.

Quoted 1 line

Any other ideas for how to address it?

We will "soon" have IXP4xx transitioned to device tree and then physmap-ixp4xx.c is used instead, and this entire driver can be deleted. I will get there, we just need to remember to mop of cruft like this at the end of it.

Yours,
Linus Walleij

#4 lore raw
Quoted 8 lines · Linus Walleij
Quoted 1 line · Arnd Bergmann

Any other ideas for how to address it?

We will "soon" have IXP4xx transitioned to device tree and then physmap-ixp4xx.c is used instead, and this entire driver can be deleted. I will get there, we just need to remember to mop of cruft like this at the end of it.

Ah, perfect. In that case I'm not worried about my patch doing anything wrong at all, and we can just backport that to stable kernels after it's merged, while future kernels will won't even need it.

Arnd

maintainer Applied
#5 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

drivers/mtd/maps/ixp4xx.c requires MTD_CFI_BE_BYTE_SWAP to be set in order to compile.

Quoted 8 lines

drivers/mtd/maps/ixp4xx.c:57:4: error: #error CONFIG_MTD_CFI_BE_BYTE_SWAP required

This patch avoids the #error output by enforcing the policy in Kconfig. Not sure if this is the right approach, but it helps doing randconfig builds.

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel