linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH V4] can: flexcan: disable wakeup in flexcan_remove()
  2020-10-20 18:45 [PATCH V4] can: flexcan: disable wakeup in flexcan_remove() Joakim Zhang
@ 2020-10-20 11:05 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2020-10-20 11:05 UTC (permalink / raw)
  To: Joakim Zhang; +Cc: linux-imx, linux-can


[-- Attachment #1.1: Type: text/plain, Size: 1304 bytes --]

On 10/20/20 8:45 PM, Joakim Zhang wrote:
> With below sequence, we can see wakeup default is enabled after re-load
> module, so need disable wakeup in flexcan_remove().
> 
> root@imx8qmevk:~# lsmod
> Module                  Size  Used by
> crct10dif_ce           16384  1
> flexcan                32768  0
> can_dev                36864  1 flexcan
> root@imx8qmevk:~# cat /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
> disabled
> root@imx8qmevk:~# echo enabled > /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
> root@imx8qmevk:~# cat /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
> enabled
> root@imx8qmevk:~# rmmod flexcan
> root@imx8qmevk:~# rmmod can_dev
> root@imx8qmevk:~# modprobe flexcan
> [  147.877689] CAN device driver interface
> root@imx8qmevk:~# cat /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
> enabled

Very good, that explain the problem!

I've streamlined the commit message a bit and applied to linux-can/testing

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH V4] can: flexcan: disable wakeup in flexcan_remove()
@ 2020-10-20 18:45 Joakim Zhang
  2020-10-20 11:05 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Joakim Zhang @ 2020-10-20 18:45 UTC (permalink / raw)
  To: mkl; +Cc: linux-imx, linux-can

With below sequence, we can see wakeup default is enabled after re-load
module, so need disable wakeup in flexcan_remove().

root@imx8qmevk:~# lsmod
Module                  Size  Used by
crct10dif_ce           16384  1
flexcan                32768  0
can_dev                36864  1 flexcan
root@imx8qmevk:~# cat /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
disabled
root@imx8qmevk:~# echo enabled > /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
root@imx8qmevk:~# cat /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
enabled
root@imx8qmevk:~# rmmod flexcan
root@imx8qmevk:~# rmmod can_dev
root@imx8qmevk:~# modprobe flexcan
[  147.877689] CAN device driver interface
root@imx8qmevk:~# cat /sys/bus/platform/drivers/flexcan/5a8e0000.can/power/wakeup
enabled

Fixes: de3578c198c6 ("can: flexcan: add self wakeup support")
Fixes: 915f9666421c ("can: flexcan: add support for DT property 'wakeup-source'")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/can/flexcan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 06f94b6f0ebe..881799bd9c5e 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -2062,6 +2062,8 @@ static int flexcan_remove(struct platform_device *pdev)
 {
 	struct net_device *dev = platform_get_drvdata(pdev);
 
+	device_set_wakeup_enable(&pdev->dev, false);
+	device_set_wakeup_capable(&pdev->dev, false);
 	unregister_flexcandev(dev);
 	pm_runtime_disable(&pdev->dev);
 	free_candev(dev);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-20 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 18:45 [PATCH V4] can: flexcan: disable wakeup in flexcan_remove() Joakim Zhang
2020-10-20 11:05 ` Marc Kleine-Budde

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).