Received: by 2002:a9a:4c47:0:b029:116:c383:538 with SMTP id u7csp903359lko; Tue, 13 Jul 2021 12:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyew3OPrfN7hxNgxh0M5/Uz5iahKO7GSM1A9DZqfM1vYabjt8o0tFr3EDWPuCCAN+OhJqer X-Received: by 2002:a17:906:2642:: with SMTP id i2mr7707090ejc.323.1626204958629; Tue, 13 Jul 2021 12:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626204958; cv=none; d=google.com; s=arc-20160816; b=kv51OG20UVggvz+mqRoBlQY//D1i/UxZonmgC6ZgZuFeMc/xmF8gl2oFdguRhfULVC clVgHlkrOhjk+MYp09LHMNAQssJP7CE0JETvC/oJC0SuQv64ukib7j8jP2j3QBLkAF45 JbH6B5zYsQooo3whhCqBD2G7Qs/tFMuojrp6sxIh28eZE+K5OmQw1auMQgKaRPDsT6q9 1X1Svl0nI3PjxhXs0ef0aBel+WBuOuUbOUl6cdNCTnIdhqVBt+VQkB+Y1d2vfYqttJmE dgYoNqsMXKlGmBTyO2xP9y160nePq1/9G5Y8qt3AmJdM8Zw6NREXab+EkoZolwizp2rN fPyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=q6UBDjtaa8NUUdqWJxCHFB88WzEYVPE9y9bs3xKd6rM=; b=f3TWRFlsFc1eKfXkduhguhkMF0NhHKvMyjVjDKpxFg4rAHWVJKu1dPt8SH1vLOdHZB OsuKwuDE6uvMjPdTKtvWwqbDvXLabtT/JHGzC6/PvCcyAMmm2KMEa2QH+aZk8XprOqM0 MjzA03LvsI/M1iDPGPPozT9Ijr70kLT/CGA1q2hG7DN4z7zGF0UlJbEWg0ChUbPe9ExU hDYzoJxi0eo4gwYFKoox/KSXI9bmxiVYr7r+jWZr4PmB8jbwQm/RfEPMmp6HZIRsPvCA 1LF8m9u+1YgJGpuYbwRDp71lhcBgMXtKZECsGovDXk2Uu6s6gy+1E0fqAfQ5hU1tjFQu ULOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ix5wiJ0H; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si22107080edr.480.2021.07.13.12.35.36; Tue, 13 Jul 2021 12:35:58 -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=@kernel.org header.s=k20201202 header.b=ix5wiJ0H; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234792AbhGMThK (ORCPT + 99 others); Tue, 13 Jul 2021 15:37:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:42416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234411AbhGMThK (ORCPT ); Tue, 13 Jul 2021 15:37:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7A2D61362; Tue, 13 Jul 2021 19:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626204859; bh=q6UBDjtaa8NUUdqWJxCHFB88WzEYVPE9y9bs3xKd6rM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ix5wiJ0HBk1YpblazcZQ+oZzQ5JDBdl1e/ybkWlgcFqiq1b2ltmPmycs8KeLf3mgz ufdIv0JRv2ydfYiJVA5eqos0X88dphEFoZnIW/JUiRgjM7b2FhF2LDjrzxz06gslA8 B8pF7NznuJCpLbwPEpulEQp1OpBCmpLBw+29OmU7ADW0xDBId+X+t2SnXijk8KUWqI 3tqElFfqZ5huNr9tI6e3Kx9HIHDoDhOnQYZo0zEGrp6BBTK47ARG/7CuaO8pPsRX82 u3/xU8wqO+l8m2eShd26LbI2PAnArSiMZWzqxrghZK7e7YT8DBgFZIY0tHYtdEk5z2 vFTo27NYlmv5g== Received: by mail-ej1-f48.google.com with SMTP id hc15so5019873ejc.4; Tue, 13 Jul 2021 12:34:19 -0700 (PDT) X-Gm-Message-State: AOAM532seLs9amzSIPddZavb03KUCInoBqaRyuCu9yCi8Kam1tjTDQfp 4mYuVKCvEyYqderLAgPFr6CPoC++iuiApdn0Bg== X-Received: by 2002:a17:906:57d0:: with SMTP id u16mr7823954ejr.468.1626204858178; Tue, 13 Jul 2021 12:34:18 -0700 (PDT) MIME-Version: 1.0 References: <20210713151917.zouwfckidnjxvohn@vireshk-i7> In-Reply-To: <20210713151917.zouwfckidnjxvohn@vireshk-i7> From: Rob Herring Date: Tue, 13 Jul 2021 13:34:05 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] dt-bindings: virtio: mmio: Add support for device subnode To: Viresh Kumar Cc: Jason Wang , "Michael S. Tsirkin" , Arnd Bergmann , Jean-Philippe Brucker , Vincent Guittot , Bill Mills , =?UTF-8?B?QWxleCBCZW5uw6ll?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 13, 2021 at 9:19 AM Viresh Kumar wrote: > > On 13-07-21, 08:43, Rob Herring wrote: > > On Tue, Jul 13, 2021 at 4:50 AM Viresh Kumar wrote: > > > > > > Allow virtio,mmio nodes to contain device specific subnodes. Since each > > > virtio,mmio node can represent a single virtio device, each virtio node > > > is allowed to contain a maximum of one device specific subnode. > > > > Doesn't sound like we need 2 nodes here. Just add I2C devices as child > > nodes. You could add a more specific compatible string, but the > > protocol is discoverable, so that shouldn't be necessary. > > I am not sure if it will be a problem, but you can clarify it better. > > The parent node (virtio,mmio) is used to create a platform device, > virtio-mmio, (and so assigned as its of_node) and we create the > virtio-device from probe() of this virtio-mmio device. > > Is it going to be a problem if two devices in kernel use the same > of_node ? There shouldn't be. We have nodes be multiple providers (e.g clocks and resets) already. > Are there cases where we would need to get the device > pointer from the of_node ? Then we will have two here. Rarely... In any case, should these potential kernel issues be dictating the DT binding design? No! > > > BTW, what's the usecase for these protocols? A standard interface to > > firmware controlled I2C, GPIO, etc.? > > Right now we are looking to control devices in the host machine from > guests. That's what Linaro's project stratos is doing. There are other > people who want to use this for other kind of remote control stuff, > maybe from firmware. Project stratos means nothing to me. Direct userspace access to I2C, GPIO, etc. has its issues, we're going to repeat that with guests? > > > diff --git a/include/dt-bindings/virtio/virtio_ids.h b/include/dt-bindings/virtio/virtio_ids.h > > > new file mode 120000 > > > index 000000000000..6e59ba332216 > > > --- /dev/null > > > +++ b/include/dt-bindings/virtio/virtio_ids.h > > > @@ -0,0 +1 @@ > > > +../../uapi/linux/virtio_ids.h > > > > This will break the devicetree-rebasing tree I think. DT files > > shouldn't reference kernel files. > > We already do this for linux-event-codes.h and so I thought it is the > right way of doing it :) Humm, maybe it's okay. Please double check then... > Else we can create a new copy, which will be a mess, or use hardcoded > values. Though you may not need the header based on what Arnd and I have suggested. Rob