> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: Tuesday, July 14, 2026 3:13 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
> 
> > > 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

Reply via email to