All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"Enrico Weigelt, metux IT consult" <lkml@metux.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	<virtualization@lists.linux-foundation.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>
Subject: Re: Howto listen to/handle gpio state changes ? Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver
Date: Thu, 10 Dec 2020 15:32:15 +0200	[thread overview]
Message-ID: <3e16d597-d1f6-f054-4523-a7a00c945618@ti.com> (raw)
In-Reply-To: <CAK8P3a30=AcEZAZ2yNUgctj=4YM6FhS1ZXB4ts7a7WV=gBcatA@mail.gmail.com>



On 09/12/2020 22:38, Arnd Bergmann wrote:
> On Wed, Dec 9, 2020 at 9:22 PM Grygorii Strashko
> <grygorii.strashko@ti.com> wrote:
>> On 09/12/2020 14:53, Linus Walleij wrote:
>>> On Wed, Dec 9, 2020 at 12:19 PM Arnd Bergmann <arnd@kernel.org> wrote:
>>>> On Wed, Dec 9, 2020 at 9:51 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>>>>> On Tue, Dec 8, 2020 at 3:07 PM Enrico Weigelt, metux IT consult <lkml@metux.net> wrote:
>>>>
>>>>> What we need to understand is if your new usecase is an outlier
>>>>> so it is simplest modeled by a "mock" irq_chip or we have to design
>>>>> something new altogether like notifications on changes. I suspect
>>>>> irq_chip would be best because all drivers using GPIOs for interrupts
>>>>> are expecting interrupts, and it would be an enormous task to
>>>>> change them all and really annoying to create a new mechanism
>>>>> on the side.
>>>>
>>>> I would expect the platform abstraction to actually be close enough
>>>> to a chained irqchip that it actually works: the notification should
>>>> come in via vring_interrupt(), which is a normal interrupt handler
>>>> that calls vq->vq.callback(), calling generic_handle_irq() (and
>>>> possibly chained_irq_enter()/chained_irq_exit() around it) like the
>>>> other gpio drivers do should just work here I think, and if it did
>>>> not, then I would expect this to be just a bug in the driver rather
>>>> than something missing in the gpio framework.
>>>
>>> Performance/latency-wise that would also be strongly encouraged.
>>>
>>> Tglx isn't super-happy about the chained interrupts at times, as they
>>> can create really nasty bugs, but a pure IRQ in fastpath of some
>>> kinde is preferable and intuitive either way.
>>
>> In my opinion the problem here is that proposed patch somehow describes Front end, but
>> says nothing about Backend and overall design.
>>
>> What is expected to be virtualized? whole GPIO chip? or set of GPIOs from different GPIO chips?
>> Most often nobody want to give Guest access to the whole GPIO chip, so, most probably, smth. similar to
>> GPIO Aggregator will be needed.
> 
> I would argue that it does not matter, the virtual GPIO chip could really
> be anything. Certain functions such as a gpio based keyboard require
> interrupts, so it sounds useful to make them work.

Agree, and my point was not to discard IRQ support, but solve problem step by step.
And existing Back end, in any form, may just help to understand virtio-gpio protocol spec and
identify missed pieces.

For example, should 'Configuration space' specify if IRQs are supported on not?

-- 
Best regards,
grygorii

WARNING: multiple messages have this Message-ID (diff)
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	virtualization@lists.linux-foundation.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	"Enrico Weigelt, metux IT consult" <lkml@metux.net>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-riscv <linux-riscv@lists.infradead.org>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>,
	Jason Wang <jasowang@redhat.com>
Subject: Re: Howto listen to/handle gpio state changes ? Re: [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver
Date: Thu, 10 Dec 2020 15:32:15 +0200	[thread overview]
Message-ID: <3e16d597-d1f6-f054-4523-a7a00c945618@ti.com> (raw)
In-Reply-To: <CAK8P3a30=AcEZAZ2yNUgctj=4YM6FhS1ZXB4ts7a7WV=gBcatA@mail.gmail.com>



On 09/12/2020 22:38, Arnd Bergmann wrote:
> On Wed, Dec 9, 2020 at 9:22 PM Grygorii Strashko
> <grygorii.strashko@ti.com> wrote:
>> On 09/12/2020 14:53, Linus Walleij wrote:
>>> On Wed, Dec 9, 2020 at 12:19 PM Arnd Bergmann <arnd@kernel.org> wrote:
>>>> On Wed, Dec 9, 2020 at 9:51 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>>>>> On Tue, Dec 8, 2020 at 3:07 PM Enrico Weigelt, metux IT consult <lkml@metux.net> wrote:
>>>>
>>>>> What we need to understand is if your new usecase is an outlier
>>>>> so it is simplest modeled by a "mock" irq_chip or we have to design
>>>>> something new altogether like notifications on changes. I suspect
>>>>> irq_chip would be best because all drivers using GPIOs for interrupts
>>>>> are expecting interrupts, and it would be an enormous task to
>>>>> change them all and really annoying to create a new mechanism
>>>>> on the side.
>>>>
>>>> I would expect the platform abstraction to actually be close enough
>>>> to a chained irqchip that it actually works: the notification should
>>>> come in via vring_interrupt(), which is a normal interrupt handler
>>>> that calls vq->vq.callback(), calling generic_handle_irq() (and
>>>> possibly chained_irq_enter()/chained_irq_exit() around it) like the
>>>> other gpio drivers do should just work here I think, and if it did
>>>> not, then I would expect this to be just a bug in the driver rather
>>>> than something missing in the gpio framework.
>>>
>>> Performance/latency-wise that would also be strongly encouraged.
>>>
>>> Tglx isn't super-happy about the chained interrupts at times, as they
>>> can create really nasty bugs, but a pure IRQ in fastpath of some
>>> kinde is preferable and intuitive either way.
>>
>> In my opinion the problem here is that proposed patch somehow describes Front end, but
>> says nothing about Backend and overall design.
>>
>> What is expected to be virtualized? whole GPIO chip? or set of GPIOs from different GPIO chips?
>> Most often nobody want to give Guest access to the whole GPIO chip, so, most probably, smth. similar to
>> GPIO Aggregator will be needed.
> 
> I would argue that it does not matter, the virtual GPIO chip could really
> be anything. Certain functions such as a gpio based keyboard require
> interrupts, so it sounds useful to make them work.

Agree, and my point was not to discard IRQ support, but solve problem step by step.
And existing Back end, in any form, may just help to understand virtio-gpio protocol spec and
identify missed pieces.

For example, should 'Configuration space' specify if IRQs are supported on not?

-- 
Best regards,
grygorii

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2020-12-10 13:34 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 19:11 [PATCH v2 1/2] drivers: gpio: put virtual gpio device into their own submenu Enrico Weigelt, metux IT consult
2020-12-03 19:11 ` Enrico Weigelt, metux IT consult
2020-12-03 19:11 ` [PATCH v2 2/2] drivers: gpio: add virtio-gpio guest driver Enrico Weigelt, metux IT consult
2020-12-03 19:11   ` Enrico Weigelt, metux IT consult
2020-12-04  3:35   ` Jason Wang
2020-12-04  3:35     ` Jason Wang
2020-12-04  3:35     ` Jason Wang
2020-12-04  9:36     ` Enrico Weigelt, metux IT consult
2020-12-04  9:36       ` Enrico Weigelt, metux IT consult
2020-12-07  3:48       ` Jason Wang
2020-12-07  3:48         ` Jason Wang
2020-12-07  3:48         ` Jason Wang
2020-12-07  9:33         ` Enrico Weigelt, metux IT consult
2020-12-07  9:33           ` Enrico Weigelt, metux IT consult
2020-12-08  2:49           ` Jason Wang
2020-12-08  2:49             ` Jason Wang
2020-12-08  2:49             ` Jason Wang
2021-04-13 11:07       ` Alex Bennée
2021-04-13 11:07         ` Alex Bennée
2021-04-13 11:07         ` Alex Bennée
2020-12-05  7:59     ` Enrico Weigelt, metux IT consult
2020-12-05  7:59       ` Enrico Weigelt, metux IT consult
2020-12-05 19:32       ` Michael S. Tsirkin
2020-12-05 19:32         ` Michael S. Tsirkin
2020-12-05 19:32         ` Michael S. Tsirkin
2020-12-05 20:05         ` Enrico Weigelt, metux IT consult
2020-12-05 20:05           ` Enrico Weigelt, metux IT consult
2020-12-07  3:16           ` Jason Wang
2020-12-07  3:16             ` Jason Wang
2020-12-07  3:16             ` Jason Wang
2020-12-07 13:52           ` Michael S. Tsirkin
2020-12-07 13:52             ` Michael S. Tsirkin
2020-12-07 13:52             ` Michael S. Tsirkin
2020-12-07 20:34             ` Enrico Weigelt, metux IT consult
2020-12-07 20:34               ` Enrico Weigelt, metux IT consult
2020-12-07  3:12         ` Jason Wang
2020-12-07  3:12           ` Jason Wang
2020-12-07  3:12           ` Jason Wang
2020-12-07 13:53           ` Michael S. Tsirkin
2020-12-07 13:53             ` Michael S. Tsirkin
2020-12-07 13:53             ` Michael S. Tsirkin
2020-12-08  2:36             ` Jason Wang
2020-12-08  2:36               ` Jason Wang
2020-12-08  2:36               ` Jason Wang
2020-12-08  7:02               ` Enrico Weigelt, metux IT consult
2020-12-08  7:02                 ` Enrico Weigelt, metux IT consult
2020-12-09  9:31                 ` Jason Wang
2020-12-09  9:31                   ` Jason Wang
2020-12-09  9:31                   ` Jason Wang
2020-12-09 10:33                   ` Enrico Weigelt, metux IT consult
2020-12-09 10:33                     ` Enrico Weigelt, metux IT consult
2020-12-08 10:10         ` Michal Suchánek
2020-12-08 10:10           ` Michal Suchánek
2020-12-08 12:33           ` Enrico Weigelt, metux IT consult
2020-12-08 12:33             ` Enrico Weigelt, metux IT consult
2020-12-09 10:34             ` Michal Suchánek
2020-12-09 10:34               ` Michal Suchánek
2020-12-05 20:15   ` Howto listen to/handle gpio state changes ? " Enrico Weigelt, metux IT consult
2020-12-05 20:15     ` Enrico Weigelt, metux IT consult
2020-12-08  9:38     ` Linus Walleij
2020-12-08  9:38       ` Linus Walleij
2020-12-08  9:38       ` Linus Walleij
2020-12-08 14:04       ` Enrico Weigelt, metux IT consult
2020-12-08 14:04         ` Enrico Weigelt, metux IT consult
2020-12-08 16:15         ` Grygorii Strashko
2020-12-08 16:15           ` Grygorii Strashko
2020-12-09  8:51         ` Linus Walleij
2020-12-09  8:51           ` Linus Walleij
2020-12-09  8:51           ` Linus Walleij
2020-12-09 11:19           ` Arnd Bergmann
2020-12-09 11:19             ` Arnd Bergmann
2020-12-09 12:53             ` Linus Walleij
2020-12-09 12:53               ` Linus Walleij
2020-12-09 12:53               ` Linus Walleij
2020-12-09 20:22               ` Grygorii Strashko
2020-12-09 20:22                 ` Grygorii Strashko
2020-12-09 20:38                 ` Arnd Bergmann
2020-12-09 20:38                   ` Arnd Bergmann
2020-12-10 13:32                   ` Grygorii Strashko [this message]
2020-12-10 13:32                     ` Grygorii Strashko
2021-05-24 11:27   ` Viresh Kumar
2021-05-24 11:27     ` Viresh Kumar
2021-05-25 12:59     ` Enrico Weigelt, metux IT consult
2021-05-25 12:59       ` Enrico Weigelt, metux IT consult
2021-05-26  3:32       ` Viresh Kumar
2021-05-26  3:32         ` Viresh Kumar
2021-07-03  8:05         ` Michael S. Tsirkin
2021-07-03  8:05           ` Michael S. Tsirkin
2021-07-03  8:05           ` Michael S. Tsirkin
2021-07-05  3:51           ` Viresh Kumar
2021-07-05  3:51             ` Viresh Kumar
2021-07-05  3:51             ` Viresh Kumar
2020-12-07  9:55 ` [PATCH v2 1/2] drivers: gpio: put virtual gpio device into their own submenu Andy Shevchenko
2020-12-07  9:55   ` Andy Shevchenko
2020-12-07  9:55   ` Andy Shevchenko
2020-12-07 10:31 ` Bartosz Golaszewski
2020-12-07 10:31   ` Bartosz Golaszewski
2020-12-07 11:22   ` Enrico Weigelt, metux IT consult
2020-12-07 11:22     ` Enrico Weigelt, metux IT consult

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=3e16d597-d1f6-f054-4523-a7a00c945618@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=arnd@kernel.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=corbet@lwn.net \
    --cc=info@metux.net \
    --cc=jasowang@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkml@metux.net \
    --cc=mst@redhat.com \
    --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 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.