RE: [PATCH v14 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus

"Shenwei Wang (OSS)" <[email protected]> Tue, 14 Jul 2026 19:04:08 +0000
Newsgroups org.kernel.vger.linux-remoteproc,dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-doc,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel
Message-ID <PAXPR04MB918568AE7B2364EC9D16427689F92@PAXPR04MB9185.eurprd04.prod.outlook.com>

> -----Original Message-----
> From: Mathieu Poirier <[email protected]>
> Sent: Monday, July 13, 2026 12:17 PM
> To: Shenwei Wang (OSS) <[email protected]>
> Cc: Linus Walleij <[email protected]>; Bartosz Golaszewski <[email protected]>;
> Jonathan Corbet <[email protected]>; Rob Herring <[email protected]>; Krzysztof
> Kozlowski <[email protected]>; Conor Dooley <[email protected]>; Bjorn
> Andersson <[email protected]>; Frank Li <[email protected]>; Sascha Hauer
> <[email protected]>; Shuah Khan <[email protected]>; linux-
> [email protected]; [email protected]; [email protected];
> Pengutronix Kernel Team <[email protected]>; Fabio Estevam
> <[email protected]>; Shenwei Wang <[email protected]>; Peng Fan
> <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]; linux-arm-
> [email protected]; dl-linux-imx <[email protected]>; Arnaud
> POULIQUEN <[email protected]>; [email protected]; Andrew Lunn
> <[email protected]>
> Subject: Re: [PATCH v14 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg
> bus
> 
> > +
> > +The RPMSG message consists of a 8-byte packet with the following layout:
> > +
> > +.. code-block:: none
> > +.. code-block:: none
> > +
> > +   +------+------+--------+
> > +   | 0x00 | 0x01 |  0x02  |
> > +   |   2  | line | trigger|
> > +   +------+------+--------+
> 
> 2 things here:
> 
> 1) You did not include messages that mask and unmask interrupts at the driver
> side.
> 
> 2) We are carrying virtio-gpio messages on top of RPMSG and as such, this whole
> protocol should be about thar:
> 
> +------+------+--------+--------
> | 0x00 |       payload         |
> |  Q   |                       |
> +------+------+--------+--------
> 
> Q = 0 requestq
> Q = 1 eventq
> 
> The "payload" part is simply the format of the messages as found in the virtio-
> gpio specification.  From there, the only thing left to mention is which messages
> are not supported, i.e get line names.
> 
> > +
> > +- **line**: The GPIO line (pin) index of the port.
> > +
> > +- **trigger**: Optional parameter to indicate the trigger event type.
> 
> Not part of the spec - remove.
> 

The two fields above are required for rpmsg-gpio, but not for virtio-gpio.

In the rpmsg-gpio case, interrupt detection and handling occur on the remote processor. The 
interrupt information (such as the GPIO line and trigger type) must therefore be sent to Linux 
through this notification message.

In contrast, for virtio-gpio, interrupt handling is performed on the local processor. Since Linux already 
has all the necessary interrupt context, the information is not needed.

Shenwei

> Given the refactoring work that is still needed, I will not look at the
> implementation.
> 
> Thanks,
> Mathieu
> 
> > +
> > diff --git a/Documentation/driver-api/gpio/index.rst
> > b/Documentation/driver-api/gpio/index.rst
> > index bee58f709b9a..e5eb1f82f01f 100644
> > --- a/Documentation/driver-api/gpio/index.rst
> > +++ b/Documentation/driver-api/gpio/index.rst
> > @@ -16,6 +16,7 @@ Contents:
> >     drivers-on-gpio
> >     bt8xxgpio
> >     pca953x
> > +   gpio-rpmsg
> >
> >  Core
> >  ====
> > --
> > 2.43.0
> >