All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Jason Wang" <jasowang@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Arnd Bergmann" <arnd@kernel.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: Fri, 16 Jul 2021 21:11:41 +0530	[thread overview]
Message-ID: <CAKohpo=G9x-UidowU5dBkcLKVNcR40xiL2SDoaTTO3b+Si7b2Q@mail.gmail.com> (raw)
In-Reply-To: <20210716111916-mutt-send-email-mst@kernel.org>

On Fri, 16 Jul 2021 at 20:52, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Fri, Jul 16, 2021 at 01:09:18PM +0530, Viresh Kumar wrote:
> > +\begin{lstlisting}
> > +struct virtio_gpio_config {
> > +    u8 name[32];
> > +    le16 ngpio;
> > +    le16 names_offset;
> > +    le32 names_size;
> > +
> > +    /* at offset defined by names_offset field */
> > +    u8 gpio_names[];
> > +};
> > +\end{lstlisting}
> > +
> > +\item[\field{gpio_names}] field is optional for a device to implement. If this
> > +    field isn't implemented by the device, then the device must set the
> > +    \field{names_size} field to zero. If this field is implemented by the
> > +    device, then it must contain a stream of \field{ngpio} zero-terminated
> > +    strings, where each string represents the name of a GPIO line, present in
> > +    increasing order of the GPIO line numbers. The GPIO line names must
> > +    be unique within a GPIO Device and must not be empty string.
> > +
> > +\end{description}
>
> There's a problem with this approach: config space size is
> actually pretty limited since it might be in the IO space
> when using PCI. That is turn is recommended not to exceed 256 bytes.

Hmm, interesting. This block of data, for gpio names, can be really
large as well,
lets say if we have 256 GPIOs with each requiring 10 bytes for name,
its over 2KB.

Yeah, that can't go with the config structure then.

> Is it important to have the names accessible before driver
> is fully initialized?

Not really.

> If not I would just create a VQ and use that to retrieve this data.

For example in Linux we need this information before the
GPIO device is registered with the framework and we can fetch data
over virtio there.

> Note: the competing virtio-gpio proposal on list shares the issue.

Right.

Thanks Michael for your feedback.

--
viresh


  reply	other threads:[~2021-07-16 15:41 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
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 [this message]
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='CAKohpo=G9x-UidowU5dBkcLKVNcR40xiL2SDoaTTO3b+Si7b2Q@mail.gmail.com' \
    --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.