linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency
@ 2019-06-29  1:22 Paul Cercueil
  2019-07-01 12:28 ` Miquel Raynal
  2019-07-05 21:00 ` Miquel Raynal
  0 siblings, 2 replies; 11+ messages in thread
From: Paul Cercueil @ 2019-06-29  1:22 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, od, linux-mtd, linux-kernel, Paul Cercueil,
	Arnd Bergmann, Hulk Robot, YueHaibing, stable

If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:

drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_remove':
ingenic_nand.c:(.text+0x177): undefined reference to `ingenic_ecc_release'
drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_ecc_correct':
ingenic_nand.c:(.text+0x2ee): undefined reference to `ingenic_ecc_correct'

To fix that, the ingenic_nand and ingenic_ecc modules have been fused
into one single module.
- The ingenic_ecc.c code is now compiled in only if
  $(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean instead
  of tristate.
- To avoid changing the module name, the ingenic_nand.c file is moved to
  ingenic_nand_drv.c. Then the module name is still ingenic_nand.
- Since ingenic_ecc.c is no more a module, the module-specific macros
  have been dropped, and the functions are no more exported for use by
  the ingenic_nand driver.

Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Hulk Robot <hulkci@huawei.com>
Cc: YueHaibing <yuehaibing@huawei.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/ingenic/Kconfig                     | 2 +-
 drivers/mtd/nand/raw/ingenic/Makefile                    | 4 +++-
 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c               | 9 ---------
 .../raw/ingenic/{ingenic_nand.c => ingenic_nand_drv.c}   | 0
 4 files changed, 4 insertions(+), 11 deletions(-)
 rename drivers/mtd/nand/raw/ingenic/{ingenic_nand.c => ingenic_nand_drv.c} (100%)

diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig b/drivers/mtd/nand/raw/ingenic/Kconfig
index 19a96ce515c1..66b7cffdb0c2 100644
--- a/drivers/mtd/nand/raw/ingenic/Kconfig
+++ b/drivers/mtd/nand/raw/ingenic/Kconfig
@@ -16,7 +16,7 @@ config MTD_NAND_JZ4780
 if MTD_NAND_JZ4780
 
 config MTD_NAND_INGENIC_ECC
-	tristate
+	bool
 
 config MTD_NAND_JZ4740_ECC
 	tristate "Hardware BCH support for JZ4740 SoC"
diff --git a/drivers/mtd/nand/raw/ingenic/Makefile b/drivers/mtd/nand/raw/ingenic/Makefile
index 1ac4f455baea..b63d36889263 100644
--- a/drivers/mtd/nand/raw/ingenic/Makefile
+++ b/drivers/mtd/nand/raw/ingenic/Makefile
@@ -2,7 +2,9 @@
 obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
 obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o
 
-obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
+ingenic_nand-y += ingenic_nand_drv.o
+ingenic_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
+
 obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o
 obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o
 obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
index d3e085c5685a..c954189606f6 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
@@ -30,7 +30,6 @@ int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
 {
 	return ecc->ops->calculate(ecc, params, buf, ecc_code);
 }
-EXPORT_SYMBOL(ingenic_ecc_calculate);
 
 /**
  * ingenic_ecc_correct() - detect and correct bit errors
@@ -51,7 +50,6 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
 {
 	return ecc->ops->correct(ecc, params, buf, ecc_code);
 }
-EXPORT_SYMBOL(ingenic_ecc_correct);
 
 /**
  * ingenic_ecc_get() - get the ECC controller device
@@ -111,7 +109,6 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *of_node)
 	}
 	return ecc;
 }
-EXPORT_SYMBOL(of_ingenic_ecc_get);
 
 /**
  * ingenic_ecc_release() - release the ECC controller device
@@ -122,7 +119,6 @@ void ingenic_ecc_release(struct ingenic_ecc *ecc)
 	clk_disable_unprepare(ecc->clk);
 	put_device(ecc->dev);
 }
-EXPORT_SYMBOL(ingenic_ecc_release);
 
 int ingenic_ecc_probe(struct platform_device *pdev)
 {
@@ -159,8 +155,3 @@ int ingenic_ecc_probe(struct platform_device *pdev)
 	return 0;
 }
 EXPORT_SYMBOL(ingenic_ecc_probe);
-
-MODULE_AUTHOR("Alex Smith <alex@alex-smith.me.uk>");
-MODULE_AUTHOR("Harvey Hunt <harveyhuntnexus@gmail.com>");
-MODULE_DESCRIPTION("Ingenic ECC common driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
similarity index 100%
rename from drivers/mtd/nand/raw/ingenic/ingenic_nand.c
rename to drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
-- 
2.21.0.593.g511ec345e18


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

* Re: [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency
  2019-06-29  1:22 [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency Paul Cercueil
@ 2019-07-01 12:28 ` Miquel Raynal
  2019-07-01 12:34   ` Paul Cercueil
  2019-07-05 21:00 ` Miquel Raynal
  1 sibling, 1 reply; 11+ messages in thread
From: Miquel Raynal @ 2019-07-01 12:28 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Richard Weinberger, od, linux-mtd, linux-kernel, Arnd Bergmann,
	Hulk Robot, YueHaibing, stable

Hi Paul,

One question below.

Paul Cercueil <paul@crapouillou.net> wrote on Sat, 29 Jun 2019 03:22:48
+0200:

> If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
> which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:
> 
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_remove':
> ingenic_nand.c:(.text+0x177): undefined reference to `ingenic_ecc_release'
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_ecc_correct':
> ingenic_nand.c:(.text+0x2ee): undefined reference to `ingenic_ecc_correct'
> 
> To fix that, the ingenic_nand and ingenic_ecc modules have been fused
> into one single module.
> - The ingenic_ecc.c code is now compiled in only if
>   $(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean instead
>   of tristate.
> - To avoid changing the module name, the ingenic_nand.c file is moved to
>   ingenic_nand_drv.c. Then the module name is still ingenic_nand.
> - Since ingenic_ecc.c is no more a module, the module-specific macros
>   have been dropped, and the functions are no more exported for use by
>   the ingenic_nand driver.

I am fine with this approach.

> 
> Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Cc: YueHaibing <yuehaibing@huawei.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/mtd/nand/raw/ingenic/Kconfig                     | 2 +-
>  drivers/mtd/nand/raw/ingenic/Makefile                    | 4 +++-
>  drivers/mtd/nand/raw/ingenic/ingenic_ecc.c               | 9 ---------
>  .../raw/ingenic/{ingenic_nand.c => ingenic_nand_drv.c}   | 0
>  4 files changed, 4 insertions(+), 11 deletions(-)
>  rename drivers/mtd/nand/raw/ingenic/{ingenic_nand.c => ingenic_nand_drv.c} (100%)
> 
> diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig b/drivers/mtd/nand/raw/ingenic/Kconfig
> index 19a96ce515c1..66b7cffdb0c2 100644
> --- a/drivers/mtd/nand/raw/ingenic/Kconfig
> +++ b/drivers/mtd/nand/raw/ingenic/Kconfig
> @@ -16,7 +16,7 @@ config MTD_NAND_JZ4780
>  if MTD_NAND_JZ4780
>  
>  config MTD_NAND_INGENIC_ECC
> -	tristate
> +	bool
>  
>  config MTD_NAND_JZ4740_ECC
>  	tristate "Hardware BCH support for JZ4740 SoC"
> diff --git a/drivers/mtd/nand/raw/ingenic/Makefile b/drivers/mtd/nand/raw/ingenic/Makefile
> index 1ac4f455baea..b63d36889263 100644
> --- a/drivers/mtd/nand/raw/ingenic/Makefile
> +++ b/drivers/mtd/nand/raw/ingenic/Makefile
> @@ -2,7 +2,9 @@
>  obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
>  obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o
>  
> -obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
> +ingenic_nand-y += ingenic_nand_drv.o
> +ingenic_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
> +
>  obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o
>  obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o
>  obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o
> diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> index d3e085c5685a..c954189606f6 100644
> --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
> @@ -30,7 +30,6 @@ int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
>  {
>  	return ecc->ops->calculate(ecc, params, buf, ecc_code);
>  }
> -EXPORT_SYMBOL(ingenic_ecc_calculate);
>  
>  /**
>   * ingenic_ecc_correct() - detect and correct bit errors
> @@ -51,7 +50,6 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
>  {
>  	return ecc->ops->correct(ecc, params, buf, ecc_code);
>  }
> -EXPORT_SYMBOL(ingenic_ecc_correct);
>  
>  /**
>   * ingenic_ecc_get() - get the ECC controller device
> @@ -111,7 +109,6 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *of_node)
>  	}
>  	return ecc;
>  }
> -EXPORT_SYMBOL(of_ingenic_ecc_get);
>  
>  /**
>   * ingenic_ecc_release() - release the ECC controller device
> @@ -122,7 +119,6 @@ void ingenic_ecc_release(struct ingenic_ecc *ecc)
>  	clk_disable_unprepare(ecc->clk);
>  	put_device(ecc->dev);
>  }
> -EXPORT_SYMBOL(ingenic_ecc_release);
>  
>  int ingenic_ecc_probe(struct platform_device *pdev)
>  {
> @@ -159,8 +155,3 @@ int ingenic_ecc_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  EXPORT_SYMBOL(ingenic_ecc_probe);

Any reason to keep this one?

Thanks,
Miquèl

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

* Re: [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency
  2019-07-01 12:28 ` Miquel Raynal
@ 2019-07-01 12:34   ` Paul Cercueil
  0 siblings, 0 replies; 11+ messages in thread
From: Paul Cercueil @ 2019-07-01 12:34 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, od, linux-mtd, linux-kernel, Arnd Bergmann,
	Hulk Robot, YueHaibing, stable



Le lun. 1 juil. 2019 à 14:28, Miquel Raynal 
<miquel.raynal@bootlin.com> a écrit :
> Hi Paul,
> 
> One question below.
> 
> Paul Cercueil <paul@crapouillou.net> wrote on Sat, 29 Jun 2019 
> 03:22:48
> +0200:
> 
>>  If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
>>  which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:
>> 
>>  drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
>> `ingenic_nand_remove':
>>  ingenic_nand.c:(.text+0x177): undefined reference to 
>> `ingenic_ecc_release'
>>  drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
>> `ingenic_nand_ecc_correct':
>>  ingenic_nand.c:(.text+0x2ee): undefined reference to 
>> `ingenic_ecc_correct'
>> 
>>  To fix that, the ingenic_nand and ingenic_ecc modules have been 
>> fused
>>  into one single module.
>>  - The ingenic_ecc.c code is now compiled in only if
>>    $(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean 
>> instead
>>    of tristate.
>>  - To avoid changing the module name, the ingenic_nand.c file is 
>> moved to
>>    ingenic_nand_drv.c. Then the module name is still ingenic_nand.
>>  - Since ingenic_ecc.c is no more a module, the module-specific 
>> macros
>>    have been dropped, and the functions are no more exported for use 
>> by
>>    the ingenic_nand driver.
> 
> I am fine with this approach.
> 
>> 
>>  Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and 
>> SoC specific code")
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  Reported-by: Arnd Bergmann <arnd@arndb.de>
>>  Reported-by: Hulk Robot <hulkci@huawei.com>
>>  Cc: YueHaibing <yuehaibing@huawei.com>
>>  Cc: stable@vger.kernel.org
>>  ---
>>   drivers/mtd/nand/raw/ingenic/Kconfig                     | 2 +-
>>   drivers/mtd/nand/raw/ingenic/Makefile                    | 4 +++-
>>   drivers/mtd/nand/raw/ingenic/ingenic_ecc.c               | 9 
>> ---------
>>   .../raw/ingenic/{ingenic_nand.c => ingenic_nand_drv.c}   | 0
>>   4 files changed, 4 insertions(+), 11 deletions(-)
>>   rename drivers/mtd/nand/raw/ingenic/{ingenic_nand.c => 
>> ingenic_nand_drv.c} (100%)
>> 
>>  diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig 
>> b/drivers/mtd/nand/raw/ingenic/Kconfig
>>  index 19a96ce515c1..66b7cffdb0c2 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/Kconfig
>>  +++ b/drivers/mtd/nand/raw/ingenic/Kconfig
>>  @@ -16,7 +16,7 @@ config MTD_NAND_JZ4780
>>   if MTD_NAND_JZ4780
>> 
>>   config MTD_NAND_INGENIC_ECC
>>  -	tristate
>>  +	bool
>> 
>>   config MTD_NAND_JZ4740_ECC
>>   	tristate "Hardware BCH support for JZ4740 SoC"
>>  diff --git a/drivers/mtd/nand/raw/ingenic/Makefile 
>> b/drivers/mtd/nand/raw/ingenic/Makefile
>>  index 1ac4f455baea..b63d36889263 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/Makefile
>>  +++ b/drivers/mtd/nand/raw/ingenic/Makefile
>>  @@ -2,7 +2,9 @@
>>   obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
>>   obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o
>> 
>>  -obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
>>  +ingenic_nand-y += ingenic_nand_drv.o
>>  +ingenic_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
>>  +
>>   obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o
>>   obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o
>>   obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o
>>  diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c 
>> b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  index d3e085c5685a..c954189606f6 100644
>>  --- a/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  +++ b/drivers/mtd/nand/raw/ingenic/ingenic_ecc.c
>>  @@ -30,7 +30,6 @@ int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
>>   {
>>   	return ecc->ops->calculate(ecc, params, buf, ecc_code);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_calculate);
>> 
>>   /**
>>    * ingenic_ecc_correct() - detect and correct bit errors
>>  @@ -51,7 +50,6 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
>>   {
>>   	return ecc->ops->correct(ecc, params, buf, ecc_code);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_correct);
>> 
>>   /**
>>    * ingenic_ecc_get() - get the ECC controller device
>>  @@ -111,7 +109,6 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct 
>> device_node *of_node)
>>   	}
>>   	return ecc;
>>   }
>>  -EXPORT_SYMBOL(of_ingenic_ecc_get);
>> 
>>   /**
>>    * ingenic_ecc_release() - release the ECC controller device
>>  @@ -122,7 +119,6 @@ void ingenic_ecc_release(struct ingenic_ecc 
>> *ecc)
>>   	clk_disable_unprepare(ecc->clk);
>>   	put_device(ecc->dev);
>>   }
>>  -EXPORT_SYMBOL(ingenic_ecc_release);
>> 
>>   int ingenic_ecc_probe(struct platform_device *pdev)
>>   {
>>  @@ -159,8 +155,3 @@ int ingenic_ecc_probe(struct platform_device 
>> *pdev)
>>   	return 0;
>>   }
>>   EXPORT_SYMBOL(ingenic_ecc_probe);
> 
> Any reason to keep this one?

This one is called from the three ECC drivers, which can be modules,
so it still needs to be exported.

-Paul



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

* Re: [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency
  2019-06-29  1:22 [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency Paul Cercueil
  2019-07-01 12:28 ` Miquel Raynal
@ 2019-07-05 21:00 ` Miquel Raynal
  1 sibling, 0 replies; 11+ messages in thread
From: Miquel Raynal @ 2019-07-05 21:00 UTC (permalink / raw)
  To: Paul Cercueil, Miquel Raynal
  Cc: Arnd Bergmann, Richard Weinberger, YueHaibing, linux-kernel,
	stable, Hulk Robot, od, linux-mtd

On Sat, 2019-06-29 at 01:22:48 UTC, Paul Cercueil wrote:
> If MTD_NAND_JZ4780 is y and MTD_NAND_JZ4780_BCH is m,
> which select CONFIG_MTD_NAND_INGENIC_ECC to m, building fails:
> 
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_remove':
> ingenic_nand.c:(.text+0x177): undefined reference to `ingenic_ecc_release'
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_ecc_correct':
> ingenic_nand.c:(.text+0x2ee): undefined reference to `ingenic_ecc_correct'
> 
> To fix that, the ingenic_nand and ingenic_ecc modules have been fused
> into one single module.
> - The ingenic_ecc.c code is now compiled in only if
>   $(CONFIG_MTD_NAND_INGENIC_ECC) is set. This is now a boolean instead
>   of tristate.
> - To avoid changing the module name, the ingenic_nand.c file is moved to
>   ingenic_nand_drv.c. Then the module name is still ingenic_nand.
> - Since ingenic_ecc.c is no more a module, the module-specific macros
>   have been dropped, and the functions are no more exported for use by
>   the ingenic_nand driver.
> 
> Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Cc: YueHaibing <yuehaibing@huawei.com>
> Cc: stable@vger.kernel.org

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

Miquel

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

* Re: [PATCH] mtd: rawnand: ingenic: fix ingenic_ecc dependency
  2019-06-28 19:53         ` Paul Cercueil
@ 2019-07-01 15:01           ` Arnd Bergmann
  0 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2019-07-01 15:01 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Miquel Raynal, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	Linux Kernel Mailing List

On Fri, Jun 28, 2019 at 9:53 PM Paul Cercueil <paul@crapouillou.net> wrote:
> Le jeu. 27 juin 2019 à 18:40, Miquel Raynal
> <miquel.raynal@bootlin.com> a écrit :

> > Miquel Raynal <miquel.raynal@bootlin.com> wrote on Mon, 17 Jun 2019
> > 14:16:59 +0200:
> >>  I personally have a preference for this one.
> >
> > Would you mind sending the above change? I forgot about it but I would
> > like to queue it for the next release. Preferably the last version
> > Arnd
> > proposed.
>
> It does change the module name from 'ingenic_nand' to 'jz4780_nand',
> though.
> That's not really ideal...

Any other suggestion for the name? If the module keeps getting called
ingeneric_nand.ko, then the source file has to get renamed to something
else instead.

      Arnd

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

* Re: [PATCH] mtd: rawnand: ingenic: fix ingenic_ecc dependency
  2019-06-27 16:40       ` Miquel Raynal
@ 2019-06-28 19:53         ` Paul Cercueil
  2019-07-01 15:01           ` Arnd Bergmann
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Cercueil @ 2019-06-28 19:53 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Arnd Bergmann, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	Linux Kernel Mailing List



Le jeu. 27 juin 2019 à 18:40, Miquel Raynal 
<miquel.raynal@bootlin.com> a écrit :
> Hi Paul,
> 
> Miquel Raynal <miquel.raynal@bootlin.com> wrote on Mon, 17 Jun 2019
> 14:16:59 +0200:
> 
>>  Hello,
>> 
>>  Arnd Bergmann <arnd@arndb.de> wrote on Mon, 17 Jun 2019 14:12:48 
>> +0200:
>> 
>>  > On Mon, Jun 17, 2019 at 1:24 PM Paul Cercueil 
>> <paul@crapouillou.net> wrote:
>>  >
>>  > > I think there's a better way to fix it, only in Kconfig.
>>  > >
>>  > > * Add a bool symbol MTD_NAND_INGENIC_USE_HW_ECC
>>  > > * Have the three ECC/BCH drivers select this symbol instead of
>>  > >   MTD_NAND_INGENIC_ECC
>>  > > * Add the following to the MTD_NAND_JZ4780 config option:
>>  > >   "select MTD_NAND_INGENIC_ECC if MTD_NAND_INGENIC_USE_HW_ECC"
>>  >
>>  > I don't see much difference to my approach here, but if you want
>>  > to submit that version with 'Reported-by: Arnd Bergmann 
>> <arnd@arndb.de>',
>>  > please do so.
>>  >
>>  > Yet another option would be to use Makefile code to link both
>>  > files into one module, and remove the EXPORT_SYMBOL statements:
>>  >
>>  > obj-$(CONFIG_MTD_NAND_JZ4780) += jz4780_nand.o
>>  > jz4780_nand-y += ingenic_nand.o
>>  > jz4780_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
>>  >
>> 
>>  I personally have a preference for this one.
> 
> Would you mind sending the above change? I forgot about it but I would
> like to queue it for the next release. Preferably the last version 
> Arnd
> proposed.

It does change the module name from 'ingenic_nand' to 'jz4780_nand', 
though.
That's not really ideal...

> 
> Thanks,
> Miquèl



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

* Re: [PATCH] mtd: rawnand: ingenic: fix ingenic_ecc dependency
  2019-06-17 12:16     ` Miquel Raynal
@ 2019-06-27 16:40       ` Miquel Raynal
  2019-06-28 19:53         ` Paul Cercueil
  0 siblings, 1 reply; 11+ messages in thread
From: Miquel Raynal @ 2019-06-27 16:40 UTC (permalink / raw)
  To: Arnd Bergmann, Paul Cercueil
  Cc: David Woodhouse, Brian Norris, Marek Vasut, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, Linux Kernel Mailing List

Hi Paul,

Miquel Raynal <miquel.raynal@bootlin.com> wrote on Mon, 17 Jun 2019
14:16:59 +0200:

> Hello,
> 
> Arnd Bergmann <arnd@arndb.de> wrote on Mon, 17 Jun 2019 14:12:48 +0200:
> 
> > On Mon, Jun 17, 2019 at 1:24 PM Paul Cercueil <paul@crapouillou.net> wrote:
> >   
> > > I think there's a better way to fix it, only in Kconfig.
> > >
> > > * Add a bool symbol MTD_NAND_INGENIC_USE_HW_ECC
> > > * Have the three ECC/BCH drivers select this symbol instead of
> > >   MTD_NAND_INGENIC_ECC
> > > * Add the following to the MTD_NAND_JZ4780 config option:
> > >   "select MTD_NAND_INGENIC_ECC if MTD_NAND_INGENIC_USE_HW_ECC"    
> > 
> > I don't see much difference to my approach here, but if you want
> > to submit that version with 'Reported-by: Arnd Bergmann <arnd@arndb.de>',
> > please do so.
> > 
> > Yet another option would be to use Makefile code to link both
> > files into one module, and remove the EXPORT_SYMBOL statements:
> > 
> > obj-$(CONFIG_MTD_NAND_JZ4780) += jz4780_nand.o
> > jz4780_nand-y += ingenic_nand.o
> > jz4780_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
> >   
> 
> I personally have a preference for this one.

Would you mind sending the above change? I forgot about it but I would
like to queue it for the next release. Preferably the last version Arnd
proposed.


Thanks,
Miquèl

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

* Re: [PATCH] mtd: rawnand: ingenic: fix ingenic_ecc dependency
  2019-06-17 12:12   ` Arnd Bergmann
@ 2019-06-17 12:16     ` Miquel Raynal
  2019-06-27 16:40       ` Miquel Raynal
  0 siblings, 1 reply; 11+ messages in thread
From: Miquel Raynal @ 2019-06-17 12:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Paul Cercueil, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	Linux Kernel Mailing List

Hello,

Arnd Bergmann <arnd@arndb.de> wrote on Mon, 17 Jun 2019 14:12:48 +0200:

> On Mon, Jun 17, 2019 at 1:24 PM Paul Cercueil <paul@crapouillou.net> wrote:
> 
> > I think there's a better way to fix it, only in Kconfig.
> >
> > * Add a bool symbol MTD_NAND_INGENIC_USE_HW_ECC
> > * Have the three ECC/BCH drivers select this symbol instead of
> >   MTD_NAND_INGENIC_ECC
> > * Add the following to the MTD_NAND_JZ4780 config option:
> >   "select MTD_NAND_INGENIC_ECC if MTD_NAND_INGENIC_USE_HW_ECC"  
> 
> I don't see much difference to my approach here, but if you want
> to submit that version with 'Reported-by: Arnd Bergmann <arnd@arndb.de>',
> please do so.
> 
> Yet another option would be to use Makefile code to link both
> files into one module, and remove the EXPORT_SYMBOL statements:
> 
> obj-$(CONFIG_MTD_NAND_JZ4780) += jz4780_nand.o
> jz4780_nand-y += ingenic_nand.o
> jz4780_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
> 

I personally have a preference for this one.

Thanks,
Miquèl

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

* Re: [PATCH] mtd: rawnand: ingenic: fix ingenic_ecc dependency
  2019-06-17 11:24 ` Paul Cercueil
@ 2019-06-17 12:12   ` Arnd Bergmann
  2019-06-17 12:16     ` Miquel Raynal
  0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2019-06-17 12:12 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Miquel Raynal, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	Linux Kernel Mailing List

On Mon, Jun 17, 2019 at 1:24 PM Paul Cercueil <paul@crapouillou.net> wrote:

> I think there's a better way to fix it, only in Kconfig.
>
> * Add a bool symbol MTD_NAND_INGENIC_USE_HW_ECC
> * Have the three ECC/BCH drivers select this symbol instead of
>   MTD_NAND_INGENIC_ECC
> * Add the following to the MTD_NAND_JZ4780 config option:
>   "select MTD_NAND_INGENIC_ECC if MTD_NAND_INGENIC_USE_HW_ECC"

I don't see much difference to my approach here, but if you want
to submit that version with 'Reported-by: Arnd Bergmann <arnd@arndb.de>',
please do so.

Yet another option would be to use Makefile code to link both
files into one module, and remove the EXPORT_SYMBOL statements:

obj-$(CONFIG_MTD_NAND_JZ4780) += jz4780_nand.o
jz4780_nand-y += ingenic_nand.o
jz4780_nand-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o

        Arnd

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

* Re: [PATCH] mtd: rawnand: ingenic: fix ingenic_ecc dependency
  2019-06-17 11:10 [PATCH] mtd: rawnand: ingenic: fix " Arnd Bergmann
@ 2019-06-17 11:24 ` Paul Cercueil
  2019-06-17 12:12   ` Arnd Bergmann
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Cercueil @ 2019-06-17 11:24 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Miquel Raynal, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel

Hi Arnd,


Le lun. 17 juin 2019 à 13:10, Arnd Bergmann <arnd@arndb.de> a écrit :
> The ecc code is called from the main ingenic_nand module, but the
> Kconfig symbol gets selected by the dependent ones.
> 
> If the child drivers are loadable modules, this leads to a link
> error:
> 
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
> `ingenic_nand_remove':
> ingenic_nand.c:(.text+0x1a1): undefined reference to 
> `ingenic_ecc_release'
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
> `ingenic_nand_ecc_correct':
> ingenic_nand.c:(.text+0x1fa): undefined reference to 
> `ingenic_ecc_correct'
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
> `ingenic_nand_ecc_calculate':
> ingenic_nand.c:(.text+0x255): undefined reference to 
> `ingenic_ecc_calculate'
> drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function 
> `ingenic_nand_probe':
> ingenic_nand.c:(.text+0x3ca): undefined reference to 
> `of_ingenic_ecc_get'
> ingenic_nand.c:(.text+0x685): undefined reference to 
> `ingenic_ecc_release'
> 
> Rearrange this to have the ecc code linked the same way as the main
> driver.

I think there's a better way to fix it, only in Kconfig.

* Add a bool symbol MTD_NAND_INGENIC_USE_HW_ECC
* Have the three ECC/BCH drivers select this symbol instead of
  MTD_NAND_INGENIC_ECC
* Add the following to the MTD_NAND_JZ4780 config option:
  "select MTD_NAND_INGENIC_ECC if MTD_NAND_INGENIC_USE_HW_ECC"


> Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and 
> SoC specific code")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/mtd/nand/raw/ingenic/Kconfig  | 2 +-
>  drivers/mtd/nand/raw/ingenic/Makefile | 5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig 
> b/drivers/mtd/nand/raw/ingenic/Kconfig
> index 19a96ce515c1..66b7cffdb0c2 100644
> --- a/drivers/mtd/nand/raw/ingenic/Kconfig
> +++ b/drivers/mtd/nand/raw/ingenic/Kconfig
> @@ -16,7 +16,7 @@ config MTD_NAND_JZ4780
>  if MTD_NAND_JZ4780
> 
>  config MTD_NAND_INGENIC_ECC
> -	tristate
> +	bool
> 
>  config MTD_NAND_JZ4740_ECC
>  	tristate "Hardware BCH support for JZ4740 SoC"
> diff --git a/drivers/mtd/nand/raw/ingenic/Makefile 
> b/drivers/mtd/nand/raw/ingenic/Makefile
> index 1ac4f455baea..5a55efc5d9bb 100644
> --- a/drivers/mtd/nand/raw/ingenic/Makefile
> +++ b/drivers/mtd/nand/raw/ingenic/Makefile
> @@ -2,7 +2,10 @@
>  obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
>  obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o
> 
> -obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
> +ifdef CONFIG_MTD_NAND_INGENIC_ECC
> +obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_ecc.o
> +endif
> +
>  obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o
>  obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o
>  obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o
> --
> 2.20.0
> 



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

* [PATCH] mtd: rawnand: ingenic: fix ingenic_ecc dependency
@ 2019-06-17 11:10 Arnd Bergmann
  2019-06-17 11:24 ` Paul Cercueil
  0 siblings, 1 reply; 11+ messages in thread
From: Arnd Bergmann @ 2019-06-17 11:10 UTC (permalink / raw)
  To: Miquel Raynal, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Arnd Bergmann, Paul Cercueil, linux-mtd, linux-kernel

The ecc code is called from the main ingenic_nand module, but the
Kconfig symbol gets selected by the dependent ones.

If the child drivers are loadable modules, this leads to a link
error:

drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_remove':
ingenic_nand.c:(.text+0x1a1): undefined reference to `ingenic_ecc_release'
drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_ecc_correct':
ingenic_nand.c:(.text+0x1fa): undefined reference to `ingenic_ecc_correct'
drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_ecc_calculate':
ingenic_nand.c:(.text+0x255): undefined reference to `ingenic_ecc_calculate'
drivers/mtd/nand/raw/ingenic/ingenic_nand.o: In function `ingenic_nand_probe':
ingenic_nand.c:(.text+0x3ca): undefined reference to `of_ingenic_ecc_get'
ingenic_nand.c:(.text+0x685): undefined reference to `ingenic_ecc_release'

Rearrange this to have the ecc code linked the same way as the main
driver.

Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mtd/nand/raw/ingenic/Kconfig  | 2 +-
 drivers/mtd/nand/raw/ingenic/Makefile | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/ingenic/Kconfig b/drivers/mtd/nand/raw/ingenic/Kconfig
index 19a96ce515c1..66b7cffdb0c2 100644
--- a/drivers/mtd/nand/raw/ingenic/Kconfig
+++ b/drivers/mtd/nand/raw/ingenic/Kconfig
@@ -16,7 +16,7 @@ config MTD_NAND_JZ4780
 if MTD_NAND_JZ4780
 
 config MTD_NAND_INGENIC_ECC
-	tristate
+	bool
 
 config MTD_NAND_JZ4740_ECC
 	tristate "Hardware BCH support for JZ4740 SoC"
diff --git a/drivers/mtd/nand/raw/ingenic/Makefile b/drivers/mtd/nand/raw/ingenic/Makefile
index 1ac4f455baea..5a55efc5d9bb 100644
--- a/drivers/mtd/nand/raw/ingenic/Makefile
+++ b/drivers/mtd/nand/raw/ingenic/Makefile
@@ -2,7 +2,10 @@
 obj-$(CONFIG_MTD_NAND_JZ4740) += jz4740_nand.o
 obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_nand.o
 
-obj-$(CONFIG_MTD_NAND_INGENIC_ECC) += ingenic_ecc.o
+ifdef CONFIG_MTD_NAND_INGENIC_ECC
+obj-$(CONFIG_MTD_NAND_JZ4780) += ingenic_ecc.o
+endif
+
 obj-$(CONFIG_MTD_NAND_JZ4740_ECC) += jz4740_ecc.o
 obj-$(CONFIG_MTD_NAND_JZ4725B_BCH) += jz4725b_bch.o
 obj-$(CONFIG_MTD_NAND_JZ4780_BCH) += jz4780_bch.o
-- 
2.20.0


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

end of thread, other threads:[~2019-07-05 21:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-29  1:22 [PATCH] mtd: rawnand: ingenic: Fix ingenic_ecc dependency Paul Cercueil
2019-07-01 12:28 ` Miquel Raynal
2019-07-01 12:34   ` Paul Cercueil
2019-07-05 21:00 ` Miquel Raynal
  -- strict thread matches above, loose matches on Subject: below --
2019-06-17 11:10 [PATCH] mtd: rawnand: ingenic: fix " Arnd Bergmann
2019-06-17 11:24 ` Paul Cercueil
2019-06-17 12:12   ` Arnd Bergmann
2019-06-17 12:16     ` Miquel Raynal
2019-06-27 16:40       ` Miquel Raynal
2019-06-28 19:53         ` Paul Cercueil
2019-07-01 15:01           ` Arnd Bergmann

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