RE: [PATCH v14 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus
From: Shenwei Wang (OSS)
Date: Tue Jul 14 2026 - 17:10:22 EST
> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Tuesday, July 14, 2026 3:23 PM
> To: Shenwei Wang (OSS) <shenwei.wang@xxxxxxxxxxx>
> Cc: Mathieu Poirier <mathieu.poirier@xxxxxxxxxx>; Linus Walleij
> <linusw@xxxxxxxxxx>; Bartosz Golaszewski <brgl@xxxxxxxxxx>; Jonathan Corbet
> <corbet@xxxxxxx>; Rob Herring <robh@xxxxxxxxxx>; Krzysztof Kozlowski
> <krzk+dt@xxxxxxxxxx>; Conor Dooley <conor+dt@xxxxxxxxxx>; Bjorn Andersson
> <andersson@xxxxxxxxxx>; Frank Li <frank.li@xxxxxxx>; Sascha Hauer
> <s.hauer@xxxxxxxxxxxxxx>; Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>; linux-
> gpio@xxxxxxxxxxxxxxx; linux-doc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>; Fabio Estevam
> <festevam@xxxxxxxxx>; Shenwei Wang <shenwei.wang@xxxxxxx>; Peng Fan
> <peng.fan@xxxxxxx>; devicetree@xxxxxxxxxxxxxxx; linux-
> remoteproc@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; dl-linux-imx <linux-imx@xxxxxxx>; Arnaud
> POULIQUEN <arnaud.pouliquen@xxxxxxxxxxx>; b-padhi@xxxxxx
> 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