All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: Fix mtd not registered due to nvmem name collision
@ 2020-04-30 13:17 ` Ricardo Ribalda Delgado
  0 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda Delgado @ 2020-04-30 13:17 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd, linux-kernel, Boris Brezillon, Alban Bedel
  Cc: Ricardo Ribalda Delgado

From: Ricardo Ribalda Delgado <ribalda@kernel.org>

When the nvmem framework is enabled, a nvmem device is created per mtd
device/partition.

It is not uncommon that a device can have multiple mtd devices with
partitions that have the same name. Eg, when there DT overlay is allowed
and the same device with mtd is attached twice.

Under that circumstances, the mtd fails to register due to a name
duplication on the nvmem framework.

With this patch we use the mtdX name instead of the partition name,
which is unique.

[    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
[    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
[    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
[    8.948994] Call Trace:
[    8.948996]  dump_stack+0x50/0x70
[    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
[    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
[    8.949002]  bus_add_device+0x74/0x140
[    8.949004]  device_add+0x34b/0x850
[    8.949006]  nvmem_register.part.0+0x1bf/0x640
...
[    8.948926] mtd mtd8: Failed to register NVMEM device

Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
---
 drivers/mtd/mtdcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 2916674208b3..29d41003d6e0 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
 
 	config.id = -1;
 	config.dev = &mtd->dev;
-	config.name = mtd->name;
+	config.name = dev_name(&mtd->dev);
 	config.owner = THIS_MODULE;
 	config.reg_read = mtd_nvmem_reg_read;
 	config.size = mtd->size;
-- 
2.26.2


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

* [PATCH] mtd: Fix mtd not registered due to nvmem name collision
@ 2020-04-30 13:17 ` Ricardo Ribalda Delgado
  0 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda Delgado @ 2020-04-30 13:17 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd, linux-kernel, Boris Brezillon, Alban Bedel
  Cc: Ricardo Ribalda Delgado

From: Ricardo Ribalda Delgado <ribalda@kernel.org>

When the nvmem framework is enabled, a nvmem device is created per mtd
device/partition.

It is not uncommon that a device can have multiple mtd devices with
partitions that have the same name. Eg, when there DT overlay is allowed
and the same device with mtd is attached twice.

Under that circumstances, the mtd fails to register due to a name
duplication on the nvmem framework.

With this patch we use the mtdX name instead of the partition name,
which is unique.

[    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
[    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
[    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
[    8.948994] Call Trace:
[    8.948996]  dump_stack+0x50/0x70
[    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
[    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
[    8.949002]  bus_add_device+0x74/0x140
[    8.949004]  device_add+0x34b/0x850
[    8.949006]  nvmem_register.part.0+0x1bf/0x640
...
[    8.948926] mtd mtd8: Failed to register NVMEM device

Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
---
 drivers/mtd/mtdcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 2916674208b3..29d41003d6e0 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
 
 	config.id = -1;
 	config.dev = &mtd->dev;
-	config.name = mtd->name;
+	config.name = dev_name(&mtd->dev);
 	config.owner = THIS_MODULE;
 	config.reg_read = mtd_nvmem_reg_read;
 	config.size = mtd->size;
-- 
2.26.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
  2020-04-30 13:17 ` Ricardo Ribalda Delgado
@ 2020-05-04  8:43   ` Miquel Raynal
  -1 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2020-05-04  8:43 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel,
	Boris Brezillon, Alban Bedel, Ricardo Ribalda Delgado

Hi Richard,

Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Thu, 30 Apr 2020
15:17:21 +0200:

> From: Ricardo Ribalda Delgado <ribalda@kernel.org>
> 
> When the nvmem framework is enabled, a nvmem device is created per mtd
> device/partition.
> 
> It is not uncommon that a device can have multiple mtd devices with
> partitions that have the same name. Eg, when there DT overlay is allowed
> and the same device with mtd is attached twice.
> 
> Under that circumstances, the mtd fails to register due to a name
> duplication on the nvmem framework.
> 
> With this patch we use the mtdX name instead of the partition name,
> which is unique.
> 
> [    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
> [    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
> [    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
> [    8.948994] Call Trace:
> [    8.948996]  dump_stack+0x50/0x70
> [    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
> [    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
> [    8.949002]  bus_add_device+0x74/0x140
> [    8.949004]  device_add+0x34b/0x850
> [    8.949006]  nvmem_register.part.0+0x1bf/0x640
> ...
> [    8.948926] mtd mtd8: Failed to register NVMEM device
> 
> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
> ---
>  drivers/mtd/mtdcore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 2916674208b3..29d41003d6e0 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
>  
>  	config.id = -1;
>  	config.dev = &mtd->dev;
> -	config.name = mtd->name;
> +	config.name = dev_name(&mtd->dev);
>  	config.owner = THIS_MODULE;
>  	config.reg_read = mtd_nvmem_reg_read;
>  	config.size = mtd->size;

We hope this will definitely fix the NVMEM duplicate name issue. If it
does not reliably, we might want to revert this patch and create an MTD
unique ID field which, for each MTD device, concatenates the name of
its parent and its own mtd->name.

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
@ 2020-05-04  8:43   ` Miquel Raynal
  0 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2020-05-04  8:43 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado
  Cc: Ricardo Ribalda Delgado, Vignesh Raghavendra, Richard Weinberger,
	linux-kernel, Boris Brezillon, Alban Bedel, linux-mtd

Hi Richard,

Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Thu, 30 Apr 2020
15:17:21 +0200:

> From: Ricardo Ribalda Delgado <ribalda@kernel.org>
> 
> When the nvmem framework is enabled, a nvmem device is created per mtd
> device/partition.
> 
> It is not uncommon that a device can have multiple mtd devices with
> partitions that have the same name. Eg, when there DT overlay is allowed
> and the same device with mtd is attached twice.
> 
> Under that circumstances, the mtd fails to register due to a name
> duplication on the nvmem framework.
> 
> With this patch we use the mtdX name instead of the partition name,
> which is unique.
> 
> [    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
> [    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
> [    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
> [    8.948994] Call Trace:
> [    8.948996]  dump_stack+0x50/0x70
> [    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
> [    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
> [    8.949002]  bus_add_device+0x74/0x140
> [    8.949004]  device_add+0x34b/0x850
> [    8.949006]  nvmem_register.part.0+0x1bf/0x640
> ...
> [    8.948926] mtd mtd8: Failed to register NVMEM device
> 
> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
> ---
>  drivers/mtd/mtdcore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 2916674208b3..29d41003d6e0 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
>  
>  	config.id = -1;
>  	config.dev = &mtd->dev;
> -	config.name = mtd->name;
> +	config.name = dev_name(&mtd->dev);
>  	config.owner = THIS_MODULE;
>  	config.reg_read = mtd_nvmem_reg_read;
>  	config.size = mtd->size;

We hope this will definitely fix the NVMEM duplicate name issue. If it
does not reliably, we might want to revert this patch and create an MTD
unique ID field which, for each MTD device, concatenates the name of
its parent and its own mtd->name.

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
  2020-05-04  8:43   ` Miquel Raynal
@ 2020-05-18 14:01     ` Ricardo Ribalda Delgado
  -1 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda Delgado @ 2020-05-18 14:01 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, LKML,
	Boris Brezillon, Alban Bedel

Hi

This is just a friendly ping after two weeks ;)

On Mon, May 4, 2020 at 10:44 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Richard,
>
> Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Thu, 30 Apr 2020
> 15:17:21 +0200:
>
> > From: Ricardo Ribalda Delgado <ribalda@kernel.org>
> >
> > When the nvmem framework is enabled, a nvmem device is created per mtd
> > device/partition.
> >
> > It is not uncommon that a device can have multiple mtd devices with
> > partitions that have the same name. Eg, when there DT overlay is allowed
> > and the same device with mtd is attached twice.
> >
> > Under that circumstances, the mtd fails to register due to a name
> > duplication on the nvmem framework.
> >
> > With this patch we use the mtdX name instead of the partition name,
> > which is unique.
> >
> > [    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
> > [    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
> > [    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
> > [    8.948994] Call Trace:
> > [    8.948996]  dump_stack+0x50/0x70
> > [    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
> > [    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
> > [    8.949002]  bus_add_device+0x74/0x140
> > [    8.949004]  device_add+0x34b/0x850
> > [    8.949006]  nvmem_register.part.0+0x1bf/0x640
> > ...
> > [    8.948926] mtd mtd8: Failed to register NVMEM device
> >
> > Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> > Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
> > ---
> >  drivers/mtd/mtdcore.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> > index 2916674208b3..29d41003d6e0 100644
> > --- a/drivers/mtd/mtdcore.c
> > +++ b/drivers/mtd/mtdcore.c
> > @@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
> >
> >       config.id = -1;
> >       config.dev = &mtd->dev;
> > -     config.name = mtd->name;
> > +     config.name = dev_name(&mtd->dev);
> >       config.owner = THIS_MODULE;
> >       config.reg_read = mtd_nvmem_reg_read;
> >       config.size = mtd->size;
>
> We hope this will definitely fix the NVMEM duplicate name issue. If it
> does not reliably, we might want to revert this patch and create an MTD
> unique ID field which, for each MTD device, concatenates the name of
> its parent and its own mtd->name.
>
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
> Thanks,
> Miquèl



-- 
Ricardo Ribalda

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
@ 2020-05-18 14:01     ` Ricardo Ribalda Delgado
  0 siblings, 0 replies; 10+ messages in thread
From: Ricardo Ribalda Delgado @ 2020-05-18 14:01 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vignesh Raghavendra, Richard Weinberger, LKML, Boris Brezillon,
	Alban Bedel, linux-mtd

Hi

This is just a friendly ping after two weeks ;)

On Mon, May 4, 2020 at 10:44 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Richard,
>
> Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Thu, 30 Apr 2020
> 15:17:21 +0200:
>
> > From: Ricardo Ribalda Delgado <ribalda@kernel.org>
> >
> > When the nvmem framework is enabled, a nvmem device is created per mtd
> > device/partition.
> >
> > It is not uncommon that a device can have multiple mtd devices with
> > partitions that have the same name. Eg, when there DT overlay is allowed
> > and the same device with mtd is attached twice.
> >
> > Under that circumstances, the mtd fails to register due to a name
> > duplication on the nvmem framework.
> >
> > With this patch we use the mtdX name instead of the partition name,
> > which is unique.
> >
> > [    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
> > [    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
> > [    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
> > [    8.948994] Call Trace:
> > [    8.948996]  dump_stack+0x50/0x70
> > [    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
> > [    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
> > [    8.949002]  bus_add_device+0x74/0x140
> > [    8.949004]  device_add+0x34b/0x850
> > [    8.949006]  nvmem_register.part.0+0x1bf/0x640
> > ...
> > [    8.948926] mtd mtd8: Failed to register NVMEM device
> >
> > Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> > Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
> > ---
> >  drivers/mtd/mtdcore.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> > index 2916674208b3..29d41003d6e0 100644
> > --- a/drivers/mtd/mtdcore.c
> > +++ b/drivers/mtd/mtdcore.c
> > @@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
> >
> >       config.id = -1;
> >       config.dev = &mtd->dev;
> > -     config.name = mtd->name;
> > +     config.name = dev_name(&mtd->dev);
> >       config.owner = THIS_MODULE;
> >       config.reg_read = mtd_nvmem_reg_read;
> >       config.size = mtd->size;
>
> We hope this will definitely fix the NVMEM duplicate name issue. If it
> does not reliably, we might want to revert this patch and create an MTD
> unique ID field which, for each MTD device, concatenates the name of
> its parent and its own mtd->name.
>
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
> Thanks,
> Miquèl



-- 
Ricardo Ribalda

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
  2020-05-18 14:01     ` Ricardo Ribalda Delgado
@ 2020-05-18 19:56       ` Miquel Raynal
  -1 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2020-05-18 19:56 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, LKML,
	Boris Brezillon, Alban Bedel

Hi Ricardo,

Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Mon, 18 May 2020
16:01:47 +0200:

> Hi
> 
> This is just a friendly ping after two weeks ;)

Don't worry, it's in the pipe :)

> 
> On Mon, May 4, 2020 at 10:44 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Richard,
> >
> > Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Thu, 30 Apr 2020
> > 15:17:21 +0200:
> >  
> > > From: Ricardo Ribalda Delgado <ribalda@kernel.org>
> > >
> > > When the nvmem framework is enabled, a nvmem device is created per mtd
> > > device/partition.
> > >
> > > It is not uncommon that a device can have multiple mtd devices with
> > > partitions that have the same name. Eg, when there DT overlay is allowed
> > > and the same device with mtd is attached twice.
> > >
> > > Under that circumstances, the mtd fails to register due to a name
> > > duplication on the nvmem framework.
> > >
> > > With this patch we use the mtdX name instead of the partition name,
> > > which is unique.
> > >
> > > [    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
> > > [    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
> > > [    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
> > > [    8.948994] Call Trace:
> > > [    8.948996]  dump_stack+0x50/0x70
> > > [    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
> > > [    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
> > > [    8.949002]  bus_add_device+0x74/0x140
> > > [    8.949004]  device_add+0x34b/0x850
> > > [    8.949006]  nvmem_register.part.0+0x1bf/0x640
> > > ...
> > > [    8.948926] mtd mtd8: Failed to register NVMEM device
> > >
> > > Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> > > Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
> > > ---
> > >  drivers/mtd/mtdcore.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> > > index 2916674208b3..29d41003d6e0 100644
> > > --- a/drivers/mtd/mtdcore.c
> > > +++ b/drivers/mtd/mtdcore.c
> > > @@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
> > >
> > >       config.id = -1;
> > >       config.dev = &mtd->dev;
> > > -     config.name = mtd->name;
> > > +     config.name = dev_name(&mtd->dev);
> > >       config.owner = THIS_MODULE;
> > >       config.reg_read = mtd_nvmem_reg_read;
> > >       config.size = mtd->size;  
> >
> > We hope this will definitely fix the NVMEM duplicate name issue. If it
> > does not reliably, we might want to revert this patch and create an MTD
> > unique ID field which, for each MTD device, concatenates the name of
> > its parent and its own mtd->name.
> >
> > Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >
> > Thanks,
> > Miquèl  
> 
> 
> 

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
@ 2020-05-18 19:56       ` Miquel Raynal
  0 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2020-05-18 19:56 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado
  Cc: Vignesh Raghavendra, Richard Weinberger, LKML, Boris Brezillon,
	Alban Bedel, linux-mtd

Hi Ricardo,

Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Mon, 18 May 2020
16:01:47 +0200:

> Hi
> 
> This is just a friendly ping after two weeks ;)

Don't worry, it's in the pipe :)

> 
> On Mon, May 4, 2020 at 10:44 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Richard,
> >
> > Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Thu, 30 Apr 2020
> > 15:17:21 +0200:
> >  
> > > From: Ricardo Ribalda Delgado <ribalda@kernel.org>
> > >
> > > When the nvmem framework is enabled, a nvmem device is created per mtd
> > > device/partition.
> > >
> > > It is not uncommon that a device can have multiple mtd devices with
> > > partitions that have the same name. Eg, when there DT overlay is allowed
> > > and the same device with mtd is attached twice.
> > >
> > > Under that circumstances, the mtd fails to register due to a name
> > > duplication on the nvmem framework.
> > >
> > > With this patch we use the mtdX name instead of the partition name,
> > > which is unique.
> > >
> > > [    8.948991] sysfs: cannot create duplicate filename '/bus/nvmem/devices/Production Data'
> > > [    8.948992] CPU: 7 PID: 246 Comm: systemd-udevd Not tainted 5.5.0-qtec-standard #13
> > > [    8.948993] Hardware name: AMD Dibbler/Dibbler, BIOS 05.22.04.0019 10/26/2019
> > > [    8.948994] Call Trace:
> > > [    8.948996]  dump_stack+0x50/0x70
> > > [    8.948998]  sysfs_warn_dup.cold+0x17/0x2d
> > > [    8.949000]  sysfs_do_create_link_sd.isra.0+0xc2/0xd0
> > > [    8.949002]  bus_add_device+0x74/0x140
> > > [    8.949004]  device_add+0x34b/0x850
> > > [    8.949006]  nvmem_register.part.0+0x1bf/0x640
> > > ...
> > > [    8.948926] mtd mtd8: Failed to register NVMEM device
> > >
> > > Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> > > Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
> > > ---
> > >  drivers/mtd/mtdcore.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> > > index 2916674208b3..29d41003d6e0 100644
> > > --- a/drivers/mtd/mtdcore.c
> > > +++ b/drivers/mtd/mtdcore.c
> > > @@ -555,7 +555,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
> > >
> > >       config.id = -1;
> > >       config.dev = &mtd->dev;
> > > -     config.name = mtd->name;
> > > +     config.name = dev_name(&mtd->dev);
> > >       config.owner = THIS_MODULE;
> > >       config.reg_read = mtd_nvmem_reg_read;
> > >       config.size = mtd->size;  
> >
> > We hope this will definitely fix the NVMEM duplicate name issue. If it
> > does not reliably, we might want to revert this patch and create an MTD
> > unique ID field which, for each MTD device, concatenates the name of
> > its parent and its own mtd->name.
> >
> > Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >
> > Thanks,
> > Miquèl  
> 
> 
> 

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
  2020-05-18 19:56       ` Miquel Raynal
@ 2020-05-18 20:51         ` Richard Weinberger
  -1 siblings, 0 replies; 10+ messages in thread
From: Richard Weinberger @ 2020-05-18 20:51 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Ricardo Ribalda Delgado, Vignesh Raghavendra, linux-mtd,
	linux-kernel, Boris Brezillon, Alban Bedel

----- Ursprüngliche Mail -----
> Von: "Miquel Raynal" <miquel.raynal@bootlin.com>
> An: "Ricardo Ribalda Delgado" <ricardo@ribalda.com>
> CC: "richard" <richard@nod.at>, "Vignesh Raghavendra" <vigneshr@ti.com>, "linux-mtd" <linux-mtd@lists.infradead.org>,
> "linux-kernel" <linux-kernel@vger.kernel.org>, "Boris Brezillon" <boris.brezillon@collabora.com>, "Alban Bedel"
> <albeu@free.fr>
> Gesendet: Montag, 18. Mai 2020 21:56:49
> Betreff: Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision

> Hi Ricardo,
> 
> Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Mon, 18 May 2020
> 16:01:47 +0200:
> 
>> Hi
>> 
>> This is just a friendly ping after two weeks ;)
> 
> Don't worry, it's in the pipe :)

And now applied and pushed. :-)

Thanks,
//richard

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

* Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision
@ 2020-05-18 20:51         ` Richard Weinberger
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Weinberger @ 2020-05-18 20:51 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vignesh Raghavendra, Ricardo Ribalda Delgado, linux-kernel,
	Boris Brezillon, Alban Bedel, linux-mtd

----- Ursprüngliche Mail -----
> Von: "Miquel Raynal" <miquel.raynal@bootlin.com>
> An: "Ricardo Ribalda Delgado" <ricardo@ribalda.com>
> CC: "richard" <richard@nod.at>, "Vignesh Raghavendra" <vigneshr@ti.com>, "linux-mtd" <linux-mtd@lists.infradead.org>,
> "linux-kernel" <linux-kernel@vger.kernel.org>, "Boris Brezillon" <boris.brezillon@collabora.com>, "Alban Bedel"
> <albeu@free.fr>
> Gesendet: Montag, 18. Mai 2020 21:56:49
> Betreff: Re: [PATCH] mtd: Fix mtd not registered due to nvmem name collision

> Hi Ricardo,
> 
> Ricardo Ribalda Delgado <ricardo@ribalda.com> wrote on Mon, 18 May 2020
> 16:01:47 +0200:
> 
>> Hi
>> 
>> This is just a friendly ping after two weeks ;)
> 
> Don't worry, it's in the pipe :)

And now applied and pushed. :-)

Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2020-05-18 20:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 13:17 [PATCH] mtd: Fix mtd not registered due to nvmem name collision Ricardo Ribalda Delgado
2020-04-30 13:17 ` Ricardo Ribalda Delgado
2020-05-04  8:43 ` Miquel Raynal
2020-05-04  8:43   ` Miquel Raynal
2020-05-18 14:01   ` Ricardo Ribalda Delgado
2020-05-18 14:01     ` Ricardo Ribalda Delgado
2020-05-18 19:56     ` Miquel Raynal
2020-05-18 19:56       ` Miquel Raynal
2020-05-18 20:51       ` Richard Weinberger
2020-05-18 20:51         ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.