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: <CAK8P3a0Ew+RS_1buR+1OneH8XEqVjPOr0FGCF5d6CvFQuJqg6g@mail.gmail.com>
Date:   Wed, 30 Jun 2021 09:55:49 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Jie Deng <jie.deng@...el.com>
Cc:     Wolfram Sang <wsa@...nel.org>,
        Linux I2C <linux-i2c@...r.kernel.org>,
        virtualization@...ts.linux-foundation.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        conghui.chen@...el.com, kblaiech@...lanox.com,
        jarkko.nikula@...ux.intel.com,
        Sergey Semin <Sergey.Semin@...kalelectronics.ru>,
        Mike Rapoport <rppt@...nel.org>, loic.poulain@...aro.org,
        Tali Perry <tali.perry1@...il.com>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        yu1.wang@...el.com, shuo.a.liu@...el.com,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Stefan Hajnoczi <stefanha@...hat.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH v10] i2c: virtio: add a virtio i2c frontend driver

On Wed, Jun 30, 2021 at 9:51 AM Jie Deng <jie.deng@...el.com> wrote:
> On 2021/6/30 15:32, Wolfram Sang wrote:
> >>>> +  snprintf(vi->adap.name, sizeof(vi->adap.name), "Virtio I2C Adapter");
> >>> Is there something to add so you can distinguish multiple instances?
> >>> Most people want that.
> >>
> >> I find the I2C core will set a device name "i2c-%d" for this purpose, right?
> >>
> >> I think this name can be used to distinguish the adapter types while
> >> "i2c-%d" can be used to
> >>
> >> distinguish instances. Does it make sense ?
> > That alone does not help. See the 'i2cdetect -l' output of my Renesas
> > board here:
> >
> > i2c-4 i2c             e66d8000.i2c                            I2C adapter
> > i2c-2 i2c             e6510000.i2c                            I2C adapter
> > i2c-7 i2c             e60b0000.i2c                            I2C adapter
> >
> > Notice that the third column carries the base address, so you know which
> > i2c-%d is which physical bus. I don't know if it makes sense in your
> > "virtual" case, but so far it would always print "Virtio I2C Adapter".
> > Maybe it makes sense to add some parent device name, too?
> >
> > And if this is not reasonable, just skip it. As I said, it can be
> > helpful at times, but it is definately not a show stopper.
>
>
> OK. I will add the virtio_device index for this purpose.
> which indicates the unique position on the virtio bus.

Is that position stable across kernel versions? We do have stable naming
for PCI devices and for platform devices that are the parent of a virtio
device, but I would expect the virtio device to be numbered in probe
order instead.

On a related note, we are apparently still missing the bit in the virtio bus
layer that fills in the dev->of_node pointer of the virtio device. Without
this, it is not actually possible to automatically probe i2c devices connected
to a virtio-i2c bus. The same problem came up again with the virtio-gpio
driver that suffers from the same issue.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ