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] [day] [month] [year] [list]
Date:   Thu, 10 Jun 2021 21:41:01 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Jean-Philippe Brucker <jean-philippe@...aro.org>
Cc:     "Enrico Weigelt, metux IT consult" <lkml@...ux.net>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Stefan Hajnoczi <stefanha@...hat.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Viresh Kumar <vireshk@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        virtualization@...ts.linux-foundation.org,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        "Stefano Garzarella --cc virtualization @ lists . linux-foundation . org" 
        <sgarzare@...hat.com>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Stratos Mailing List <stratos-dev@...lists.linaro.org>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        Jason Wang <jasowang@...hat.com>
Subject: Re: [Stratos-dev] [PATCH V3 1/3] gpio: Add virtio-gpio driver

On Thu, Jun 10, 2021 at 7:03 PM Jean-Philippe Brucker
<jean-philippe@...aro.org> wrote:
>
> On Thu, Jun 10, 2021 at 04:00:39PM +0000, Enrico Weigelt, metux IT consult via Stratos-dev wrote:
> > On 10.06.21 15:22, Arnd Bergmann wrote:
> >
> > > Can you give an example of how this would be hooked up to other drivers
> > > using those gpios. Can you give an example of how using the "gpio-keys" or
> > > "gpio-leds" drivers in combination with virtio-gpio looks like in the DT?
> >
> > Connecting between self-probing bus'es and DT is generally tricky. IMHO
> > we don't have any generic mechanism for that.
>
> DT does have a generic description of PCI endpoints, which virtio-iommu
> relies on to express the relation between IOMMU and endpoint nodes [1].
> I think the problem here is similar: the client node needs a phandle to
> the GPIO controller which may use virtio-pci transport?

Right, the code to set dev->of_node is fairly simple, the device probe
just needs to scan for child nodes. Aside from PCI, similar code exists
for USB and MMC/SDIO, which are usually discoverable but sometimes
need additional properties.

> Note that it mostly works if the device is on the root PCI bus. Behind a
> bridge the OS may change the device's bus number as needed, so the BDF
> reference in DT is only valid if the software providing the DT description
> (VMM or firmware) initializes bus numbers accordingly (and I don't
> remember if Linux supports this case well).

I think you can mark the host bridge as "probe-only" to prevent the OS
(at least Linux) from renumbering the buses.

The part I did not find though is assigning dev->of_node in the virtio_device
to a child of the PCI device node.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ