public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* nvmem creates multiple devices with the same name
@ 2019-05-21  8:56 Sascha Hauer
  2019-05-21  9:02 ` Srinivas Kandagatla
  2019-07-02 18:59 ` Boris Brezillon
  0 siblings, 2 replies; 7+ messages in thread
From: Sascha Hauer @ 2019-05-21  8:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Srinivas Kandagatla, kernel, linux-mtd

Hi all,

nvmem derives the device name directly from the partition name of the
underlying device. IMO this is wrong since it's not possible to create
two partitions with the same name on different devices. In my case I
have a NAND device and a SPI NOR device which both happen to have a
partition named 'barebox'. This ends up with:

[   11.222196] sysfs: cannot create duplicate filename '/bus/nvmem/devices/barebox'
[   11.230136] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W         5.2.0-rc1-00014-g793f23e5adb0-dirty #676
[   11.240414] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   11.247174] [<c0112928>] (unwind_backtrace) from [<c010d140>] (show_stack+0x10/0x14)
[   11.255171] [<c010d140>] (show_stack) from [<c0bd65cc>] (dump_stack+0xd8/0x110)
[   11.262722] [<c0bd65cc>] (dump_stack) from [<c031682c>] (sysfs_warn_dup+0x50/0x64)
[   11.270527] [<c031682c>] (sysfs_warn_dup) from [<c0316b34>] (sysfs_do_create_link_sd+0xcc/0xd8)
[   11.279487] [<c0316b34>] (sysfs_do_create_link_sd) from [<c06792a0>] (bus_add_device+0x80/0xfc)
[   11.288441] [<c06792a0>] (bus_add_device) from [<c0676208>] (device_add+0x328/0x608)
[   11.296423] [<c0676208>] (device_add) from [<c08bde64>] (nvmem_register.part.1+0x168/0x5e4)
[   11.305030] [<c08bde64>] (nvmem_register.part.1) from [<c06edb34>] (add_mtd_device+0x1e8/0x404)
[   11.313988] [<c06edb34>] (add_mtd_device) from [<c06f1004>] (add_mtd_partitions+0x74/0x15c)
[   11.322589] [<c06f1004>] (add_mtd_partitions) from [<c06f0da8>] (parse_mtd_partitions+0x180/0x368)
[   11.331807] [<c06f0da8>] (parse_mtd_partitions) from [<c06ede68>] (mtd_device_parse_register+0x40/0x164)
[   11.341560] [<c06ede68>] (mtd_device_parse_register) from [<c070654c>] (m25p_probe+0x118/0x200)
[   11.350513] [<c070654c>] (m25p_probe) from [<c073863c>] (spi_drv_probe+0x80/0xa4)

While it's easy to rename the partitions I see no reason why it should
be illegal to have two different (mtd) devices with eqeally named
partitions. Are there any suggestions how to register the nvmem devices
with a different name?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

end of thread, other threads:[~2019-07-08  7:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-21  8:56 nvmem creates multiple devices with the same name Sascha Hauer
2019-05-21  9:02 ` Srinivas Kandagatla
2019-05-21  9:21   ` Sascha Hauer
2019-07-01  8:06     ` Sascha Hauer
2019-07-02 16:54       ` Srinivas Kandagatla
2019-07-08  7:14         ` Sascha Hauer
2019-07-02 18:59 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox