LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] [RFC] mtd: fixup CFI on ixp4xx
@ 2021-09-27 14:10 Arnd Bergmann
  2021-09-27 16:33 ` Miquel Raynal
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Arnd Bergmann @ 2021-09-27 14:10 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: Linus Walleij, Imre Kaloz, Krzysztof Halasa, Arnd Bergmann,
	Lukas Bulwahn, Serge Semin, linux-mtd, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
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(-)

diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
index aef14990e5f7..19726ebd973d 100644
--- a/drivers/mtd/chips/Kconfig
+++ b/drivers/mtd/chips/Kconfig
@@ -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
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index aaa164b977fe..4945caa88345 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -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.29.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] mtd: fixup CFI on ixp4xx
  2021-09-27 14:10 [PATCH] [RFC] mtd: fixup CFI on ixp4xx Arnd Bergmann
@ 2021-09-27 16:33 ` Miquel Raynal
  2021-09-27 20:30   ` Arnd Bergmann
  2021-09-27 23:27 ` Linus Walleij
  2021-10-15 10:31 ` Miquel Raynal
  2 siblings, 1 reply; 6+ messages in thread
From: Miquel Raynal @ 2021-09-27 16:33 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Richard Weinberger, Vignesh Raghavendra, Linus Walleij,
	Imre Kaloz, Krzysztof Halasa, Arnd Bergmann, Lukas Bulwahn,
	Serge Semin, linux-mtd, linux-kernel

Hi Arnd,

arnd@kernel.org wrote on Mon, 27 Sep 2021 16:10:37 +0200:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 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

> ---
>  drivers/mtd/chips/Kconfig | 2 ++
>  drivers/mtd/maps/Kconfig  | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
> index aef14990e5f7..19726ebd973d 100644
> --- a/drivers/mtd/chips/Kconfig
> +++ b/drivers/mtd/chips/Kconfig
> @@ -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
> diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
> index aaa164b977fe..4945caa88345 100644
> --- a/drivers/mtd/maps/Kconfig
> +++ b/drivers/mtd/maps/Kconfig
> @@ -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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] mtd: fixup CFI on ixp4xx
  2021-09-27 16:33 ` Miquel Raynal
@ 2021-09-27 20:30   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2021-09-27 20:30 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, Linus Walleij,
	Imre Kaloz, Krzysztof Halasa, Arnd Bergmann, Lukas Bulwahn,
	Serge Semin, linux-mtd, Linux Kernel Mailing List

On Mon, Sep 27, 2021 at 6:33 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Arnd,
>
> arnd@kernel.org wrote on Mon, 27 Sep 2021 16:10:37 +0200:
>
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > 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.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] mtd: fixup CFI on ixp4xx
  2021-09-27 14:10 [PATCH] [RFC] mtd: fixup CFI on ixp4xx Arnd Bergmann
  2021-09-27 16:33 ` Miquel Raynal
@ 2021-09-27 23:27 ` Linus Walleij
  2021-09-28  7:21   ` Arnd Bergmann
  2021-10-15 10:31 ` Miquel Raynal
  2 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2021-09-27 23:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Linus Walleij, Imre Kaloz, Krzysztof Halasa, Arnd Bergmann,
	Lukas Bulwahn, Serge Semin, linux-mtd, linux-kernel

On Mon, Sep 27, 2021 at 4:10 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> 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.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] mtd: fixup CFI on ixp4xx
  2021-09-27 23:27 ` Linus Walleij
@ 2021-09-28  7:21   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2021-09-28  7:21 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Linus Walleij, Imre Kaloz, Krzysztof Halasa, Arnd Bergmann,
	Lukas Bulwahn, Serge Semin, linux-mtd, linux-kernel

On Tue, Sep 28, 2021 at 1:28 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Sep 27, 2021 at 4:10 PM Arnd Bergmann <arnd@kernel.org> wrote:

> > 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] [RFC] mtd: fixup CFI on ixp4xx
  2021-09-27 14:10 [PATCH] [RFC] mtd: fixup CFI on ixp4xx Arnd Bergmann
  2021-09-27 16:33 ` Miquel Raynal
  2021-09-27 23:27 ` Linus Walleij
@ 2021-10-15 10:31 ` Miquel Raynal
  2 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2021-10-15 10:31 UTC (permalink / raw)
  To: Arnd Bergmann, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: Linus Walleij, Imre Kaloz, Krzysztof Halasa, Arnd Bergmann,
	Lukas Bulwahn, Serge Semin, linux-mtd, linux-kernel

On Mon, 2021-09-27 at 14:10:37 UTC, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

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

Miquel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-15 10:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 14:10 [PATCH] [RFC] mtd: fixup CFI on ixp4xx Arnd Bergmann
2021-09-27 16:33 ` Miquel Raynal
2021-09-27 20:30   ` Arnd Bergmann
2021-09-27 23:27 ` Linus Walleij
2021-09-28  7:21   ` Arnd Bergmann
2021-10-15 10:31 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).