Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Shenwei Wang" <shenwei.wang@oss.nxp.com>
Cc: conor+dt@kernel.org, Frank.Li@kernel.org, imx@lists.linux.dev,
	robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v16 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus
Date: Wed, 23 Sep 2026 18:50:28 +0000	[thread overview]
Message-ID: <20260923185029.AAE4A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923184255.299034-2-shenwei.wang@oss.nxp.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] gpio-rpmsg: lost edge interrupts due to SET_IRQ_TYPE unmasking
- [Medium] gpio-rpmsg: unaligned 16-bit line field in interrupt message
--

commit 2049dbbf3b708aaa525f92e4899cb8a65c3fd69f
Author: Shenwei Wang <shenwei.wang@nxp.com>

docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus

Describes the gpio rpmsg transport protocol over the rpmsg bus between
the remote system and Linux.

> diff --git a/Documentation/driver-api/gpio/gpio-rpmsg.rst b/Documentation/driver-api/gpio/gpio-rpmsg.rst
> new file mode 100644
> index 0000000000000..9af75cc759ba7
> --- /dev/null
> +++ b/Documentation/driver-api/gpio/gpio-rpmsg.rst

[ ... ]

> +Interrupt Messages
> +------------------
> +
> +Interrupt messages are sent by the remote core and they have
> +**Type=1 (GPIO_RPMSG_NOTIFY)**:
> +
> +When a GPIO line asserts an interrupt on the remote processor, the firmware
> +should immediately mask the corresponding interrupt source and send a
> +notification message to the Linux. Upon completion of the interrupt
> +handling on the Linux side, the driver should issue a
> +command **SET_IRQ_TYPE** to the firmware to unmask the interrupt.

[Severity: High]
Does this mechanism risk losing edge interrupts?

If a secondary edge interrupt occurs while the interrupt is masked during
processing on the Linux side, it will be latched by the remote hardware.

When the firmware receives the SET_IRQ_TYPE command as an unmask signal,
writing the trigger configuration to hardware will inadvertently clear this
latched edge on many platforms, such as the i.MX platforms this driver
targets.

Should the protocol separate MASK and UNMASK commands from configuration
commands to prevent clearing latched pending bits or resetting the
edge-detection state machine?

> +
> +.. code-block:: none
> +
> +   +------+------+--------+
> +   | 0x00 | 0x01 |  0x02  |
> +   |   1  |     line      |
> +   +------+------+--------+

[Severity: Medium]
Will this message layout cause hardware faults or performance penalties on
remote processors?

The layout places the 2-byte line field immediately after the 1-byte type
field, creating an unaligned multi-byte field. Without padding, this requires
packed structs on Linux and could cause hardware faults or performance
penalties on remote firmware processors lacking hardware unaligned access
support (like ARM Cortex-M0 or M0+).

Should a 1-byte padding field be introduced to ensure natural alignment and
cross-architecture compatibility?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923184255.299034-1-shenwei.wang@oss.nxp.com?part=1

  reply	other threads:[~2026-09-23 18:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 18:42 [PATCH v16 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Shenwei Wang
2026-09-23 18:42 ` [PATCH v16 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus Shenwei Wang
2026-09-23 18:50   ` sashiko-bot [this message]
2026-09-23 18:42 ` [PATCH v16 2/5] dt-bindings: remoteproc: imx_rproc: Add "rpmsg" subnode support Shenwei Wang
2026-09-23 18:52   ` sashiko-bot
2026-09-24 17:35   ` Conor Dooley
2026-10-06  3:07   ` Rob Herring
2026-10-06 15:18     ` Mathieu Poirier
2026-10-06 18:02       ` Rob Herring
2026-09-23 18:42 ` [PATCH v16 3/5] rpmsg: core: match rpmsg device IDs by prefix Shenwei Wang
2026-09-23 18:59   ` sashiko-bot
2026-09-23 18:42 ` [PATCH v16 4/5] gpio: rpmsg: add generic rpmsg GPIO driver Shenwei Wang
2026-09-23 18:57   ` sashiko-bot
2026-09-23 20:25   ` Andrew Davis
2026-09-23 18:42 ` [PATCH v16 5/5] arm64: dts: imx8ulp: Add rpmsg node under imx_rproc Shenwei Wang
2026-09-23 18:54   ` sashiko-bot
2026-09-24 14:54 ` [PATCH v16 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260923185029.AAE4A1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shenwei.wang@oss.nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox