On 2017-03-13 15:00, MikeB wrote: > On Mon, Mar 13, 2017 at 9:34 AM, Peter Rosin <peda@xxxxxxxxxx> wrote: >>> Any suggestions on how to modify i2c-mux.c to make these names unique? >> >> Why do they have to be unique? >> > I am porting OpenSwitch (www.openswitch.net) to a new platform that > has a topology as above. OpenSwitch uses i2c adapter names to bind > i2c adapter devices to internal i2c adapters. It assumes that > adapters are given unique names. As indicated by the part you elided, that appears to be a bad assumption. > The presumption based on current i2c-mux behavior was that i2c adapter > names would be unique. I knew this would cause problems for > OpenSwitch sooner or later. It's sooner for me. > > I've patched my local kernel to add the mux address to the name - > "i2c-<parent adapter id>-mux-<mux addr> (chan_id <id>)" which does > result in unique names. However, my patch only works on topologies > that use only pca954x muxes. I'd prefer a patch that could work for > all topologies. And why not fix the bad assumption in OpenSwitch instead and kill the generic problem for every kind of adapter? Limiting yourself to a band-aid for i2c-mux adapters seems short-sighted and not very helpful for the next victim of this OpenSwitch problem... Note that you do not need two muxing levels to get duplicate names like this, it's enough with two parallel multiplexers on the root adapter. Or, of course, two AT91 adapters (or similar, i.e. with a fixed name). Cheers, peda -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html