Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp682608pxj; Thu, 10 Jun 2021 10:07:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5+VUWsgLOqTVEJ+9fWayN6ZAUC31+EG4Ses0QjKOZ8m5eomz0t+EErZJilPhJWX2UVBVg X-Received: by 2002:a17:906:1912:: with SMTP id a18mr582976eje.117.1623344846883; Thu, 10 Jun 2021 10:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623344846; cv=none; d=google.com; s=arc-20160816; b=bhxU5B+cx/510nP5AzHUmuKK4cTK5J7lEsgGnHd1sQOXXKBAYG26aJPxHHlSDBmoTM jVIxuxsSucibaBHpcx9OyRZjDrA4qx33UOkCPIc3jgDLZX7U41Gn2hWl7lAiNIZNVt8C PbBFmbk4vbrcOPQcEZnpuG71wBqZANkxsjFo13ggU/MuDLjpNzVwVD0rOzosHCfqh7QO sSTFFBJ+M7S38EFkpMurq6DrUHRBq4IExAxFGbInBpQVBm2KdgsATekIQ9cV6zFNzUZs nCkUM92uIC760YRViNqlm7zr6UTy9EXFpGkzf5B7hueto2pq/WuGe2/pT+N6287Co/97 dA4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bXhxyKfILOtbokM8zhO9ev3eR2f27dRG5A7af/C4DQw=; b=B1VPkAAbOau4XC3NeEs19UrkyfsBhR5IN0hUWgkswZ/h8ukMvD6B7LnZCgdQQG6Ypi XuMIia74C71fHb87wSOdmMjzZj0/FMsOCySzAGp/IWSkuNA1fMRICMh1tShBwHQcnsWe BVtY+V/KZbQYCRJbIBCavk0GJkmLWeSm34bRfDdvwy57ISWhw0yH75KrwcOzNKHwxZOF lvPp1DoCoNZ5g/v51kIrvqbVCLiMMKT2Xb1XtOrMgbGKwtuX0Pon5hjz+QMXl0kmC9YT L6b5xA4dHTiqMc5b+80EEGD8qd4Bmq1kX0OVMGwY0R4v/6S7lpFDdVMhwBFE6SfuyShP rQiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DMyaY3PS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si2946507edc.514.2021.06.10.10.07.01; Thu, 10 Jun 2021 10:07:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DMyaY3PS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229802AbhFJRFv (ORCPT + 99 others); Thu, 10 Jun 2021 13:05:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbhFJRFu (ORCPT ); Thu, 10 Jun 2021 13:05:50 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E26D8C061760 for ; Thu, 10 Jun 2021 10:03:53 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id l9so6602763wms.1 for ; Thu, 10 Jun 2021 10:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=bXhxyKfILOtbokM8zhO9ev3eR2f27dRG5A7af/C4DQw=; b=DMyaY3PS/UuBOCcAv0WKwICkJXkmfeM1e89x3xj9HxEmJIz6oMmNdMb5eAxBcJE0Ys bBYF6hJmSOu1r9AXjTt02A+9yWHb2AUNUR5G68af8Izv9M/m9oQ+7um/mBKwUI+Oj8jY uFZavM16DaPHRWGnWxm8xL8lk3c2OR+yJKUuHP6C21C2wlGRBlUfkopWVLIIZeEv9Zoo DuMiThPgXP3rTj7udUcSIJRmiJcB1D3p8tjJvPngix5g94LRqb3vPJubGySqimN2h/qh sthYQNqh7TJB6t+6mhomwCA7RYVht4W0QLKOtvLb4Txkoesmu75s7JE07l+BFw7aq4u8 cDHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=bXhxyKfILOtbokM8zhO9ev3eR2f27dRG5A7af/C4DQw=; b=Pm3BW+m2sIGcPqM0aEla3xQpnVzTKuhgup30LZtNZ6Ps/UxWhsTKr7nl06zf/0UY0T 8o62PTJm4FTC6+RZ1eGVjvOjukSCCtQhHCdnS7ukBiyCU86XTn6kgK5L9KAJzCxwOqN0 fCaJwPJWu4MyJmDPnE3RfZeLkp90YFgLEhhObAzkGEnUKW5Tq2w5IA3nIx8pjWPBuYEB 1klQMtn0VCXyBTzX1robAvTF9qsJVECkaSvpacFLtXHLOMu9MAXGnr7zLC4v9S+apBU7 s9npHhBcRYLSVUKktKNiNAHM1k0lO+9Mxfqf5EaGuhiLcDR0w6rPIKqQkYu8ydJafcr5 N3vw== X-Gm-Message-State: AOAM532L0ipaA3TNXCv54RN5qctgTDtLYsigthCS5MJX3EIrB8giVQOS NfhVlBmlYpYRtDP7YT8ECHA7Rw== X-Received: by 2002:a05:600c:b50:: with SMTP id k16mr6024505wmr.137.1623344632456; Thu, 10 Jun 2021 10:03:52 -0700 (PDT) Received: from myrica (adsl-84-226-111-173.adslplus.ch. [84.226.111.173]) by smtp.gmail.com with ESMTPSA id 4sm3823543wry.74.2021.06.10.10.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 10:03:51 -0700 (PDT) Date: Thu, 10 Jun 2021 19:03:33 +0200 From: Jean-Philippe Brucker To: "Enrico Weigelt, metux IT consult" Cc: Arnd Bergmann , Viresh Kumar , Stefan Hajnoczi , "Michael S. Tsirkin" , Viresh Kumar , Linus Walleij , Linux Kernel Mailing List , virtualization@lists.linux-foundation.org, Bartosz Golaszewski , "Stefano Garzarella --cc virtualization @ lists . linux-foundation . org" , "open list:GPIO SUBSYSTEM" , Stratos Mailing List , "Enrico Weigelt, metux IT consult" , Jason Wang Subject: Re: [Stratos-dev] [PATCH V3 1/3] gpio: Add virtio-gpio driver Message-ID: References: <10442926ae8a65f716bfc23f32339a6b35e51d5a.1623326176.git.viresh.kumar@linaro.org> <01000179f6a7715c-cd106846-7770-4088-bb7c-a696bfcbf83e-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <01000179f6a7715c-cd106846-7770-4088-bb7c-a696bfcbf83e-000000@email.amazonses.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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). Thanks, Jean [1] Documentation/devicetree/bindings/virtio/iommu.txt > > I've made a few attempts, but nothing practically useful, which would be > accepted by the corresponding maintainers, yet. We'd either need some > very special logic in DT probing or pseudo-bus'es for the mapping. > (DT wants to do those connections via phandle's, which in turn need the > referenced nodes to be present in the DT). > > > From what I can tell, both the mmio and pci variants of virtio can have their > > dev->of_node populated, but I don't see the logic in register_virtio_device() > > that looks up the of_node of the virtio_device that the of_gpio code then > > tries to refer to. > > Have you ever successfully bound a virtio device via DT ? > > > --mtx > > -- > --- > Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert > werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren > GPG/PGP-Schlüssel zu. > --- > Enrico Weigelt, metux IT consult > Free software and Linux embedded engineering > info@metux.net -- +49-151-27565287 > -- > Stratos-dev mailing list > Stratos-dev@op-lists.linaro.org > https://op-lists.linaro.org/mailman/listinfo/stratos-dev