linux-stable/net/dsa
Florian Fainelli f490be049b dsa: use an unique and non conflicting bus name for the slave MII bus
The slave MII bus registered by the DSA code is using the parent MII bus
as part of its name (ds->master_mii_bus_id), in case the parent MII bus
name is already 16 characters long (such as d0072004.mdio-mi) we will
get the following WARN_ON in dsa_switch_setup() when calling
mdiobus_register():

[   79.088782] ------------[ cut here ]------------
[   79.093448] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x80/0xa0()
[   79.099831] sysfs: cannot create duplicate filename
'/class/mdio_bus/d0072004.mdio-mi'

This is a genuine warning, because the DSA slave MII bus will also be
named d0072004.mdio-mi, and since MII_BUS_ID_SIZE is 17 characters long
(with null-terminator) the following will truncate the slave MII bus id:

snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "%s-%d:%.2x",
                        ds->master_mii_bus->id, ds->pd->sw_addr);

Fix this by using dsa-<switch index->:<sw_add> which is guaranteed to be
unique.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-21 15:40:11 -05:00
..
dsa.c workqueue: deprecate flush[_delayed]_work_sync() 2012-08-20 14:51:24 -07:00
dsa_priv.h dsa: Move all definitions needed by drivers into <net/dsa.h> 2011-11-29 00:21:36 -05:00
Kconfig dsa: Hide core config options; make drivers select what they need 2012-11-26 17:10:44 -05:00
Makefile dsa: Move switch drivers to new directory drivers/net/dsa 2011-11-29 00:21:36 -05:00
slave.c dsa: use an unique and non conflicting bus name for the slave MII bus 2013-01-21 15:40:11 -05:00
tag_dsa.c dsa: Combine core and tagging code 2011-11-26 14:48:15 -05:00
tag_edsa.c dsa: Combine core and tagging code 2011-11-26 14:48:15 -05:00
tag_trailer.c dsa: Combine core and tagging code 2011-11-26 14:48:15 -05:00