Re: [PATCH v8 3/4] gpio: rpmsg: add generic rpmsg GPIO driver
From: Shenwei Wang
Date: Thu Feb 19 2026 - 16:12:37 EST
> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Thursday, February 19, 2026 2:51 PM
> To: Shenwei Wang <shenwei.wang@xxxxxxx>
> Cc: Arnaud POULIQUEN <arnaud.pouliquen@xxxxxxxxxxx>; 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>; Mathieu Poirier <mathieu.poirier@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>; Peng Fan
> <peng.fan@xxxxxxx>; devicetree@xxxxxxxxxxxxxxx; linux-
> remoteproc@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; dl-linux-imx <linux-imx@xxxxxxx>; Bartosz
> Golaszewski <brgl@xxxxxxxx>
> Subject: [EXT] Re: [PATCH v8 3/4] gpio: rpmsg: add generic rpmsg GPIO driver
> > > Any reason to use __packed and alignement here?
> > > This structure will be copied in a vring buffer right?
> > >
> >
> > Using __packed together with an explicit alignment is a common pattern
> > for defining communication packets. The goal is to ensure a stable and
> > predictable layout across different architectures and compilers.
>
> Being mostly a netdev person, i can say that the network Maintainers actually
> refuses patches with __packed. If you have designed your protocol correctly,
> defined your structure correctly, you should not need them.
>
The fact is that there are many __packed usages just under the Ethernet directory.
$ grep -rn __packed drivers/net/ethernet | wc -l
553
Regards,
Shenwei
> We do however accept things like
>
> BUILD_BUG_ON(sizeof(strcut foo) != 8);
>
> just to make sure the compile is doing what you expect.
>
> Andrew