diff options
author | Sanchayan Maity <maitysanchayan@gmail.com> | 2017-04-26 13:30:14 +0530 |
---|---|---|
committer | Philippe Schenker <philippe.schenker@toradex.com> | 2019-05-09 11:13:49 +0200 |
commit | 12bc3add037ec3015602914aab74932d209327fd (patch) | |
tree | 29af7805f8dc5cebc10d9b0d1402e2a566ae78c1 /drivers/net | |
parent | fa05fa428cba3ffd6f4bd533d564be4817c14ed3 (diff) |
net: can: flexcan: Fix wakeup on CAN from suspend issue
Do not disable peripheral while entering suspend mode. Disabling
the peripheral does not allow waking up from suspend on a CAN
frame reception.
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
(cherry picked from commit f972815d2a4db5c93ded76bd11b660261e41f28c)
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/flexcan.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 7abab349f54d..f971d3432f9c 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -1716,6 +1716,7 @@ static int __maybe_unused flexcan_suspend(struct device *device) struct net_device *dev = dev_get_drvdata(device); struct flexcan_priv *priv = netdev_priv(dev); int ret = 0; + int err = 0; if (netif_running(dev)) { netif_stop_queue(dev); @@ -1728,7 +1729,12 @@ static int __maybe_unused flexcan_suspend(struct device *device) enable_irq_wake(dev->irq); flexcan_enter_stop_mode(priv); } else { - flexcan_chip_stop(dev); + err = flexcan_chip_disable(priv); + if (err) { + netif_device_attach(dev); + netif_start_queue(dev); + return err; + } ret = pm_runtime_force_suspend(device); } } |