From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Arnd Bergmann" <arnd@kernel.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:42:05 +0300 [thread overview]
Message-ID: <CAHp75VdKn7Sze9HxN0gBgbuQS2K6oB+SQsufw576Rkfg4-osOw@mail.gmail.com> (raw)
In-Reply-To: <20211021043443.snhqpac5ofmxfb7k@vireshk-i7>
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:
> > On Wednesday, October 20, 2021, Viresh Kumar <viresh.kumar@linaro.org>
> > wrote:
...
> > > + case IRQ_TYPE_NONE:
> > > + type = VIRTIO_GPIO_IRQ_TYPE_NONE;
> > > + break;
> >
> > IIRC you add dead code. IRQ framework never calls this if type is not set.
>
> Yes, but it is allowed to call
>
> irq_set_irq_type(irq, IRQ_TYPE_NONE);
>
> and the irq framework won't disallow it AFAICT.
That's true, but how you may end up in this callback with a such?
What the meaning of that call to the user?
...
> > > struct virtio_gpio_config {
> > > __le16 ngpio;
> > > __u8 padding[2];
> > > @@ -44,4 +56,17 @@ struct virtio_gpio_response_get_names {
> > > __u8 value[];
> > > };
> > >
> > > +/* Virtio GPIO IRQ Request / Response */
> > > +struct virtio_gpio_irq_request {
> > > + __le16 gpio;
> > > +};
> > > +
> > > +struct virtio_gpio_irq_response {
> > > + __u8 status;
> > > +};
> > >
> > I’m wondering if those above should be packed.
>
> You are talking about the newly added ones or the ones before ?
>
> In any case, they are all already packed (i.e. they have explicit
> padding wherever required) and properly aligned. Compiler won't add
> any other padding to them.
Is it only for 64-bit to 64-bit communications?
If there is a possibility to have 32-bit to 64-bit or vice versa
communication you have a problem.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-10-21 9:43 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 [this message]
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
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=CAHp75VdKn7Sze9HxN0gBgbuQS2K6oB+SQsufw576Rkfg4-osOw@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=arnd@kernel.org \
--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).