Re: i2c-mux adapter names not unique

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using an adapter id is not a valid and deterministic method for
identifying a i2c bus. The way you can identify what adapter you need to
bind to is by identifying the unique parent device that hosts the
adapter (pci, platform, usb, ....) and identifying a constant parameter
like bus id/ SN/ bus address, using this as your adapter base and
traversing the bus tree based on the channel you need to connect to your
mux. Take a look at the work done with lsi2c and i2cdev.
https://github.com/costad2/i2cdev

Good luck,

Danielle


On 03/13/2017 02:01 PM, Peter Rosin wrote:
> On 2017-03-13 16:05, MikeB wrote:
>> On Mon, Mar 13, 2017 at 10:48 AM, Peter Rosin <peda@xxxxxxxxxx> wrote:
>>> 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).
>> If I thought that OpenSwitch's expectation of Linux to name unique
>> adapters uniquely, I would push for a change in OpenSwitch.
>>
>> I personally think Linux's naming convention is a short-sighted and
>> insufficient which is why I came to Linux first.
>>
>> I don't want a short-sighted band-aid which is why I asked the
>> original question.
>>
>> I'll try elsewhere for a solution...
> That's probably best, since if we do change the adapter naming convention
> to something that is unique and stable across reboots (which presumably is
> what is sought, and BTW probably not a trivial problem) some other person
> is going to suffer a regression when OpenSwitch fails to associate with
> the intended adapter after a kernel update. I.e. the very fact that
> OpenSwitch is already using this interface makes it harder to change. And
> who knows, maybe there are other users that will suffer if naming is
> changed?
>
> [Note that I know nothing about OpenSwitch, I'm just deducing the above
> from what you have stated previously]
>
> I'm sorry, but there's not always a simple and convenient answer...
>
> 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


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux