All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco Valla <francesco@valla.it>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Haixu Cui" <quic_haixcui@quicinc.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Viresh Kumar" <viresh.kumar@linaro.org>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, virtualization@lists.linux.dev
Subject: Re: [PATCH 1/2] dt-bindings: spi: add bindings for spi-virtio
Date: Wed, 30 Sep 2026 18:22:03 +0200	[thread overview]
Message-ID: <ar0yXZotiVZmNJQw@bywater> (raw)
In-Reply-To: <20260930-arcane-pheasant-of-infinity-ecff83@quoll>

Hello Krzysztof,

On Wed, Sep 30, 2026 at 02:03:17PM +0200, Krzysztof Kozlowski wrote:
> On Tue, Sep 29, 2026 at 06:41:55PM +0200, Francesco Valla wrote:
> > Add bindings for spi-virtio based on virtio-device, reflecting what
> > already exists for gpio-virtio and i2c-virtio. A node using the bindings
> 
> Existing code is not a reason to add more code. Existing bugs are not a
> reason to add more bugs. Please provide proper rationale why this suits
> DT.
> 

When a non-discoverable bus (SPI in this case, but that's true also for
e.g. the I2C and GPIO cases I mentioned) made available by a virtio
transport is registered, the devicetree can be used to declare its child
devices (if any) and/or other properties (say,i GPIOs tied to CS lines
for the SPI usecase).

The virtio framework already searches for a node with a suitable
compatible when registering a device [1]; this binding is thus not
introducing a new functionality, but allowing proper validation of
nodes tied to spi-virtio devices.

> > is not used to instantiate the device, which is registered by the
> > transport (e.g.: virtio-mmio), but to define its properties and
> > establish dependencies with other nodes.
> > 
> > Add the new bindings inside the MAINTAINERS file.
> > 
> > Signed-off-by: Francesco Valla <francesco@valla.it>
> > ---
> >  .../devicetree/bindings/spi/spi-virtio.yaml        | 53 ++++++++++++++++++++++
> >  MAINTAINERS                                        |  1 +
> >  2 files changed, 54 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-virtio.yaml b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
> > new file mode 100644
> > index 000000000000..5b8639dd2e1f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
> > @@ -0,0 +1,53 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/spi/spi-virtio.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Virtio SPI controller device
> > +
> > +maintainers:
> > +  - Francesco Valla <francesco@valla.it>
> > +
> > +allOf:
> > +  - $ref: /schemas/spi/spi-controller.yaml#
> > +  - $ref: /schemas/virtio/virtio-device.yaml#
> > +
> > +description:
> > +  Virtio SPI controller device, see /schemas/virtio/virtio-device.yaml for
> > +  more details.
> > +
> > +properties:
> > +  $nodename:
> > +    const: spi
> > +
> > +  compatible:
> > +    const: virtio,device2d
> 
> From where does the compatible come from?
>

This is the compatible the virtio framework is expecting [1]; '2d' is the
hexadecimal representation of 45, which is the virtio identifier for a
SPI device [2].

> Best regards,
> Krzysztof
>

Thank you

Regards,
Francesco

[1] https://elixir.bootlin.com/linux/v7.2.8/source/drivers/virtio/virtio.c#L488
[2] https://docs.oasis-open.org/virtio/virtio/v1.4/virtio-v1.4.html @ 5.21.1



  reply	other threads:[~2026-09-30 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 16:41 [PATCH 0/2] Add devicetree bindings for spi-virtio Francesco Valla
2026-09-29 16:41 ` [PATCH 1/2] dt-bindings: spi: add " Francesco Valla
2026-09-29 16:50   ` sashiko-bot
2026-09-30  6:19     ` Francesco Valla
2026-09-30 12:03   ` Krzysztof Kozlowski
2026-09-30 16:22     ` Francesco Valla [this message]
2026-09-29 16:41 ` [PATCH 2/2] MAINTAINERS: add Francesco as spi-virtio reviewer Francesco Valla
2026-09-30 11:58 ` [PATCH 0/2] Add devicetree bindings for spi-virtio Krzysztof Kozlowski
2026-09-30 16:01   ` Francesco Valla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ar0yXZotiVZmNJQw@bywater \
    --to=francesco@valla.it \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eperezma@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=quic_haixcui@quicinc.com \
    --cc=robh@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.