[PATCH v8 3/4] gpio: rpmsg: add generic rpmsg GPIO driver

Shenwei Wang shenwei.wang at nxp.com
Fri Feb 20 09:09:42 PST 2026



> -----Original Message-----
> From: Andrew Lunn <andrew at lunn.ch>
> Sent: Friday, February 20, 2026 10:19 AM
> To: Shenwei Wang <shenwei.wang at nxp.com>
> Cc: Arnaud POULIQUEN <arnaud.pouliquen at foss.st.com>; Linus Walleij
> <linusw at kernel.org>; Bartosz Golaszewski <brgl at kernel.org>; Jonathan Corbet
> <corbet at lwn.net>; Rob Herring <robh at kernel.org>; Krzysztof Kozlowski
> <krzk+dt at kernel.org>; Conor Dooley <conor+dt at kernel.org>; Bjorn Andersson
> <andersson at kernel.org>; Mathieu Poirier <mathieu.poirier at linaro.org>; Frank Li
> <frank.li at nxp.com>; Sascha Hauer <s.hauer at pengutronix.de>; Shuah Khan
> <skhan at linuxfoundation.org>; linux-gpio at vger.kernel.org; linux-
> doc at vger.kernel.org; linux-kernel at vger.kernel.org; Pengutronix Kernel Team
> <kernel at pengutronix.de>; Fabio Estevam <festevam at gmail.com>; Peng Fan
> <peng.fan at nxp.com>; devicetree at vger.kernel.org; linux-
> remoteproc at vger.kernel.org; imx at lists.linux.dev; linux-arm-
> kernel at lists.infradead.org; dl-linux-imx <linux-imx at nxp.com>; Bartosz
> Golaszewski <brgl at bgdev.pl>
> Subject: [EXT] Re: [PATCH v8 3/4] gpio: rpmsg: add generic rpmsg GPIO driver
> > Example: 32‑bit ARM vs 64‑bit ARM (AArch32 vs AArch64) Consider this
> > message header:
> > struct msg_hdr {
> >     u8  id;
> >     u32 size;
> >     u8  flags;
> > };
> 
> That is just a bad design. The point of not allowing __packed is that it forces you
> to design your structures correctly. Maybe AI has no idea of taste, but Maintainer
> do and would not allow a u32 to be unaligned like this.
> 

Let’s keep the discussion technical instead of taste. 😊

My point with the earlier example was simply to illustrate how layout differences can 
happen across architectures or compilers. I’m more interested in understanding how 
you would prefer this specific structure to be defined so that it avoids unaligned fields 
while still maintaining a stable on‑wire format.

For the rpmsg‑gpio driver specifically, I can drop the __packed annotation if that is the 
consensus, since the known configurations work without requiring it. 

Thanks,
Shenwei

>    Andrew


More information about the linux-arm-kernel mailing list