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: <20240716-chowchow-of-massive-joviality-77e833-mkl@pengutronix.de>
Date: Tue, 16 Jul 2024 16:45:33 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Frank Li <Frank.li@....com>
Cc: Vincent Mailhol <mailhol.vincent@...adoo.fr>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Rob Herring <robh@...nel.org>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, linux-can@...r.kernel.org, 
	netdev@...r.kernel.org, devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, 
	haibo.chen@....com, imx@...ts.linux.dev, han.xu@....com
Subject: Re: [PATCH v2 4/4] can: flexcan: add wakeup support for imx95

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   |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ