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

"Shenwei Wang (OSS)" <[email protected]> Tue, 14 Jul 2026 21:10:01 +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 <PAXPR04MB91858B3C5D5E1B74B9291BE289F92@PAXPR04MB9185.eurprd04.prod.outlook.com>

> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: Tuesday, July 14, 2026 3:23 PM
> To: Shenwei Wang (OSS) <[email protected]>
> Cc: Mathieu Poirier <[email protected]>; 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]
> Subject: Re: [PATCH v14 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg
> bus
> 
> > 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.
> 
> Are you sure about that?
> 
> virtio_gpio_irq_set_type() sets:
> 

Why are you bringing up virtio_gpio_irq_set_type() here? The command path is already 
fully aligned with the existing virtio-gpio implementation.

The gap we are discussing is the interrupt notification message coming from the remote side. 
That is the topic under discussion.

Shenwei

>         irq_line->type = type;
>         irq_line->update_pending = true;
> 
> virtio_gpio_irq_bus_sync_unlock() looks at update_pending and does
> virtio_gpio_req(), passing irq_line->type as type.
> 
> This then gets filled into:
> 
> /* Virtio GPIO Request / Response */
> struct virtio_gpio_request {
> 	__le16 type;
> 	__le16 gpio;
> 	__le32 value;
> };
> 
> which gets scatter/gathered over the virtqueue to the peer.
> 
>       Andrew