linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device
@ 2019-02-08 15:14 Aneesh Kumar K.V
  2019-02-08 15:14 ` [PATCH v3 2/2] drivers/mtd: Fix device registration error Aneesh Kumar K.V
  2019-02-10 12:55 ` [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device Boris Brezillon
  0 siblings, 2 replies; 9+ messages in thread
From: Aneesh Kumar K.V @ 2019-02-08 15:14 UTC (permalink / raw)
  To: Alban Bedel, linuxppc-dev, Boris Brezillon; +Cc: Aneesh Kumar K.V

With this patch, we use the mtd->name instead of concatenating the name with '0'

Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 drivers/mtd/mtdcore.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 999b705769a8..3ef01baef9b6 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -507,6 +507,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
 {
 	struct nvmem_config config = {};
 
+	config.id = -1;
 	config.dev = &mtd->dev;
 	config.name = mtd->name;
 	config.owner = THIS_MODULE;
-- 
2.20.1


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

* [PATCH v3 2/2] drivers/mtd: Fix device registration error
  2019-02-08 15:14 [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device Aneesh Kumar K.V
@ 2019-02-08 15:14 ` Aneesh Kumar K.V
  2019-02-10 12:55 ` [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device Boris Brezillon
  1 sibling, 0 replies; 9+ messages in thread
From: Aneesh Kumar K.V @ 2019-02-08 15:14 UTC (permalink / raw)
  To: Alban Bedel, linuxppc-dev, Boris Brezillon; +Cc: Aneesh Kumar K.V

This change helps me to get multiple mtd device registered. Without this
I get

sysfs: cannot create duplicate filename '/bus/nvmem/devices/flash0'
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2-00557-g1ef20ef21f22 #13
Call Trace:
[c0000000b38e3220] [c000000000b58fe4] dump_stack+0xe8/0x164 (unreliable)
[c0000000b38e3270] [c0000000004cf074] sysfs_warn_dup+0x84/0xb0
[c0000000b38e32f0] [c0000000004cf6c4] sysfs_do_create_link_sd.isra.0+0x114/0x150
[c0000000b38e3340] [c000000000726a84] bus_add_device+0x94/0x1e0
[c0000000b38e33c0] [c0000000007218f0] device_add+0x4d0/0x830
[c0000000b38e3480] [c0000000009d54a8] nvmem_register.part.2+0x1c8/0xb30
[c0000000b38e3560] [c000000000834530] mtd_nvmem_add+0x90/0x120
[c0000000b38e3650] [c000000000835bc8] add_mtd_device+0x198/0x4e0
[c0000000b38e36f0] [c00000000083619c] mtd_device_parse_register+0x11c/0x280
[c0000000b38e3780] [c000000000840830] powernv_flash_probe+0x180/0x250
[c0000000b38e3820] [c00000000072c120] platform_drv_probe+0x60/0xf0
[c0000000b38e38a0] [c0000000007283c8] really_probe+0x138/0x4d0
[c0000000b38e3930] [c000000000728acc] driver_probe_device+0x13c/0x1b0
[c0000000b38e39b0] [c000000000728c7c] __driver_attach+0x13c/0x1c0
[c0000000b38e3a30] [c000000000725130] bus_for_each_dev+0xa0/0x120
[c0000000b38e3a90] [c000000000727b2c] driver_attach+0x2c/0x40
[c0000000b38e3ab0] [c0000000007270f8] bus_add_driver+0x228/0x360
[c0000000b38e3b40] [c00000000072a2e0] driver_register+0x90/0x1a0
[c0000000b38e3bb0] [c00000000072c020] __platform_driver_register+0x50/0x70
[c0000000b38e3bd0] [c00000000105c984] powernv_flash_driver_init+0x24/0x38
[c0000000b38e3bf0] [c000000000010904] do_one_initcall+0x84/0x464
[c0000000b38e3cd0] [c000000001004548] kernel_init_freeable+0x530/0x634
[c0000000b38e3db0] [c000000000011154] kernel_init+0x1c/0x168
[c0000000b38e3e20] [c00000000000bed4] ret_from_kernel_thread+0x5c/0x68
mtd mtd1: Failed to register NVMEM device

With the change we now have

root@(none):/sys/bus/nvmem/devices# ls -al
total 0
drwxr-xr-x 2 root root 0 Feb  6 20:49 .
drwxr-xr-x 4 root root 0 Feb  6 20:49 ..
lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@0 -> ../../../devices/platform/ibm,opal:flash@0/mtd/mtd0/flash@0
lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@1 -> ../../../devices/platform/ibm,opal:flash@1/mtd/mtd1/flash@1

Fixes: acfe63ec1c59 ("mtd: Convert to using %pOFn instead of device_node.name")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 drivers/mtd/devices/powernv_flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/powernv_flash.c b/drivers/mtd/devices/powernv_flash.c
index 22f753e555ac..83f88b8b5d9f 100644
--- a/drivers/mtd/devices/powernv_flash.c
+++ b/drivers/mtd/devices/powernv_flash.c
@@ -212,7 +212,7 @@ static int powernv_flash_set_driver_info(struct device *dev,
 	 * Going to have to check what details I need to set and how to
 	 * get them
 	 */
-	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);
+	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
 	mtd->type = MTD_NORFLASH;
 	mtd->flags = MTD_WRITEABLE;
 	mtd->size = size;
-- 
2.20.1


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

* Re: [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device
  2019-02-08 15:14 [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device Aneesh Kumar K.V
  2019-02-08 15:14 ` [PATCH v3 2/2] drivers/mtd: Fix device registration error Aneesh Kumar K.V
@ 2019-02-10 12:55 ` Boris Brezillon
  2019-02-11 10:56   ` Aneesh Kumar K.V
  1 sibling, 1 reply; 9+ messages in thread
From: Boris Brezillon @ 2019-02-10 12:55 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, Alban Bedel, linux-mtd

Hello Aneesh,

On Fri,  8 Feb 2019 20:44:18 +0530
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:

> With this patch, we use the mtd->name instead of concatenating the name with '0'
> 
> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>

You forgot to Cc the MTD ML and maintainers. Can you please send a new
version?

Thanks,

Boris

> ---
>  drivers/mtd/mtdcore.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 999b705769a8..3ef01baef9b6 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -507,6 +507,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
>  {
>  	struct nvmem_config config = {};
>  
> +	config.id = -1;
>  	config.dev = &mtd->dev;
>  	config.name = mtd->name;
>  	config.owner = THIS_MODULE;


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

* Re: [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device
  2019-02-10 12:55 ` [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device Boris Brezillon
@ 2019-02-11 10:56   ` Aneesh Kumar K.V
  2019-02-11 11:16     ` Boris Brezillon
  0 siblings, 1 reply; 9+ messages in thread
From: Aneesh Kumar K.V @ 2019-02-11 10:56 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: linuxppc-dev, Alban Bedel, linux-mtd

On 2/10/19 6:25 PM, Boris Brezillon wrote:
> Hello Aneesh,
> 
> On Fri,  8 Feb 2019 20:44:18 +0530
> "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
> 
>> With this patch, we use the mtd->name instead of concatenating the name with '0'
>>
>> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> 
> You forgot to Cc the MTD ML and maintainers. Can you please send a new
> version?
> 

linux-mtd list is on CC: Is that not sufficient?

-aneesh


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

* Re: [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device
  2019-02-11 10:56   ` Aneesh Kumar K.V
@ 2019-02-11 11:16     ` Boris Brezillon
  2019-02-11 13:34       ` Aneesh Kumar K.V
  0 siblings, 1 reply; 9+ messages in thread
From: Boris Brezillon @ 2019-02-11 11:16 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, Alban Bedel, linux-mtd

On Mon, 11 Feb 2019 16:26:38 +0530
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:

> On 2/10/19 6:25 PM, Boris Brezillon wrote:
> > Hello Aneesh,
> > 
> > On Fri,  8 Feb 2019 20:44:18 +0530
> > "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
> >   
> >> With this patch, we use the mtd->name instead of concatenating the name with '0'
> >>
> >> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
> >> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>  
> > 
> > You forgot to Cc the MTD ML and maintainers. Can you please send a new
> > version?
> >   
> 
> linux-mtd list is on CC: Is that not sufficient?

Not in your original email, I added it in my reply.

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

* Re: [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device
  2019-02-11 11:16     ` Boris Brezillon
@ 2019-02-11 13:34       ` Aneesh Kumar K.V
  0 siblings, 0 replies; 9+ messages in thread
From: Aneesh Kumar K.V @ 2019-02-11 13:34 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: linuxppc-dev, Alban Bedel, linux-mtd

On 2/11/19 4:46 PM, Boris Brezillon wrote:
> On Mon, 11 Feb 2019 16:26:38 +0530
> "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
> 
>> On 2/10/19 6:25 PM, Boris Brezillon wrote:
>>> Hello Aneesh,
>>>
>>> On Fri,  8 Feb 2019 20:44:18 +0530
>>> "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
>>>    
>>>> With this patch, we use the mtd->name instead of concatenating the name with '0'
>>>>
>>>> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
>>>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>>>
>>> You forgot to Cc the MTD ML and maintainers. Can you please send a new
>>> version?
>>>    
>>
>> linux-mtd list is on CC: Is that not sufficient?
> 
> Not in your original email, I added it in my reply.
> 


Sorry about that. I will now resend with linux-mtd on CC: I missed that 
earlier.

-aneesh


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

* Re: [PATCH v3 2/2] drivers/mtd: Fix device registration error
  2019-02-13 13:28   ` Boris Brezillon
@ 2019-02-14  4:23     ` Aneesh Kumar K.V
  0 siblings, 0 replies; 9+ messages in thread
From: Aneesh Kumar K.V @ 2019-02-14  4:23 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: linuxppc-dev, Alban Bedel, linux-mtd

On 2/13/19 6:58 PM, Boris Brezillon wrote:
> Subject prefix should be "mtd: powernv_flash: "
> 
> On Mon, 11 Feb 2019 19:03:38 +0530
> "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
> 
>> This change helps me to get multiple mtd device registered. Without this
>> I get
>>
>> sysfs: cannot create duplicate filename '/bus/nvmem/devices/flash0'
>> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2-00557-g1ef20ef21f22 #13
>> Call Trace:
>> [c0000000b38e3220] [c000000000b58fe4] dump_stack+0xe8/0x164 (unreliable)
>> [c0000000b38e3270] [c0000000004cf074] sysfs_warn_dup+0x84/0xb0
>> [c0000000b38e32f0] [c0000000004cf6c4] sysfs_do_create_link_sd.isra.0+0x114/0x150
>> [c0000000b38e3340] [c000000000726a84] bus_add_device+0x94/0x1e0
>> [c0000000b38e33c0] [c0000000007218f0] device_add+0x4d0/0x830
>> [c0000000b38e3480] [c0000000009d54a8] nvmem_register.part.2+0x1c8/0xb30
>> [c0000000b38e3560] [c000000000834530] mtd_nvmem_add+0x90/0x120
>> [c0000000b38e3650] [c000000000835bc8] add_mtd_device+0x198/0x4e0
>> [c0000000b38e36f0] [c00000000083619c] mtd_device_parse_register+0x11c/0x280
>> [c0000000b38e3780] [c000000000840830] powernv_flash_probe+0x180/0x250
>> [c0000000b38e3820] [c00000000072c120] platform_drv_probe+0x60/0xf0
>> [c0000000b38e38a0] [c0000000007283c8] really_probe+0x138/0x4d0
>> [c0000000b38e3930] [c000000000728acc] driver_probe_device+0x13c/0x1b0
>> [c0000000b38e39b0] [c000000000728c7c] __driver_attach+0x13c/0x1c0
>> [c0000000b38e3a30] [c000000000725130] bus_for_each_dev+0xa0/0x120
>> [c0000000b38e3a90] [c000000000727b2c] driver_attach+0x2c/0x40
>> [c0000000b38e3ab0] [c0000000007270f8] bus_add_driver+0x228/0x360
>> [c0000000b38e3b40] [c00000000072a2e0] driver_register+0x90/0x1a0
>> [c0000000b38e3bb0] [c00000000072c020] __platform_driver_register+0x50/0x70
>> [c0000000b38e3bd0] [c00000000105c984] powernv_flash_driver_init+0x24/0x38
>> [c0000000b38e3bf0] [c000000000010904] do_one_initcall+0x84/0x464
>> [c0000000b38e3cd0] [c000000001004548] kernel_init_freeable+0x530/0x634
>> [c0000000b38e3db0] [c000000000011154] kernel_init+0x1c/0x168
>> [c0000000b38e3e20] [c00000000000bed4] ret_from_kernel_thread+0x5c/0x68
>> mtd mtd1: Failed to register NVMEM device
>>
>> With the change we now have
>>
>> root@(none):/sys/bus/nvmem/devices# ls -al
>> total 0
>> drwxr-xr-x 2 root root 0 Feb  6 20:49 .
>> drwxr-xr-x 4 root root 0 Feb  6 20:49 ..
>> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@0 -> ../../../devices/platform/ibm,opal:flash@0/mtd/mtd0/flash@0
>> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@1 -> ../../../devices/platform/ibm,opal:flash@1/mtd/mtd1/flash@1
>>
>> Fixes: acfe63ec1c59 ("mtd: Convert to using %pOFn instead of device_node.name")
> 
> Actually it's not this commit that is at fault as mtd->name was already
> given the value of device_node->name before that. I think you're
> actually fixing 1cbb4a1c433a ("mtd: powernv: Add powernv flash MTD
> abstraction driver").
> 
> No need to send a new version, I can fix that when applying, just let
> me know if you're okay with the changes I suggested.
> 

The suggested changes looks good.

Thanks
-aneesh


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

* Re: [PATCH v3 2/2] drivers/mtd: Fix device registration error
  2019-02-11 13:33 ` [PATCH v3 2/2] drivers/mtd: Fix device registration error Aneesh Kumar K.V
@ 2019-02-13 13:28   ` Boris Brezillon
  2019-02-14  4:23     ` Aneesh Kumar K.V
  0 siblings, 1 reply; 9+ messages in thread
From: Boris Brezillon @ 2019-02-13 13:28 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, Alban Bedel, linux-mtd

Subject prefix should be "mtd: powernv_flash: "

On Mon, 11 Feb 2019 19:03:38 +0530
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:

> This change helps me to get multiple mtd device registered. Without this
> I get
> 
> sysfs: cannot create duplicate filename '/bus/nvmem/devices/flash0'
> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2-00557-g1ef20ef21f22 #13
> Call Trace:
> [c0000000b38e3220] [c000000000b58fe4] dump_stack+0xe8/0x164 (unreliable)
> [c0000000b38e3270] [c0000000004cf074] sysfs_warn_dup+0x84/0xb0
> [c0000000b38e32f0] [c0000000004cf6c4] sysfs_do_create_link_sd.isra.0+0x114/0x150
> [c0000000b38e3340] [c000000000726a84] bus_add_device+0x94/0x1e0
> [c0000000b38e33c0] [c0000000007218f0] device_add+0x4d0/0x830
> [c0000000b38e3480] [c0000000009d54a8] nvmem_register.part.2+0x1c8/0xb30
> [c0000000b38e3560] [c000000000834530] mtd_nvmem_add+0x90/0x120
> [c0000000b38e3650] [c000000000835bc8] add_mtd_device+0x198/0x4e0
> [c0000000b38e36f0] [c00000000083619c] mtd_device_parse_register+0x11c/0x280
> [c0000000b38e3780] [c000000000840830] powernv_flash_probe+0x180/0x250
> [c0000000b38e3820] [c00000000072c120] platform_drv_probe+0x60/0xf0
> [c0000000b38e38a0] [c0000000007283c8] really_probe+0x138/0x4d0
> [c0000000b38e3930] [c000000000728acc] driver_probe_device+0x13c/0x1b0
> [c0000000b38e39b0] [c000000000728c7c] __driver_attach+0x13c/0x1c0
> [c0000000b38e3a30] [c000000000725130] bus_for_each_dev+0xa0/0x120
> [c0000000b38e3a90] [c000000000727b2c] driver_attach+0x2c/0x40
> [c0000000b38e3ab0] [c0000000007270f8] bus_add_driver+0x228/0x360
> [c0000000b38e3b40] [c00000000072a2e0] driver_register+0x90/0x1a0
> [c0000000b38e3bb0] [c00000000072c020] __platform_driver_register+0x50/0x70
> [c0000000b38e3bd0] [c00000000105c984] powernv_flash_driver_init+0x24/0x38
> [c0000000b38e3bf0] [c000000000010904] do_one_initcall+0x84/0x464
> [c0000000b38e3cd0] [c000000001004548] kernel_init_freeable+0x530/0x634
> [c0000000b38e3db0] [c000000000011154] kernel_init+0x1c/0x168
> [c0000000b38e3e20] [c00000000000bed4] ret_from_kernel_thread+0x5c/0x68
> mtd mtd1: Failed to register NVMEM device
> 
> With the change we now have
> 
> root@(none):/sys/bus/nvmem/devices# ls -al
> total 0
> drwxr-xr-x 2 root root 0 Feb  6 20:49 .
> drwxr-xr-x 4 root root 0 Feb  6 20:49 ..
> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@0 -> ../../../devices/platform/ibm,opal:flash@0/mtd/mtd0/flash@0
> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@1 -> ../../../devices/platform/ibm,opal:flash@1/mtd/mtd1/flash@1
> 
> Fixes: acfe63ec1c59 ("mtd: Convert to using %pOFn instead of device_node.name")

Actually it's not this commit that is at fault as mtd->name was already
given the value of device_node->name before that. I think you're
actually fixing 1cbb4a1c433a ("mtd: powernv: Add powernv flash MTD
abstraction driver").

No need to send a new version, I can fix that when applying, just let
me know if you're okay with the changes I suggested.

> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
>  drivers/mtd/devices/powernv_flash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c b/drivers/mtd/devices/powernv_flash.c
> index 22f753e555ac..83f88b8b5d9f 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -212,7 +212,7 @@ static int powernv_flash_set_driver_info(struct device *dev,
>  	 * Going to have to check what details I need to set and how to
>  	 * get them
>  	 */
> -	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);
> +	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
>  	mtd->type = MTD_NORFLASH;
>  	mtd->flags = MTD_WRITEABLE;
>  	mtd->size = size;


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

* [PATCH v3 2/2] drivers/mtd: Fix device registration error
  2019-02-11 13:33 Aneesh Kumar K.V
@ 2019-02-11 13:33 ` Aneesh Kumar K.V
  2019-02-13 13:28   ` Boris Brezillon
  0 siblings, 1 reply; 9+ messages in thread
From: Aneesh Kumar K.V @ 2019-02-11 13:33 UTC (permalink / raw)
  To: Alban Bedel, linuxppc-dev, Boris Brezillon, linux-mtd; +Cc: Aneesh Kumar K.V

This change helps me to get multiple mtd device registered. Without this
I get

sysfs: cannot create duplicate filename '/bus/nvmem/devices/flash0'
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2-00557-g1ef20ef21f22 #13
Call Trace:
[c0000000b38e3220] [c000000000b58fe4] dump_stack+0xe8/0x164 (unreliable)
[c0000000b38e3270] [c0000000004cf074] sysfs_warn_dup+0x84/0xb0
[c0000000b38e32f0] [c0000000004cf6c4] sysfs_do_create_link_sd.isra.0+0x114/0x150
[c0000000b38e3340] [c000000000726a84] bus_add_device+0x94/0x1e0
[c0000000b38e33c0] [c0000000007218f0] device_add+0x4d0/0x830
[c0000000b38e3480] [c0000000009d54a8] nvmem_register.part.2+0x1c8/0xb30
[c0000000b38e3560] [c000000000834530] mtd_nvmem_add+0x90/0x120
[c0000000b38e3650] [c000000000835bc8] add_mtd_device+0x198/0x4e0
[c0000000b38e36f0] [c00000000083619c] mtd_device_parse_register+0x11c/0x280
[c0000000b38e3780] [c000000000840830] powernv_flash_probe+0x180/0x250
[c0000000b38e3820] [c00000000072c120] platform_drv_probe+0x60/0xf0
[c0000000b38e38a0] [c0000000007283c8] really_probe+0x138/0x4d0
[c0000000b38e3930] [c000000000728acc] driver_probe_device+0x13c/0x1b0
[c0000000b38e39b0] [c000000000728c7c] __driver_attach+0x13c/0x1c0
[c0000000b38e3a30] [c000000000725130] bus_for_each_dev+0xa0/0x120
[c0000000b38e3a90] [c000000000727b2c] driver_attach+0x2c/0x40
[c0000000b38e3ab0] [c0000000007270f8] bus_add_driver+0x228/0x360
[c0000000b38e3b40] [c00000000072a2e0] driver_register+0x90/0x1a0
[c0000000b38e3bb0] [c00000000072c020] __platform_driver_register+0x50/0x70
[c0000000b38e3bd0] [c00000000105c984] powernv_flash_driver_init+0x24/0x38
[c0000000b38e3bf0] [c000000000010904] do_one_initcall+0x84/0x464
[c0000000b38e3cd0] [c000000001004548] kernel_init_freeable+0x530/0x634
[c0000000b38e3db0] [c000000000011154] kernel_init+0x1c/0x168
[c0000000b38e3e20] [c00000000000bed4] ret_from_kernel_thread+0x5c/0x68
mtd mtd1: Failed to register NVMEM device

With the change we now have

root@(none):/sys/bus/nvmem/devices# ls -al
total 0
drwxr-xr-x 2 root root 0 Feb  6 20:49 .
drwxr-xr-x 4 root root 0 Feb  6 20:49 ..
lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@0 -> ../../../devices/platform/ibm,opal:flash@0/mtd/mtd0/flash@0
lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@1 -> ../../../devices/platform/ibm,opal:flash@1/mtd/mtd1/flash@1

Fixes: acfe63ec1c59 ("mtd: Convert to using %pOFn instead of device_node.name")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 drivers/mtd/devices/powernv_flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/powernv_flash.c b/drivers/mtd/devices/powernv_flash.c
index 22f753e555ac..83f88b8b5d9f 100644
--- a/drivers/mtd/devices/powernv_flash.c
+++ b/drivers/mtd/devices/powernv_flash.c
@@ -212,7 +212,7 @@ static int powernv_flash_set_driver_info(struct device *dev,
 	 * Going to have to check what details I need to set and how to
 	 * get them
 	 */
-	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);
+	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
 	mtd->type = MTD_NORFLASH;
 	mtd->flags = MTD_WRITEABLE;
 	mtd->size = size;
-- 
2.20.1


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

end of thread, other threads:[~2019-02-14  4:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-08 15:14 [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device Aneesh Kumar K.V
2019-02-08 15:14 ` [PATCH v3 2/2] drivers/mtd: Fix device registration error Aneesh Kumar K.V
2019-02-10 12:55 ` [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device Boris Brezillon
2019-02-11 10:56   ` Aneesh Kumar K.V
2019-02-11 11:16     ` Boris Brezillon
2019-02-11 13:34       ` Aneesh Kumar K.V
2019-02-11 13:33 Aneesh Kumar K.V
2019-02-11 13:33 ` [PATCH v3 2/2] drivers/mtd: Fix device registration error Aneesh Kumar K.V
2019-02-13 13:28   ` Boris Brezillon
2019-02-14  4:23     ` Aneesh Kumar K.V

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