From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96C9C481A94 for ; Wed, 15 Jul 2026 15:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784129161; cv=none; b=V8QmeF+EuoXPJHFgkUuUMBVBahYGFwOMcGpimKVYIVrSeuoQpPuSaxAMAcw4sDxbOQxDwsh2AsyeD92GOAPOPtd+/qO003hph3sdZMzjM/FAXXXjRiUZ/oS/wjH4zr/RcKofLA2v/912TtxfdzjXCAC0HkdQPdkHLr0NoVaucwE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784129161; c=relaxed/simple; bh=8IfDTW8a3b3sS/iPv7vB1ZiuTNxkT5DDhwcjj8R2JRs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TeZf7tISLvUNU9w6+B7xHnN/IzU8tGxS2kGN+kpSw5M7lOeVznQDDZhSemp7Wa9qFw2aFNAMY0dcMPuCJGscsMUZVk+7Z6gOCHAjTx9YWpwYf7mgx9xrh6hHeThWjs+ujREydE0gzqU6nm6KeiR9iHW6CS1/gvDHtgkxxuCVpR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=vr4JN4/a; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vr4JN4/a" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2ccdb73f0e1so22417245ad.3 for ; Wed, 15 Jul 2026 08:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1784129158; x=1784733958; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=2kgwyk0OObBT++oiW1zqAAqUnSr/tbzGEYYjYm7Tx6U=; b=vr4JN4/aw/QYNhmQOV0ZnlVY5dKDn3e7X95fQ89WDWofYJKR+v3BI/DUWFO+eh+1Rd OVyR/TN17p0tIeF9lIbaNl2D5Cr2QR5roDiU5O6vzPX75TUZTmnWU5quxf3N/vKDmhqc kZVYd5U9gEZ15MY+jj8kf641j8V+U21+hegrWPeAKaefNxFhd28GyJvsCqMR3VgaEvHv 7Fz6QpKquKfnsli/YMICBB2ZfAVERQG6sq2uDTyYXM8uwr9LniIZdlnJDvju34YhrF2C ZswQfpDaQj3msWkGru5R6JNulpUGf83CcCptWwVEZeC+aTgigESMzibOd3efi2rz0m16 QSZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784129158; x=1784733958; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2kgwyk0OObBT++oiW1zqAAqUnSr/tbzGEYYjYm7Tx6U=; b=X/QQ1YUDmg2fER6n+13DZ1FfBgldKdpQz0breBso8pqSSPto2/BkhGSwDD1kad9Wr3 Licua4Mu4jL5CaeZekzP3gYkT60jddwPBkBEeK7iYmZHRFC7YJgDsJAMqKh5c1udxLKr 9BvF+/RRr7OfoBTd4PeeWL1g2GgHCmxOM8lHe//8ZpAe7zkUhIlaw08zntYwFDLA+GNs wegy9MQxcFV/WXZoL5fh7mSfrO0rnbDy6ozYfBwAZ7be9imBOz+gTlPZykl0cBVt5ktI pHnnpSu/9xWMuZdKnBKq8xyUVH3NaL1MCC+V6OVDhgGx+sJbFwdFbfjbmEXiyPKLsysV SUJQ== X-Forwarded-Encrypted: i=1; AHgh+RqslvP6iBLWWCfraQz4gi1EjJoFePm+3Z/uKZtTHC+LO99M8BCb/tr0vpr/31a4Mu4w5VBykevrTxOSeKc=@vger.kernel.org X-Gm-Message-State: AOJu0YybA2A4Dlslr/pS3krchxtLtxMntje3YNB5zWnxt9/QgISOz9JK CBkpYQ+bUKCXrTqvBNQ2aYMld+YV4KvcIBFDFluqn2FPNG0wLi51h/w4VZW6fojOVPQ= X-Gm-Gg: AfdE7cmI1lfLYs3y4iCU6jZubDWrpN9S+HdMy+Iigg03tFjPrl5841jz2RasK7n+Gju prnxRTs3b1R6BA0HhfwY+C9kBefLGmfHD+w6cr8t9cPF+kjaM84XQp46oGZq0emcNFYirO+SocA d9rJWtK685fpgU/CB2YNteLVFk7Fn5/9A0WLacgVYoZeWxl5RG9gpEr5hoShNrQkYnGYzuZn5FC lmFzLpZYEDP7K9trcUS1/blv9Ga7ogh8Rv1tN5mHI9aI0zUAv8odqk0zG7nFEep+DIlVFFrgUtI z8LgGxp7oxcnuWx6VG4L2LZp1oGvnZ/jaImFD4I33j9z1LyRrW+mRyA0st+GUWHw179piw7OKYG bQ7UahAYUv5cWvigAQqcK4EXNewPyc9+CaraacVorz7wW5m+AwzjaN9BRJgZ2VDRNQ7Y5K2X/tt t7E5kl/p0yc4LbjutI X-Received: by 2002:a17:902:f787:b0:2ce:d957:59c4 with SMTP id d9443c01a7336-2ced9575addmr115795235ad.6.1784129157763; Wed, 15 Jul 2026 08:25:57 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:4f38:9a5e:fd18:7a9b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf10156d29sm4394455ad.30.2026.07.15.08.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 08:25:57 -0700 (PDT) Date: Wed, 15 Jul 2026 09:25:53 -0600 From: Mathieu Poirier To: "Shenwei Wang (OSS)" Cc: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Frank Li , Sascha Hauer , Shuah Khan , "linux-gpio@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Pengutronix Kernel Team , Fabio Estevam , Shenwei Wang , Peng Fan , "devicetree@vger.kernel.org" , "linux-remoteproc@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , dl-linux-imx , Arnaud POULIQUEN , "b-padhi@ti.com" , Andrew Lunn Subject: Re: [PATCH v14 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus Message-ID: References: <20260625155432.815185-1-shenwei.wang@oss.nxp.com> <20260625155432.815185-2-shenwei.wang@oss.nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jul 14, 2026 at 06:43:30PM +0000, Shenwei Wang (OSS) wrote: > > > > -----Original Message----- > > From: Mathieu Poirier > > Sent: Tuesday, July 14, 2026 11:36 AM > > To: Shenwei Wang (OSS) > > Cc: Linus Walleij ; Bartosz Golaszewski ; > > Jonathan Corbet ; Rob Herring ; Krzysztof > > Kozlowski ; Conor Dooley ; Bjorn > > Andersson ; Frank Li ; Sascha Hauer > > ; Shuah Khan ; linux- > > gpio@vger.kernel.org; linux-doc@vger.kernel.org; linux-kernel@vger.kernel.org; > > Pengutronix Kernel Team ; Fabio Estevam > > ; Shenwei Wang ; Peng Fan > > ; devicetree@vger.kernel.org; linux- > > remoteproc@vger.kernel.org; imx@lists.linux.dev; linux-arm- > > kernel@lists.infradead.org; dl-linux-imx ; Arnaud > > POULIQUEN ; b-padhi@ti.com; Andrew Lunn > > > > Subject: Re: [PATCH v14 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg > > bus > > > > On Tue, Jul 14, 2026 at 02:29:12PM +0000, Shenwei Wang (OSS) wrote: > d > > > > > + - 3: Both edge trigger > > > > > + - 4: High level trigger > > > > > + - 8: Low level trigger > > > > > > > > I'm in agreement with cmd 3, 4, 5 and 6. > > > > > > > > > > How about cmd 2? > > > > Yes, I forgot cmd 2. > > > > > > > > > > + > > > > > +**Reply:** > > > > > + > > > > > +.. code-block:: none > > > > > + > > > > > + +------+--------+--------+ > > > > > + | 0x00 | 0x01 | 0x02 | > > > > > + | 1 | status | 0 | > > > > > + +------+--------+--------+ > > > > > + > > > > > +- **status**: > > > > > + > > > > > + - 0: Ok > > > > > + - 1: Error > > > > > + > > > > > +SET_WAKEUP (Cmd=16) > > > > > +~~~~~~~~~~~~~~~~~~~ > > > > > > > > I already commented on messages that are not part of the virtio-gpio > > > > specification. > > > > > > > > > > I don't believe virtio-gpio needs a SET_WAKEUP command. > > > > > > In the RPMSG case, SET_WAKEUP is required because it performs an > > > operation on the remote processor, so the remote side must be explicitly > > notified. > > > > What operations would that be? > > > > The operation is enabling the line as a wakeup source. In practice, this involves configuring > hardware-specific wakeup settings (e.g., register bits) on the remote processor, so the remote > side must be explicitly notified through SET_WAKEUP. > As I said before, we are not enhancing the virtio-gpio specification. If the functionality is not part of the specification, it is not part of this protocol. > > > > > > > For virtio-gpio, however, everything is handled locally. The other > > > side does not need to perform any action, so sending a SET_WAKEUP command > > appears unnecessary. > > > > What is "everything"? > > > > I mean masking, unmasking, and marking the interrupt as a wakeup source. All of > these operations are handled on local processor. There may be enough capability in your remote processor to do all that, but we can't assume the same applies to all implementations. rpmsg-gpio is not about inventing a new protocol or delegating actions to the remote processor. It is about carrying virtio-gpio packets on top of RPMSG. It needs to operate _exactly_ the same way as virtio-gpio. > > Shenwei > > > > > > > > > > > > + > > > > > +**Request:** > > > > > + > > > > > +.. code-block:: none > > > > > + > > > > > + +------+------+------+------+------+------+------+------+ > > > > > + | 0x00 | 0x01 | 0x02 | 0x03 | 0x04 | 0x05 | 0x06 | 0x07 | > > > > > + | 1 | line | value | > > > > > + +------+------+------+------+------+------+------+------+ > > > > > + > > > > > +- **value**: Wakeup enable. > > > > > + > > > > > + The remote system should always aim to stay in a > > > > > + power-efficient state by shutting down or clock-gating the GPIO > > > > > + blocks that aren't in use. Since the remoteproc driver is > > > > > + responsible for managing the power states of the remote > > > > > + firmware, the GPIO driver does not require to know the firmware's > > running states. > > > > > + > > > > > + When the wakeup bit is set, the remote firmware should > > > > > + configure the line as a wakeup source. The firmware should send > > > > > + the notification message to Linux after it is woken from the GPIO line. > > > > > + > > > > > + - 0: Disable wakeup from GPIO > > > > > + - 1: Enable wakeup from GPIO > > > > > + > > > > > +**Reply:** > > > > > + > > > > > +.. code-block:: none > > > > > + > > > > > + +------+--------+--------+ > > > > > + | 0x00 | 0x01 | 0x02 | > > > > > + | 1 | status | 0 | > > > > > + +------+--------+--------+ > > > > > + > > > > > +- **status**: > > > > > + > > > > > + - 0: Ok > > > > > + - 1: Error > > > > > + > > > > > +Notification Message > > > > > +-------------------- > > > > > > > > "Interrupt Messages" > > > > > > > > > + > > > > > +Notifications are sent by the remote core and they have > > > > > +**Type=2 (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. > > > > > + > > > > > +A Notification message can arrive between a SEND and its REPLY > > > > > +message, and the driver is expected to handle this scenario. > > > > > + > > > > > +.. code-block:: none > > > > > + > > > > > + +------+------+--------+ > > > > > + | 0x00 | 0x01 | 0x02 | > > > > > + | 2 | line | trigger| > > > > > + +------+------+--------+ > > > > > > > > 2 things here: > > > > > > > > 1) You did not include messages that mask and unmask interrupts at > > > > the driver side. > > > > > > Interrupt masking and unmasking are handled entirely on the local processor. > > > > > > When an interrupt occurs, the remote system masks the interrupt and > > > then sends a notification to Linux. After Linux processes the > > > notification, it sends a SET_IRQ_TYPE message back to the remote system, > > which then unmasks the interrupt. > > > > This is the kind of information that should be part of this documentation. > > > > > > > > Thanks, > > > Shenwei > > > > > > > > > > > 2) We are carrying virtio-gpio messages on top of RPMSG and as such, > > > > this whole protocol should be about thar: > > > > > > > > +------+------+--------+-------- > > > > | 0x00 | payload | > > > > | Q | | > > > > +------+------+--------+-------- > > > > > > > > Q = 0 requestq > > > > Q = 1 eventq > > > > > > > > The "payload" part is simply the format of the messages as found in > > > > the virtio- gpio specification. From there, the only thing left to > > > > mention is which messages are not supported, i.e get line names. > > > > > > > > > + > > > > > +- **line**: The GPIO line (pin) index of the port. > > > > > + > > > > > +- **trigger**: Optional parameter to indicate the trigger event type. > > > > > > > > Not part of the spec - remove. > > > > > > > > Given the refactoring work that is still needed, I will not look at > > > > the implementation. > > > > > > > > Thanks, > > > > Mathieu > > > > > > > > > + > > > > > diff --git a/Documentation/driver-api/gpio/index.rst > > > > > b/Documentation/driver-api/gpio/index.rst > > > > > index bee58f709b9a..e5eb1f82f01f 100644 > > > > > --- a/Documentation/driver-api/gpio/index.rst > > > > > +++ b/Documentation/driver-api/gpio/index.rst > > > > > @@ -16,6 +16,7 @@ Contents: > > > > > drivers-on-gpio > > > > > bt8xxgpio > > > > > pca953x > > > > > + gpio-rpmsg > > > > > > > > > > Core > > > > > ==== > > > > > -- > > > > > 2.43.0 > > > > >