Skip to contentSkip to conversation

virtio-gpio: add formal specification

PATCH In review Enrico Weigelt, metux IT consult 5 participants 11 messages Jun 30, 2021 – Jul 14, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 virtio-gpio: add formal specification

This patch adds specification for attaching general purpose IO (gpio) devices via virtio. The protocol is specifically designed to be easily implemented in software (e.g. hypervisors) as well as low end hardware (eg. silicon, FPGA, tiny MCUs) and allows future extensions while retaining full backwards compatibility.

Implementations for driver (Linux kernel) and device (Qemu) are publically available and field tested since late 2020. Hardware implementations also exist (but proprietary, cannot be published yet).

Device type ID 41 has been allocated by TC vote #3632.

---

changes v2: * fixed htlatex build error with underscores in labels
* using code listings for structs and define's
* fixed mixed-up device/driver wording

---
 conformance.tex |  28 +++++-
 content.tex     |   3 +-
 virtio-gpio.tex | 257 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 283 insertions(+), 5 deletions(-)
 create mode 100644 virtio-gpio.tex
conformance.tex +24 -4
index a164cbb..e5956f4 100644
@@ -29,8 +29,9 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \ref{sec:Conformance / Driver Conformance / IOMMU Driver Conformance},
 \ref{sec:Conformance / Driver Conformance / Sound Driver Conformance},
 \ref{sec:Conformance / Driver Conformance / Memory Driver Conformance},
-\ref{sec:Conformance / Driver Conformance / I2C Adapter Driver Conformance} or
-\ref{sec:Conformance / Driver Conformance / SCMI Driver Conformance}.
+\ref{sec:Conformance / Driver Conformance / I2C Adapter Driver Conformance},
+\ref{sec:Conformance / Driver Conformance / SCMI Driver Conformance} or
+\ref{sec:Conformance / Driver Conformance / General Purpose IO Driver Conformance}.
 
     \item Clause \ref{sec:Conformance / Legacy Interface: Transitional Device and Transitional Driver Conformance}.
   \end{itemize}
@@ -52,8 +53,9 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \ref{sec:Conformance / Device Conformance / IOMMU Device Conformance},
 \ref{sec:Conformance / Device Conformance / Sound Device Conformance},
 \ref{sec:Conformance / Device Conformance / Memory Device Conformance},
-\ref{sec:Conformance / Device Conformance / I2C Adapter Device Conformance} or
-\ref{sec:Conformance / Device Conformance / SCMI Device Conformance}.
+\ref{sec:Conformance / Device Conformance / I2C Adapter Device Conformance},
+\ref{sec:Conformance / Device Conformance / SCMI Device Conformance} or
+\ref{sec:Conformance / Device Conformance / General Purpose IO Device Conformance}.
 
     \item Clause \ref{sec:Conformance / Legacy Interface: Transitional Device and Transitional Driver Conformance}.
   \end{itemize}
@@ -288,6 +290,15 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Device Types / SCMI Device / Device Operation / Setting Up eventq Buffers}
 \end{itemize}
 
+\conformance{\subsection}{General Purpose IO Driver Conformance}\label{sec:Conformance / Driver Conformance / General Purpose IO Driver Conformance}
+
+An General Purpose IO driver MUST conform to the following normative statements:
+
+\begin{itemize}
+\item \ref{devicenormative:Device Types / General Purpose IO / Virtqueues}
+\item \ref{devicenormative:Device Types / General Purpose IO / Data flow}
+\end{itemize}
+
 \conformance{\section}{Device Conformance}\label{sec:Conformance / Device Conformance}
 
 A device MUST conform to the following normative statements:
@@ -527,6 +538,15 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Device Types / SCMI Device / Device Operation / Shared Memory Operation}
 \end{itemize}
 
+\conformance{\subsection}{General Purpose IO Device Conformance}\label{sec:Conformance / Device Conformance / General Purpose IO Device Conformance}
+
+An General Purpose IO device MUST conform to the following normative statements:
+
+\begin{itemize}
+\item \ref{devicenormative:Device Types / General Purpose IO / Virtqueues}
+\item \ref{devicenormative:Device Types / General Purpose IO / Data flow}
+\end{itemize}
+
 \conformance{\section}{Legacy Interface: Transitional Device and Transitional Driver Conformance}\label{sec:Conformance / Legacy Interface: Transitional Device and Transitional Driver Conformance}
 A conformant implementation MUST be either transitional or
 non-transitional, see \ref{intro:Legacy
content.tex +2 -1
index 5c70a3c..3e9d1a1 100644
@@ -2876,7 +2876,7 @@ \chapter{Device Types}\label{sec:Device Types}
 \hline
 40         &   Bluetooth device \\
 \hline
-41         &   GPIO device \\
+41         &   General Purpose IO device \\
 \hline
 \end{tabular}
 
@@ -6583,6 +6583,7 @@ \subsubsection{Legacy Interface: Framing Requirements}\label{sec:Device
 \input{virtio-mem.tex}
 \input{virtio-i2c.tex}
 \input{virtio-scmi.tex}
+\input{virtio-gpio.tex}
 
 \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
 
virtio-gpio.tex new file +257 -0

257 lines not on this page · raw message

Signature · 18 lines
2.20.1


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#1 lore raw

+ All the people from previous version (Please cc them yourself while sending a new version, these are the people interested in this stuff).

Quoted 12 lines · metux IT consult

This patch adds specification for attaching general purpose IO (gpio) devices via virtio. The protocol is specifically designed to be easily implemented in software (e.g. hypervisors) as well as low end hardware (eg. silicon, FPGA, tiny MCUs) and allows future extensions while retaining full backwards compatibility.

Implementations for driver (Linux kernel) and device (Qemu) are publically available and field tested since late 2020. Hardware implementations also exist (but proprietary, cannot be published yet).

Device type ID 41 has been allocated by TC vote #3632.

Quoted 7 lines

---

changes v2: * fixed htlatex build error with underscores in labels
* using code listings for structs and define's
* fixed mixed-up device/driver wording

What happened to all the detailed discussions that we went through ? Why did we spend so much time discussing all that when you didn't had to take suggestions from the reviews provided on the list?

This version may be good for you, but not for everyone else. We need a generic enough solution which works seamlessly for everyone involved here. This isn't some proprietary spec which we are working on here, which we can write based only on our needs. The spec to be merged MUST be good enough for everyone.

I was expecting the discussions to go in better direction here to be honest and not have another short lived struggle.

I don't see the improvements suggested for the config structure, nothing about features, no interrupt support. You just reformatted the stuff and that's all.

Signature · 5 lines
viresh

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
#2 lore raw
Quoted 2 lines · Viresh Kumar

+ All the people from previous version (Please cc them yourself while sending a new version, these are the people interested in this stuff).

Phuh, it's hard to track them all. I'm assuming everybody interested in this is already on the list or can easily subscribe :p

Quoted 3 lines

What happened to all the detailed discussions that we went through ? Why did we spend so much time discussing all that when you didn't had to take suggestions from the reviews provided on the list?

Which ones are missing, besides those that we talked about doing as optional feature (like irq controller, etc). Please let's do that in separate rounds - the minimal base spec first, and then add optional features.

Quoted 2 lines

I don't see the improvements suggested for the config structure, nothing about features, no interrupt support. You just reformatted the stuff and that's all.

Don't worry, I haven't forgotten that. But that's something I'd *really* like to have as optional features (so not all hardware is mandated to implement that all) and i'd like to get the mandatory base finished, before specifying the optional features like interrupt controller.

Let's discuss the optional features separately, feel free to share your thoughts here.

--mtx

Signature · 12 lines
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
[email protected] -- +49-151-27565287

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
#3 lore raw
Quoted 3 lines · metux IT consult
Quoted 2 lines · Viresh Kumar

+ All the people from previous version (Please cc them yourself while sending a new version, these are the people interested in this stuff).

Adding them again, not sure why they got dropped after your email.

Quoted 2 lines

Phuh, it's hard to track them all. I'm assuming everybody interested in this is already on the list or can easily subscribe :p

Not necessarily.

I don't expect others, specially the GPIO maintainers or Arnd, to have subscribed to these lists (and many times people try to subscribe to lists with no-email option, so their reply can reach to everyone, while don't want unnecessary emails).

If you are using git to send emails, then an easy way out is to create an alias for GPIO and have all the interested folks in cc.

It is important to keep few of the people in cc list here.

Quoted 8 lines
Quoted 3 lines

What happened to all the detailed discussions that we went through ? Why did we spend so much time discussing all that when you didn't had to take suggestions from the reviews provided on the list?

Which ones are missing, besides those that we talked about doing as optional feature (like irq controller, etc). Please let's do that in separate rounds - the minimal base spec first, and then add optional features.

You must have closed the discussion first in the previous version itself in that case.

Quoted 10 lines
Quoted 2 lines

I don't see the improvements suggested for the config structure, nothing about features, no interrupt support. You just reformatted the stuff and that's all.

Don't worry, I haven't forgotten that. But that's something I'd *really* like to have as optional features (so not all hardware is mandated to implement that all) and i'd like to get the mandatory base finished, before specifying the optional features like interrupt controller.

Let's discuss the optional features separately, feel free to share your thoughts here.

What about the changes to the config structure to make it efficient, easily extendable, etc Or the Free Msg, etc? These views are already shared in details for the earlier version and I shouldn't be expected to explain them again.

Over that, if you don't want to implement interrupts in your version (I can surely send a patch for that), then you need to drop the half-hearted interrupt support, i.e. VIRTIO_GPIO_MSG_DEVICE_LEVEL, as that is not the right way of implementing interrupts. This will make the specification as well as Linux or backend code messy, as we would be required to support interrupts in two ways in this case based on irq-feature. If you want to support interrupts, then you need to do them properly, else don't add them at all.

Please reply to the issues raised in the previous version itself now and close them there. And please don't proceed with a new version unless there is a clear consensus in favor or otherwise. It just ends up wasting a lot of time for everyone.

I asked for a new version today as I expected you to have made all the changes based on suggestions, where you haven't had a last say.

Signature · 17 lines
viresh

This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#4 lore raw
Quoted 7 lines · Viresh Kumar
Quoted 3 lines · metux IT consult
Quoted 2 lines · Viresh Kumar

+ All the people from previous version (Please cc them yourself while sending a new version, these are the people interested in this stuff).

Adding them again, not sure why they got dropped after your email.

Thanks.

Quoted 16 lines
Quoted 10 lines
Quoted 2 lines

I don't see the improvements suggested for the config structure, nothing about features, no interrupt support. You just reformatted the stuff and that's all.

Don't worry, I haven't forgotten that. But that's something I'd *really* like to have as optional features (so not all hardware is mandated to implement that all) and i'd like to get the mandatory base finished, before specifying the optional features like interrupt controller.

Let's discuss the optional features separately, feel free to share your thoughts here.

What about the changes to the config structure to make it efficient, easily extendable, etc Or the Free Msg, etc? These views are already shared in details for the earlier version and I shouldn't be expected to explain them again.

Quoted 8 lines

Over that, if you don't want to implement interrupts in your version (I can surely send a patch for that), then you need to drop the half-hearted interrupt support, i.e. VIRTIO_GPIO_MSG_DEVICE_LEVEL, as that is not the right way of implementing interrupts. This will make the specification as well as Linux or backend code messy, as we would be required to support interrupts in two ways in this case based on irq-feature. If you want to support interrupts, then you need to do them properly, else don't add them at all.

Agreed, interrupt support is obviously something that can not be retrofitted easily if you don't get it right from the start.

Quoted 4 lines

Please reply to the issues raised in the previous version itself now and close them there. And please don't proceed with a new version unless there is a clear consensus in favor or otherwise. It just ends up wasting a lot of time for everyone.

+1

Arnd

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/

#5 lore raw
Quoted 2 lines · Arnd Bergmann

Agreed, interrupt support is obviously something that can not be retrofitted easily if you don't get it right from the start.

It's basically present, the basic version (as now writting in this spec) just can't do hardware masking - that part is planned as an optional feature (which I haven't yet put into that spec version, since I wanted to get the basic version finished up before doing the optional features).

Actually, the optional feature will just add another message for mask/unmask. I'll yet having conversations w/ HW engineers on certain aspects, e.g. automatic masking (yes/no/configurable ?).

There're also other more sophisticated features like HW debounce, pinmux, etc, that are to come later - as *optional* features that some device may or may not support.

Note that this isn't just about moving drivers into some VMM, but also about actual hardware.

--mtx

Signature · 24 lines
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
[email protected] -- +49-151-27565287

This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#6 lore raw
Quoted 10 lines · metux IT consult
Quoted 2 lines · Arnd Bergmann

Agreed, interrupt support is obviously something that can not be retrofitted easily if you don't get it right from the start.

It's basically present, the basic version (as now writting in this spec) just can't do hardware masking - that part is planned as an optional feature (which I haven't yet put into that spec version, since I wanted to get the basic version finished up before doing the optional features).

Finally you called it interrupt :)

Quoted 3 lines

Actually, the optional feature will just add another message for mask/unmask. I'll yet having conversations w/ HW engineers on certain aspects, e.g. automatic masking (yes/no/configurable ?).

An interrupt should never occur unless asked for. Here is an example of how this is BROKEN right now.

Lets say the host passes 32 gpio lines to guest, guest moves them in input mode (some user requested for them) and then frees the gpio lines.

At this point there are no users of the GPIO block in the guest OS, but the virtio traffic will continue for the interrupts, as the host will keep sending the GPIO status changes to the guest.

This is simply BROKEN and NOT acceptable.

If you want to implement interrupts, then add them in a separate feature or just don't. Partial implementations aren't going to work.

I don't really understand what's the big deal about it, though...

Quoted 6 lines

There're also other more sophisticated features like HW debounce, pinmux, etc, that are to come later - as *optional* features that some device may or may not support.

Note that this isn't just about moving drivers into some VMM, but also about actual hardware.

... I do understand why you are so adamant on not changing this. And lemme say this again for clarity.

We are not going to write a new protocol in a BUGGY way, because some existing hardware implements it in a BROKEN way. You should have upstreamed the specification before finalizing the hardware and make sure such chicken and egg situations do not occur.

Signature · 5 lines
viresh

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
#7 lore raw
Quoted 25 lines · Viresh Kumar
Quoted 10 lines · metux IT consult
Quoted 2 lines · Arnd Bergmann

Agreed, interrupt support is obviously something that can not be retrofitted easily if you don't get it right from the start.

It's basically present, the basic version (as now writting in this spec) just can't do hardware masking - that part is planned as an optional feature (which I haven't yet put into that spec version, since I wanted to get the basic version finished up before doing the optional features).

Finally you called it interrupt :)

Quoted 3 lines

Actually, the optional feature will just add another message for mask/unmask. I'll yet having conversations w/ HW engineers on certain aspects, e.g. automatic masking (yes/no/configurable ?).

An interrupt should never occur unless asked for. Here is an example of how this is BROKEN right now.

Lets say the host passes 32 gpio lines to guest, guest moves them in input mode (some user requested for them) and then frees the gpio lines.

Quoted 8 lines

At this point there are no users of the GPIO block in the guest OS, but the virtio traffic will continue for the interrupts, as the host will keep sending the GPIO status changes to the guest.

This is simply BROKEN and NOT acceptable.

If you want to implement interrupts, then add them in a separate feature or just don't. Partial implementations aren't going to work.

Will it be possible to move this stuff a bit faster? We are still where we were in December last year. Not a lot has changed.

We have future work blocked because of this, Linux driver and generic Backend implementation (and their users later on), etc.

We really need to move it forward.

Thanks.

Signature · 1 line
viresh
#8 lore raw
In reply to Viresh Kumar

On 30.06.21 19:30, Viresh Kumar wrote:

Hi,

Quoted 4 lines

I don't expect others, specially the GPIO maintainers or Arnd, to have subscribed to these lists (and many times people try to subscribe to lists with no-email option, so their reply can reach to everyone, while don't want unnecessary emails).

okay, I'm hereby nominate you for the moderator of this virtual meetting who takes care of those things :p

Quoted 2 lines

What about the changes to the config structure to make it efficient, easily extendable,

What exactly are you missing here, that cannot be easily added in future versions ?

We currently have:

* plenty free bytes
* version field for clear distinction
* config space may be increased later

Quoted 1 line

etc Or the Free Msg, etc?

You mean release a previously requested line ? Yes, that's indeed slipped through. Sorry about that, and thanks for reminding me.

It really gotten too much and too heated mail traffic, so I lost track a bit. I believe a good approach for solving those kind of problems is just keeping a list of open issues and reposting the still remaining points.

Quoted 4 lines

Over that, if you don't want to implement interrupts in your version (I can surely send a patch for that), then you need to drop the half-hearted interrupt support, i.e. VIRTIO_GPIO_MSG_DEVICE_LEVEL, as that is not the right way of implementing interrupts.

This is message is an signal that tells the level has changed and what the new level is. It is just an event. If you wanna use that event as an interrupt source, it naturally fits an edge interrupt.

Note that we're still talking about an gpio controller, not an interrupt controller. The gpio controller signals when something happened on some input, and it even tells it along with that signal, no explicit readout required (as on traditional controllers).

Masking out unintersting events is a more sophisticated functionality (which needs lots of more gates in HW). Certainly good to have, but that really shouldn't be mandatory for all. That's why I've explicitly planned that as an *optional* feature (means: controller announces that in a dedicated feature bit).

Quoted 1 line

This will make the specification as well as Linux or backend code messy, as we would be required to support interrupts in two ways in this case based on irq-feature.

Why so ? If HW has the IRQ controller feature bit set, we send the mask / unmask messages, otherwise we don't. Will be a simple 'if' statement in virtio_gpio_irq_mask() / virtio_gpio_irq_unmask(). Two extra lines in each function.

--mtx

Signature · 24 lines
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
[email protected] -- +49-151-27565287

This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#9 lore raw
Quoted 8 lines · metux IT consult
Quoted 4 lines · Viresh Kumar

I don't expect others, specially the GPIO maintainers or Arnd, to have subscribed to these lists (and many times people try to subscribe to lists with no-email option, so their reply can reach to everyone, while don't want unnecessary emails).

okay, I'm hereby nominate you for the moderator of this virtual meetting who takes care of those things :p

What about start cc'ing LKML here then, so everyone gets every message unconditionally ?

Quoted 11 lines
Quoted 2 lines

What about the changes to the config structure to make it efficient, easily extendable,

What exactly are you missing here, that cannot be easily added in future versions ?

We currently have:

* plenty free bytes
* version field for clear distinction
* config space may be increased later

Please look at this here, I am not willing to explain them again.

https://lists.oasis-open.org/archives/virtio-comment/202106/msg00037.html

And reply right there on that thread. In short, version field needs to go, we need to remove all extra padding and add gpio_names_offset.

If you don't agree, you can post your reasoning in reply to that, but on the main thread please.

Quoted 7 lines
Quoted 4 lines

Over that, if you don't want to implement interrupts in your version (I can surely send a patch for that), then you need to drop the half-hearted interrupt support, i.e. VIRTIO_GPIO_MSG_DEVICE_LEVEL, as that is not the right way of implementing interrupts.

This is message is an signal that tells the level has changed and what the new level is.

You can call it whatever you want, but this really is an interrupt from device to driver. And it shouldn't be implemented this way.

Moreover, an interrupt should never come in the first place until the time the driver (guest) has requested the device (host) for enabling it.

Quoted 7 lines

It is just an event. If you wanna use that event as an interrupt source, it naturally fits an edge interrupt.

Note that we're still talking about an gpio controller, not an interrupt controller. The gpio controller signals when something happened on some input, and it even tells it along with that signal, no explicit readout required (as on traditional controllers).

No, you do polling if you want to read something. GPIO doesn't need an interrupt if the users don't want to be notified about changes.

Quoted 5 lines

Masking out unintersting events is a more sophisticated functionality (which needs lots of more gates in HW). Certainly good to have, but that really shouldn't be mandatory for all. That's why I've explicitly planned that as an *optional* feature (means: controller announces that in a dedicated feature bit).

Sure, but this kind of half-hearted interrupt implementation is not going to fly. Sorry about that.

Either don't support interrupts, or if you want to do, then please do it properly.

Quoted 8 lines
Quoted 3 lines

This will make the specification as well as Linux or backend code messy, as we would be required to support interrupts in two ways in this case based on irq-feature.

Why so ? If HW has the IRQ controller feature bit set, we send the mask / unmask messages, otherwise we don't. Will be a simple 'if' statement in virtio_gpio_irq_mask() / virtio_gpio_irq_unmask(). Two extra lines in each function.

We are writing a new specification here, and we aren't going to make the specification or code confusing in this aspect.

From your Linux side driver, this is what you do on this event:

static void virtio_gpio_signal(struct virtio_gpio_priv *priv, int event,
int pin, int value)

{
       int mapped_irq = irq_find_mapping(priv->gc.irq.domain, pin);

       if ((pin < priv->num_gpios) && test_bit(pin, priv->irq_mask))
               generic_handle_irq(mapped_irq);
}

How can you even say this isn't interrupt ? You are trying the interrupt in a hacky way and it isn't going to work. Sorry about that.

I am fine in implementing the interrupt support in driver and spec, but you need to drop this event completely here for that.

Signature · 5 lines
viresh

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
#10 lore raw
In reply to Enrico Weigelt, metux IT consult
Quoted 6 lines · metux IT consult
Quoted 2 lines · Viresh Kumar

+ All the people from previous version (Please cc them yourself while sending a new version, these are the people interested in this stuff).

Phuh, it's hard to track them all. I'm assuming everybody interested in this is already on the list or can easily subscribe :p

It's a matter of courtesy to help people who contributed by spending time on review locate your new version.
Tracking what changed to address which comments and listing that in the cover letter is also very much expected of contributors. Please do this in the future.

Signature · 6 lines
MST


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]