All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Jason Wang" <jasowang@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Jean-Philippe Brucker" <jean-philippe@linaro.org>,
	"Bill Mills" <bill.mills@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>,
	virtio-dev@lists.oasis-open.org,
	"Geert Uytterhoeven" <geert@linux-m68k.org>
Subject: Re: [PATCH V5 1/2] virtio-gpio: Add the device specification
Date: Mon, 19 Jul 2021 16:20:41 +0530	[thread overview]
Message-ID: <20210719105041.4rn2opwhrisxtglu@vireshk-i7> (raw)
In-Reply-To: <CAK8P3a1G-vUXeVB45e5EJvqfuSKxwZ1Zt2xxWAo6z1ZQPPCPrw@mail.gmail.com>

On 19-07-21, 12:40, Arnd Bergmann wrote:
> I still don't see it as an important enough part of the interface to be encoded
> in the virtio spec. In the most likely use cases I can think of, you would never
> need more than one gpio controller in a virtio machine, since you can have
> an arbitrary number of lines connected to it already.
> 
> This also simplifies the host side, as it avoids requiring the host to configure
> a name that ends up being the same almost always.
> 
> If Linus or Bartosz think we should have the name, leave it in there, otherwise
> I'd remove it.

I don't have a really good argument for keeping it, dropping it for now unless
someone thinks it is important. :)

> Encoding the number of gpio lines in the config registers makes sense to me,
> but I don't see how you can sensibly get away without some other structure
> to describe what the lines are. It doesn't have to be DT, but that's what we use
> in practice.

Yes, we normally end up defining them in DT via "gpio-line-names" binding, but I
think it would be better to get them over the protocol instead here as this
should be self sufficient. Something like DT will still be required to link
users to the GPIO device, and that's outside of the scope of the protocol, so DT
works well there.

> > That may not always work and this count of refcounting at the backend daemon may
> > not be correct.
> >
> > So, the guest calls set-direction-out-with-val-1, the backend activates the GPIO
> > pin, sets direction/value and then deactivates it ? That won't work, right ?
> >
> > On those lines, I think these operations must be renamed to ACTIVATE/DEACTIVATE
> > instead of REQUEST/FREE, that is what we want to do here.
> 
> From the drivers you pointed to,

There were more, I just didn't get to them :)

> it seems to be something like a 'disconnected'
> state where the pin is neither input nor output, so this could perhaps
> get reflected
> in the interface as well, by having each pin be one of IN/OUT/NONE. Not sure
> if that is any better.

I think keeping APIs like ACTIVATE/DEACTIVATE makes it cleaner, than adding
another state of the PIN itself.

-- 
viresh


  reply	other threads:[~2021-07-19 10:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16  7:39 [PATCH V5 0/2] virtio: Add specification for virtio-gpio Viresh Kumar
2021-07-16  7:39 ` [PATCH V5 1/2] virtio-gpio: Add the device specification Viresh Kumar
2021-07-16  8:23   ` Arnd Bergmann
2021-07-16 16:26     ` Viresh Kumar
2021-07-16 18:20       ` Arnd Bergmann
2021-07-19  9:29         ` Viresh Kumar
2021-07-19 10:40           ` [virtio-dev] " Arnd Bergmann
2021-07-19 10:50             ` Viresh Kumar [this message]
2021-07-19 11:48             ` Geert Uytterhoeven
2021-07-19  7:32       ` Viresh Kumar
2021-07-16  9:13   ` Geert Uytterhoeven
2021-07-16 15:43     ` Viresh Kumar
2021-07-16 15:22   ` Michael S. Tsirkin
2021-07-16 15:41     ` Viresh Kumar
2021-07-16  7:39 ` [virtio-dev] [PATCH V5 2/2] virtio-gpio: Add support for interrupts Viresh Kumar
2021-07-16  9:02   ` Arnd Bergmann
2021-07-16 15:17     ` [virtio-dev] " Viresh Kumar
2021-07-16 16:19       ` Arnd Bergmann
2021-07-16 16:50         ` Viresh Kumar
2021-07-16 18:49           ` Arnd Bergmann
2021-07-20  5:47             ` Viresh Kumar
2021-07-20  7:01               ` Arnd Bergmann
2021-07-20  7:11                 ` Viresh Kumar
2021-07-20  7:22                   ` Arnd Bergmann
2021-07-19 10:24   ` Viresh Kumar
2021-07-19 12:00     ` Arnd Bergmann
2021-07-20  6:11       ` Viresh Kumar
2021-07-20  7:17         ` Arnd Bergmann
2021-07-20  7:53           ` Viresh Kumar
2021-07-20  8:10             ` Arnd Bergmann
2021-07-20  8:42               ` Viresh Kumar
2021-07-20  9:50             ` Michael S. Tsirkin
2021-07-19 15:11     ` Michael S. Tsirkin
2021-07-20  4:19       ` Viresh Kumar
2021-07-16  9:57 ` [PATCH V5 0/2] virtio: Add specification for virtio-gpio Arnd Bergmann
2021-07-16 16:57   ` Viresh Kumar

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=20210719105041.4rn2opwhrisxtglu@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=arnd@kernel.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=bill.mills@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=info@metux.net \
    --cc=jasowang@redhat.com \
    --cc=jean-philippe@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=mst@redhat.com \
    --cc=vincent.guittot@linaro.org \
    --cc=virtio-dev@lists.oasis-open.org \
    /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.