All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V5 0/2] gpio: Add virtio based driver
@ 2021-08-10 10:25 ` Viresh Kumar
  0 siblings, 0 replies; 17+ messages in thread
From: Viresh Kumar @ 2021-08-10 10:25 UTC (permalink / raw)
  To: Arnd Bergmann, Linus Walleij, Bartosz Golaszewski,
	Enrico Weigelt, metux IT consult, Jason Wang, Michael S. Tsirkin,
	Viresh Kumar
  Cc: Viresh Kumar, Vincent Guittot, Jean-Philippe Brucker, Bill Mills,
	Alex Bennée, Cornelia Huck, Geert Uytterhoeven, stratos-dev,
	linux-kernel, Thomas Gleixner, Marc Zyngier, linux-gpio,
	virtualization

Hello,

This adds Virtio GPIO driver based on the proposed specification [1].

The specification for basic GPIO operations is already reviewed by Linus and
Arnd, while the IRQ stuff is still under discussion and not finalized.

I am sharing the code, so everyone gets more clarity on how it will work
eventually in Linux.

I have tested this patchset with Qemu guest with help of the libgpiod utility.
I have also tested basic handling of interrupts on the guest side. It works as
expected.

The host side virtio-backend isn't ready yet and my tests only tested the flow
control between guest and host, but didn't play with real GPIO pins.  That will
be done once I have a working backend in place (WIP).

V4->V5:
- Use ____cacheline_aligned for buffers.
- Proper locking in place, which avoids the use of work-item for processing
  interrupts.
- Separate callbacks for enable/disable of irqs.
- The irq is disabled at the host only for enable/disable now, instead of
  mask/unmask.
- mask/unmask only control the queuing of buffers now.
- Use handle_level_irq() instead of handle_fasteoi_irq().
- Other minor changes.

V3->V4:
- Lots of changes, as the specification changed too much. Better forget
  everything we have done until now :)

--
Viresh

[1] https://lists.oasis-open.org/archives/virtio-dev/202107/msg00232.html

Viresh Kumar (2):
  gpio: Add virtio-gpio driver
  gpio: virtio: Add IRQ support

 MAINTAINERS                      |   7 +
 drivers/gpio/Kconfig             |  10 +
 drivers/gpio/Makefile            |   1 +
 drivers/gpio/gpio-virtio.c       | 668 +++++++++++++++++++++++++++++++
 include/uapi/linux/virtio_gpio.h |  72 ++++
 5 files changed, 758 insertions(+)
 create mode 100644 drivers/gpio/gpio-virtio.c
 create mode 100644 include/uapi/linux/virtio_gpio.h

-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-08-23  3:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 10:25 [PATCH V5 0/2] gpio: Add virtio based driver Viresh Kumar
2021-08-10 10:25 ` Viresh Kumar
2021-08-10 10:25 ` [PATCH V5 1/2] gpio: Add virtio-gpio driver Viresh Kumar
2021-08-10 10:25   ` Viresh Kumar
2021-08-10 21:01   ` kernel test robot
2021-08-11  3:54     ` Viresh Kumar
2021-08-21 10:08       ` Michael S. Tsirkin
2021-08-23  3:20         ` Viresh Kumar
2021-08-11 12:25   ` Linus Walleij
2021-08-11 12:25     ` Linus Walleij
2021-08-20 23:56   ` kernel test robot
2021-08-10 10:25 ` [PATCH V5 2/2] gpio: virtio: Add IRQ support Viresh Kumar
2021-08-10 10:25   ` Viresh Kumar
2021-08-11 12:28   ` Linus Walleij
2021-08-11 12:28     ` Linus Walleij
2021-08-18 11:00   ` Viresh Kumar
2021-08-18 11:00     ` Viresh Kumar

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.