lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a74a7472-e900-d031-d10b-b12f03ea9ff1@axentia.se>
Date:   Fri, 20 Jul 2018 15:16:15 +0200
From:   Peter Rosin <peda@...ntia.se>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Wolfram Sang <wsa@...-dreams.de>,
        Boris Brezillon <boris.brezillon@...tlin.com>,
        linux-i2c@...r.kernel.org, Jonathan Corbet <corbet@....net>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Przemyslaw Sroka <psroka@...ence.com>,
        Arkadiusz Golec <agolec@...ence.com>,
        Alan Douglas <adouglas@...ence.com>,
        Bartosz Folta <bfolta@...ence.com>,
        Damian Kos <dkos@...ence.com>,
        Alicja Jurasik-Urbaniak <alicja@...ence.com>,
        Cyprian Wronka <cwronka@...ence.com>,
        Suresh Punnoose <sureshp@...ence.com>,
        Rafal Ciepiela <rafalc@...ence.com>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Nishanth Menon <nm@...com>, Rob Herring <robh+dt@...nel.org>,
        Pawel Moll <pawel.moll@....com>,
        Mark Rutland <mark.rutland@....com>,
        Ian Campbell <ijc+devicetree@...lion.org.uk>,
        Kumar Gala <galak@...eaurora.org>,
        DTML <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Vitor Soares <Vitor.Soares@...opsys.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Xiang Lin <Xiang.Lin@...aptics.com>,
        linux-gpio@...r.kernel.org, Sekhar Nori <nsekhar@...com>,
        Przemyslaw Gaj <pgaj@...ence.com>
Subject: Re: [PATCH v6 00/10] Add the I3C subsystem

On 2018-07-20 13:28, Arnd Bergmann wrote:
> On Fri, Jul 20, 2018 at 1:13 PM, Peter Rosin <peda@...ntia.se> wrote:
>> On 2018-07-20 12:57, Arnd Bergmann wrote:
>>> * What I understand from reading i2c-demux-pinctrl.c, a slave device
>>>   will only ever be observable from one master at a time, when you
>>>   switch over, all children get removed on one master and added to
>>>   the other one, to be probed again by their respective drivers.
>>>   I can see this as a useful feature on i3c as well, in particular to
>>>   deal with the situation where we have i2c slaves connected to a
>>>   pinmux that can switch them between an i3c master and an
>>>   i2c-only master (possibly a gpio based one). That particular use
>>>   case however doesn't seem to fix well in the current code, which
>>>   is structure around i3c buses.
>>
>> It's pretty easy to come up with examples where this reprobing is
>> not desirable at all. E.g. if one of the involved I2C devices is
>> a HDMI encoder (I have a TDA19988 here) sitting in the middle of the
>> graphics pipeline. Blink-blink on the screen because some *other*
>> unrelated device needed to be accessed by an alternative master. Not
>> pretty.
> 
> Agreed, we definitely don't want to reprobe all devices during normal
> operation for i3c master handover.
> 
> What is the least contrived use case that you can think of where we
> would want to use one master to talk to one device on the bus,
> but another master to talk to another device on the same bus?
> I still hope that we can decide that this is not a useful scenario
> at all.
> 
> If we find a case in which it is needed, we could still deal with it
> like this:
> - enumerate all slaves connected to the bus for each of the
>   two masters
> - mark each slave as status="enabled" in at most one of the
>   buses, and as disabled everywhere else
> - Use dynamic handover according to the bus protocol to
>   switch masters without having Linux even know that the
>   two buses are shared.
> 
> That scenario would then fall completely into the "secondary
> master handover" category but require no special handling
> in the i3c layer beyond what we need for secondary masters
> that are managed by something outside of the kernel's
> score (a microcontroller, firmware, ...).

The worst case is not mentioned above, where a single device benefits
from being accessed by two different masters.

That happens e.g. if one master is speedy but triggers a quirk and
one master is slow and reliable, and the device must use the speedy
master for some things (high bandwidth data?) but can't use it for
other things (configuration?) and must fall back to the slow and
reliable master for that.

I don't have an actual example for I2C, maybe Wolfram does? But I can
invent a case. E.g. the speedy DMA-enabled master cannot generate
RESTART, which is a must for (re-)configuration, but not for passing
data to the device.


Also consider some future HW that has several I3C blocks, but they
are not identical. There's one beefy kind and one slim kind (I'm sure
you can find HW with different flavors of I2C blocks). Even if the
HW designers intended for one type of block to be superior in every
aspect, they might have made a mistake? This HW also has a pinmux, so
the SW is free to route different I3C blocks to the actual I3C bus.
Maybe the involved I3C blocks don't see the bus when the pinmux is
in the "wrong" state? Then you can't do a normal handover...


But if you *want* to end up with "that's just too contrived", then
of course that's where you'll end up.

Cheers,
Peter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ