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

From: Shenwei Wang (OSS)

Date: Tue Jul 14 2026 - 16:27:39 EST




> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Tuesday, July 14, 2026 3:13 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
>
> > > 1) You did not include messages that mask and unmask interrupts at
> > > the driver side.
> >
> > Interrupt masking and unmasking are handled entirely on the local processor.
> >
> > When an interrupt occurs, the remote system masks the interrupt and
> > then sends a notification to Linux. After Linux processes the
> > notification, it sends a SET_IRQ_TYPE message back to the remote system,
> which then unmasks the interrupt.
>
> Masking and unmasking an interrupt are orthogonal to the interrupt type.
>
> When the interrupt fires, the interrupt core calls the irq_mask() operation on the
> interrupt. That should mask the interrupt. Once the handler has finished, the
> interrupt core, will call irq_unmask() to unmask the interrupt.
>
> Edge, level, high, low, raising, falling has nothing to do with masking. Please don't
> mix concepts which Linux keeps separate.
>

That's how virtio-gpio is implemented. It uses a single command (MSG_IRQ_TYPE, 0x6) for
IRQ-related configuration, including masking, unmasking, and trigger type settings. Please
refer to gpio-virtio.c for the details.

Shenwei

> Andrew