mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Shenwei Wang <shenwei.wang@nxp.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Jonathan Corbet <corbet@lwn.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>, Peng Fan <peng.fan@nxp.com>,
	"linux-remoteproc@vger.kernel.org"
	<linux-remoteproc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH v5 3/5] docs: staging: gpio-rpmsg: gpio over rpmsg bus
Date: Sat, 8 Nov 2025 18:45:46 +0100	[thread overview]
Message-ID: <0980eb35-b3fd-4383-af86-433769a4fd97@lunn.ch> (raw)
In-Reply-To: <PAXPR04MB9185E2C3E50D365F64F10E3A89C3A@PAXPR04MB9185.eurprd04.prod.outlook.com>

> > > The power state of the remote GPIO controller is entirely managed by the
> > remote firmware.
> > > The remote firmware operates as an independent system from Linux, with
> > > its own power states and policies for transitioning between modes. The
> > > wakeup field is solely intended to inform the remote firmware whether the
> > GPIO line should be used as a wakeup source for the Linux system.
> > 
> > O.K. How does the firmware use this information? How should it change its
> > behaviour?
> > 
> 
> The remote system should always aim to stay in a power-efficient state by shutting down 
> or clock-gating any blocks that aren't in use. In this wakeup scenario, if no GPIO lines are 
> requested or marked as wakeup sources for Linux, the remote firmware should put the 
> GPIO controller into a low-power state.

There are no messages defined to tell the GPIO controller Linux is
suspended.

Since the firmware has no idea Linux is asleep, the firmware is
performing all the usual processing, driving output pins, monitoring
input pins, delivering interrupt notifications. If no pins are marked
as wakeup, it can then enter some sort of low-power state, which
allows it to do all this work, plus save power? How?

I've also been thinking about what a wake up source actually
means. I've been looking at this from one use case i know, an Ethernet
PHY performing Wake on LAN? What normally happens is that Linux
suspends, but leaves the main SoC interrupt controller enabled, and
parts of the GPIO controller. The GPIO controller has a hard wired
connection to the interrupt controller. When the PHY indicated WoL by
driving its output pin low, triggering an interrupt, the GPIO triggers
the main interrupt controller, which wakes the CPU.

How does this work here, in a message passing system? Linux is
asleep. While asleep, does it still process all remote proc messages?
How? Does it wake up for each message and go back to sleep once it
finds it is a non wake notification? Since the firmware does not know
Linux is asleep, it will still be sending notifications for non-wake
interrupts. How does Linux actually know to wake up? Do you require
that the low level remote proc mechanism is also wake capable? So in
effect, Linux needs to go up the device chain and enable wake source
not only in the GPIO layer but also the remote proc layer? And
whatever mechanism that is based on, until you get to an interrupt
which can actually wake the system?

> Okay. To fully simulate a level-triggered interrupt, a notification reply message is required.

I would not word it like that. All you currently have is edge. To
simulate level triggered interrupts you need a notification reply
message.

> Remote firmware sequence:
> Receive the level-triggered GPIO interrupt.
> Mask the interrupt for the corresponding line.
> Send a notification message to Linux.
> Wait for the notification reply, then unmask the interrupt for the line.
> 
> Linux sequence:
> Receive the notification message.
> Invoke the interrupt handler for the line.
> Send a notification reply to the remote firmware to indicate End of Interrupt (EOI).

That sounds more reasonable.

	Andrew

  reply	other threads:[~2025-11-08 17:45 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04 20:33 [PATCH v5 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Shenwei Wang
2025-11-04 20:33 ` [PATCH v5 1/5] dt-bindings: remoteproc: imx_rproc: Add "rpmsg" subnode support Shenwei Wang
2025-11-06 18:18   ` Andrew Lunn
2025-11-12 12:53   ` Rob Herring
2025-11-12 15:36     ` Shenwei Wang
2025-11-04 20:33 ` [PATCH v5 2/5] remoteproc: imx_rproc: Populate devices under "rpmsg" subnode Shenwei Wang
2025-11-06  7:56   ` Peng Fan
2025-11-06 18:23     ` Andrew Lunn
2025-11-25 17:04   ` Mathieu Poirier
2025-11-26 22:43     ` Shenwei Wang
2025-11-26 18:53   ` Mathieu Poirier
2025-11-26 21:46     ` Shenwei Wang
2025-11-27 16:23       ` Mathieu Poirier
2025-12-01 15:50         ` Shenwei Wang
2025-11-04 20:33 ` [PATCH v5 3/5] docs: staging: gpio-rpmsg: gpio over rpmsg bus Shenwei Wang
2025-11-06 19:05   ` Andrew Lunn
2025-11-06 20:40     ` Shenwei Wang
2025-11-06 21:32       ` Andrew Lunn
2025-11-06 23:13         ` Shenwei Wang
2025-11-07  0:31           ` Andrew Lunn
2025-11-07 21:24             ` Shenwei Wang
2025-11-08 17:45               ` Andrew Lunn [this message]
2025-11-10 15:24                 ` Shenwei Wang
2025-11-10 15:59                   ` Andrew Lunn
2025-11-10 16:30                     ` Shenwei Wang
2025-11-10 17:58                       ` Andrew Lunn
2025-11-11 10:35   ` Linus Walleij
2025-11-11 16:45     ` Shenwei Wang
2025-11-12 13:41       ` Andrew Lunn
2025-11-12 16:31         ` Shenwei Wang
2025-11-14 17:39           ` Andrew Lunn
2025-11-12 12:57   ` Rob Herring
2025-11-12 13:35     ` Daniel Baluta
2025-11-12 21:18       ` Randy Dunlap
2025-11-13 22:23         ` Shenwei Wang
2025-11-13 22:34           ` Randy Dunlap
2025-11-04 20:33 ` [PATCH v5 4/5] gpio: imx-rpmsg: add imx-rpmsg GPIO driver Shenwei Wang
2025-11-06  8:12   ` Peng Fan
2025-11-06 12:31   ` Zhongqiu Han
2025-11-06 17:00     ` Shenwei Wang
2025-11-04 20:33 ` [PATCH v5 5/5] arm64: dts: imx8ulp: Add rpmsg node under imx_rproc Shenwei Wang
2025-11-05  1:12 ` [PATCH v5 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Peng Fan
2025-11-05 10:25   ` Arnaud POULIQUEN
2025-11-05 14:12     ` Shenwei Wang
2025-11-06 10:17       ` Arnaud POULIQUEN
2025-11-06 16:26         ` Shenwei Wang
2025-11-07 17:17           ` Arnaud POULIQUEN
2025-11-07 17:27             ` Andrew Lunn
2025-11-07 22:40             ` Shenwei Wang
2025-11-24 17:06 ` Mathieu Poirier
2025-12-03 19:09 ` 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=0980eb35-b3fd-4383-af86-433769a4fd97@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andersson@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=shenwei.wang@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

all inboxes | Powered by JetHome®