devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Frank Li <Frank.li@nxp.com>
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-can@vger.kernel.org,  netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	 haibo.chen@nxp.com, imx@lists.linux.dev, han.xu@nxp.com
Subject: Re: [PATCH v2 4/4] can: flexcan: add wakeup support for imx95
Date: Tue, 16 Jul 2024 16:45:33 +0200	[thread overview]
Message-ID: <20240716-chowchow-of-massive-joviality-77e833-mkl@pengutronix.de> (raw)
In-Reply-To: <ZpaF4Wc70VuV4Cti@lizhi-Precision-Tower-5810>

[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]

On 16.07.2024 10:40:31, Frank Li wrote:
> > > @@ -2330,9 +2366,12 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
> > >  	if (netif_running(dev)) {
> > >  		int err;
> > >  
> > > -		err = pm_runtime_force_resume(device);
> > > -		if (err)
> > > -			return err;
> > > +		if (!(device_may_wakeup(device) &&
> >                       ^^^^^^^^^^^^^^^^^^^^^^^^
> > 
> > Where does this come from?
> 
> include/linux/pm_wakeup.h
> 
> static inline bool device_may_wakeup(struct device *dev)                                            
> {                                                                                                   
>         return dev->power.can_wakeup && !!dev->power.wakeup;                                        
> }

Sorry for the confusion. I wanted to point out, that the original driver
doesn't have the check to device_may_wakeup(). Why was this added?

> > 
> > > +		      priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCMI)) {
> > > +			err = pm_runtime_force_resume(device);
> > > +			if (err)
> > > +				return err;
> > > +		}
> > >  
> > >  		if (device_may_wakeup(device))
> > >  			flexcan_enable_wakeup_irq(priv, false);
> > > diff --git a/drivers/net/can/flexcan/flexcan.h b/drivers/net/can/flexcan/flexcan.h
> > > index 025c3417031f4..4933d8c7439e6 100644
> > > --- a/drivers/net/can/flexcan/flexcan.h
> > > +++ b/drivers/net/can/flexcan/flexcan.h
> > > @@ -68,6 +68,8 @@
> > >  #define FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR BIT(15)
> > >  /* Device supports RX via FIFO */
> > >  #define FLEXCAN_QUIRK_SUPPORT_RX_FIFO BIT(16)
> > > +/* Setup stop mode with ATF SCMI protocol to support wakeup */
> > > +#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCMI BIT(17)
> > >  
> > >  struct flexcan_devtype_data {
> > >  	u32 quirks;		/* quirks needed for different IP cores */

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-07-16 17:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 21:27 [PATCH v2 0/4] can: fsl,flexcan: add fsl,s32v234-flexcan and imx95 wakeup Frank Li
2024-07-15 21:27 ` [PATCH v2 1/4] dt-bindings: can: fsl,flexcan: add compatible string fsl,s32v234-flexcan Frank Li
2024-07-15 21:27 ` [PATCH v2 2/4] can: flexcan: Add S32V234 support to FlexCAN driver Frank Li
2024-07-16  6:56   ` Marc Kleine-Budde
2024-07-15 21:27 ` [PATCH v2 3/4] bingdings: can: flexcan: move fsl,imx95-flexcan standalone Frank Li
2024-07-15 21:27 ` [PATCH v2 4/4] can: flexcan: add wakeup support for imx95 Frank Li
2024-07-16  7:06   ` Marc Kleine-Budde
2024-07-16 14:40     ` Frank Li
2024-07-16 14:45       ` Marc Kleine-Budde [this message]
2024-07-17  2:03         ` Bough Chen
2024-07-17  7:20           ` Marc Kleine-Budde

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=20240716-chowchow-of-massive-joviality-77e833-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=Frank.li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=haibo.chen@nxp.com \
    --cc=han.xu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).