[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a3nH-ixVhyfjRHyj=GHsJ0HYmRYGhTDGMnmy01sKhSJeQ@mail.gmail.com>
Date: Thu, 21 Oct 2021 12:47:44 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Viresh Kumar <viresh.kumar@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Bartosz Golaszewski <brgl@...ev.pl>,
"Enrico Weigelt, metux IT consult" <info@...ux.net>,
Viresh Kumar <vireshk@...nel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Bill Mills <bill.mills@...aro.org>,
Alex Bennée <alex.bennee@...aro.org>,
Cornelia Huck <cohuck@...hat.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
"stratos-dev@...lists.linaro.org" <stratos-dev@...lists.linaro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Marc Zyngier <maz@...nel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH V6] gpio: virtio: Add IRQ support
On Thu, Oct 21, 2021 at 11:58 AM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Thu, Oct 21, 2021 at 12:52 PM Viresh Kumar <viresh.kumar@...aro.org> wrote:
> > On 21-10-21, 12:42, Andy Shevchenko wrote:
> > > On Thu, Oct 21, 2021 at 7:34 AM Viresh Kumar <viresh.kumar@...aro.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
Powered by blists - more mailing lists