lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PAXPR04MB918524EAA74F72D64AE0ACA489EAA@PAXPR04MB9185.eurprd04.prod.outlook.com>
Date: Mon, 13 Oct 2025 14:44:43 +0000
From: Shenwei Wang <shenwei.wang@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: Bjorn Andersson <andersson@...nel.org>, Mathieu Poirier
	<mathieu.poirier@...aro.org>, Rob Herring <robh@...nel.org>, Krzysztof
 Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Shawn Guo
	<shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>, Linus Walleij
	<linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>, Pengutronix
 Kernel Team <kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>, Peng
 Fan <peng.fan@....com>, "linux-remoteproc@...r.kernel.org"
	<linux-remoteproc@...r.kernel.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH v3 3/4] gpio: imx-rpmsg: add imx-rpmsg GPIO driver



> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Friday, October 10, 2025 2:32 PM
> To: Shenwei Wang <shenwei.wang@....com>
> Cc: Bjorn Andersson <andersson@...nel.org>; Mathieu Poirier
> <mathieu.poirier@...aro.org>; Rob Herring <robh@...nel.org>; Krzysztof
> Kozlowski <krzk+dt@...nel.org>; Conor Dooley <conor+dt@...nel.org>; Shawn
> Guo <shawnguo@...nel.org>; Sascha Hauer <s.hauer@...gutronix.de>; Linus
> Walleij <linus.walleij@...aro.org>; Bartosz Golaszewski <brgl@...ev.pl>;
> Pengutronix Kernel Team <kernel@...gutronix.de>; Fabio Estevam
> <festevam@...il.com>; Peng Fan <peng.fan@....com>; linux-
> remoteproc@...r.kernel.org; devicetree@...r.kernel.org; imx@...ts.linux.dev;
> linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org; dl-linux-imx
> <linux-imx@....com>
> Subject: [EXT] Re: [PATCH v3 3/4] gpio: imx-rpmsg: add imx-rpmsg GPIO driver
> > The only platform-specific part is the message format exchanged between
> Linux and the remote processors.
> > As long as the remote processor follows the same message protocol, the driver
> should work as expected.
> >
> > Here's the layout of the message packets:
> >
> > +--------+--------+--------+--------+--------+----------------+--------+--------+----------
> -----+---------------+
> > |0x00    |0x01    |0x02    |0x03    |0x04    |0x05..0x09      |0x0A    |0x0B    |0x0C
> |0x0D           |
> > |cate    |major   |minor   |type    |cmd     |reserved[5]     |pin_idx
> |port_idx|out:{evt/rc/v} |in:{wkup/val}  |
> > +--------+--------+--------+--------+--------+----------------+--------+--------+----------
> -----+---------------+
> >
> > Cate (Category field ): can be GPIO /I2C/PMIC/AUDIO ... etc Major :
> > Major version number
> > Minor: Minor version number
> > Type (Message Type): Can be SETUP / REPLY /NOTIFY for GPIO category
> > Cmd (Command): Can be Input INIT / Output INIT / Input GET for GPIO
> > category
> > Pin_idx: The GPIO line index
> > Port_idx: The GPIO controller index
> >
> > For Out packet:
> >       if it is OUPUT INIT, the out field value is the gpio output level.
> >       If it is INPUT INIT, the out filed is 0.
> >
> > For In packet:
> >       If it is a REPLY message, the out field is return code. 0 means success.
> >       If it is a REPLY of INPUT GET, the in field is the value of GPIO line level.
> >       If it is an NOTIFY type of message, it simulates an interrupt event from the
> remote processor.
> >
> > I can add above comments in the commit log or the beginning of the driver
> source file.
> 
> Maybe Documentation/admin-guide/gpio-rpmsg.rst would be better.  You should
> also document how to handle features the device does not support. e.g. i _think_
> your hardware supports all 4 interrupt types. But maybe other hardware needs to
> return something meaning -EOPNOTSUP?
> 

That should be one type of the error return code in the out field of REPLY message. 
The return code of 0 means success, and the others are error codes. 

I will add a gpio-rpmsg.rst file in the next patches. 

Thanks,
Shenwei

>         Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ