From: Arnd Bergmann <arnd@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Viresh Kumar" <viresh.kumar@linaro.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Enrico Weigelt, metux IT consult" <info@metux.net>,
"Viresh Kumar" <vireshk@kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.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>,
"Cornelia Huck" <cohuck@redhat.com>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"stratos-dev@op-lists.linaro.org"
<stratos-dev@op-lists.linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Marc Zyngier" <maz@kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH V6] gpio: virtio: Add IRQ support
Date: Thu, 21 Oct 2021 12:47:44 +0200 [thread overview]
Message-ID: <CAK8P3a3nH-ixVhyfjRHyj=GHsJ0HYmRYGhTDGMnmy01sKhSJeQ@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VcBowxFoseXKwU2VjNcu75ttvHW_sno9MihHL88+oP1ew@mail.gmail.com>
On Thu, Oct 21, 2021 at 11:58 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Oct 21, 2021 at 12:52 PM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > On 21-10-21, 12:42, Andy Shevchenko wrote:
> > > On Thu, Oct 21, 2021 at 7:34 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > > > On 20-10-21, 18:10, Andy Shevchenko wrote:
> >
> > > If there is a possibility to have 32-bit to 64-bit or vice versa
> > > communication you have a problem.
> >
> > This should work as well.
> >
> > The structure will get aligned to the size of largest element and each
> > element will be aligned to itself. I don't see how this will break
> > even in case of 32/64 bit communication.
>
> I admit I haven't looked into the specification, but in the past we
> had had quite an issue exactly in GPIO on kernel side because of this
> kind of design mistake. The problem here if in the future one wants to
> supply more than one item at a time, it will be not possible with this
> interface. Yes, I understand that in current design it's rather missed
> scalability, but hey, I believe in the future we may need
> performance-wise calls.
In my experience, adding __packed to structures causes more problems
than it solves, please don't do that.
The rules for the virtio structures should be roughly the same that I
documented in Documentation/driver-api/ioctl.rst, and the layout that
Viresh has picked does not suffer from any of the common issues
that are listed there.
Arnd
next prev parent reply other threads:[~2021-10-21 10:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 10:05 [PATCH V6] gpio: virtio: Add IRQ support Viresh Kumar
[not found] ` <CAHp75Vctj-v8W+LgdVpYgRVL3fLdcFnOFRFg74LeCc=xLD+w4w@mail.gmail.com>
2021-10-21 4:34 ` Viresh Kumar
2021-10-21 9:42 ` Andy Shevchenko
2021-10-21 9:52 ` Viresh Kumar
2021-10-21 9:58 ` Andy Shevchenko
2021-10-21 10:02 ` Viresh Kumar
2021-10-21 10:47 ` Arnd Bergmann [this message]
2021-10-21 10:07 ` Geert Uytterhoeven
2021-10-21 10:49 ` Viresh Kumar
2021-10-21 11:02 ` Geert Uytterhoeven
2021-10-21 11:04 ` 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='CAK8P3a3nH-ixVhyfjRHyj=GHsJ0HYmRYGhTDGMnmy01sKhSJeQ@mail.gmail.com' \
--to=arnd@kernel.org \
--cc=alex.bennee@linaro.org \
--cc=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=bill.mills@linaro.org \
--cc=brgl@bgdev.pl \
--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=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mst@redhat.com \
--cc=stratos-dev@op-lists.linaro.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=vireshk@kernel.org \
--cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).