netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/6] can: flexcan: fixes for stop mode
@ 2019-12-04 11:36 Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 1/6] can: flexcan: fix deadlock when using self wakeup Joakim Zhang
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-04 11:36 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev, Joakim Zhang

Hi Marc,

   I removed the patch (can: flexcan: try to exit stop mode during probe stage)
out of this patch set for now. This patch should further discuss with Sean and
I will prepare it according to final conclusion. Thanks.

Regards,
Joakim Zhang

Joakim Zhang (5):
  can: flexcan: Ack wakeup interrupt separately
  can: flexcan: add low power enter/exit acknowledgment helper
  can: flexcan: change the way of stop mode acknowledgment
  can: flexcan: propagate error value of flexcan_chip_stop()
  can: flexcan: add LPSR mode support

Sean Nyekjaer (1):
  can: flexcan: fix deadlock when using self wakeup

 drivers/net/can/flexcan.c | 131 +++++++++++++++++++++++---------------
 1 file changed, 79 insertions(+), 52 deletions(-)

-- 
2.17.1


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

* [PATCH V3 1/6] can: flexcan: fix deadlock when using self wakeup
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
@ 2019-12-04 11:36 ` Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 2/6] can: flexcan: Ack wakeup interrupt separately Joakim Zhang
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-04 11:36 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev, Joakim Zhang

From: Sean Nyekjaer <sean@geanix.com>

When suspending, when there is still can traffic on the interfaces the
flexcan immediately wakes the platform again. As it should :-). But it
throws this error msg:
[ 3169.378661] PM: noirq suspend of devices failed

On the way down to suspend the interface that throws the error message does
call flexcan_suspend but fails to call flexcan_noirq_suspend. That means
flexcan_enter_stop_mode is called, but on the way out of suspend the driver
only calls flexcan_resume and skips flexcan_noirq_resume, thus it doesn't
call flexcan_exit_stop_mode. This leaves the flexcan in stop mode, and with
the current driver it can't recover from this even with a soft reboot, it
requires a hard reboot.

This patch can fix deadlock when using self wakeup, it happenes to be
able to fix another issue that frames out-of-order in first IRQ handler
run after wakeup.

In wakeup case, after system resume, frames received out-of-order in
first IRQ handler, the problem is wakeup latency from frame reception to
IRQ handler is much bigger than the counter overflow. This means it's
impossible to sort the CAN frames by timestamp. The reason is that controller
exits stop mode during noirq resume, then it can receive the frame immediately.
If noirq reusme stage consumes much time, it will extend interrupt response
time. So exit stop mode during resume stage instead of noirq resume can
fix this issue.

Fixes: de3578c198c6 ("can: flexcan: add self wakeup support")
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
------
ChangeLog:
	V1->V2: *no change.

	V2->V3: *split wakeup interrupt ack into another patch.
---
 drivers/net/can/flexcan.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 2efa06119f68..99aae90c1cdd 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1722,6 +1722,9 @@ static int __maybe_unused flexcan_resume(struct device *device)
 		netif_start_queue(dev);
 		if (device_may_wakeup(device)) {
 			disable_irq_wake(dev->irq);
+			err = flexcan_exit_stop_mode(priv);
+			if (err)
+				return err;
 		} else {
 			err = pm_runtime_force_resume(device);
 			if (err)
@@ -1767,14 +1770,9 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
 {
 	struct net_device *dev = dev_get_drvdata(device);
 	struct flexcan_priv *priv = netdev_priv(dev);
-	int err;
 
-	if (netif_running(dev) && device_may_wakeup(device)) {
+	if (netif_running(dev) && device_may_wakeup(device))
 		flexcan_enable_wakeup_irq(priv, false);
-		err = flexcan_exit_stop_mode(priv);
-		if (err)
-			return err;
-	}
 
 	return 0;
 }
-- 
2.17.1


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

* [PATCH V3 2/6] can: flexcan: Ack wakeup interrupt separately
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 1/6] can: flexcan: fix deadlock when using self wakeup Joakim Zhang
@ 2019-12-04 11:36 ` Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 3/6] can: flexcan: add low power enter/exit acknowledgment helper Joakim Zhang
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-04 11:36 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev, Joakim Zhang

As FLEXCAN_ESR_ALL_INT is for all bus errors and state change IRQ
sources, and FLEXCAN_ESR_WAK_INT does not belong to these. So add
wakeup interrupt ack separately to existing ack of the interrupts.

Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
------
ChangeLog:
	V3: *split from the patch
	     can: flexcan: fix deadlock when using self wakeup
---
 drivers/net/can/flexcan.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 99aae90c1cdd..1b33936790b4 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -134,8 +134,7 @@
 	(FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE)
 #define FLEXCAN_ESR_ALL_INT \
 	(FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | \
-	 FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT | \
-	 FLEXCAN_ESR_WAK_INT)
+	 FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
 
 /* FLEXCAN interrupt flag register (IFLAG) bits */
 /* Errata ERR005829 step7: Reserve first valid MB */
@@ -960,10 +959,10 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 
 	reg_esr = priv->read(&regs->esr);
 
-	/* ACK all bus error and state change IRQ sources */
-	if (reg_esr & FLEXCAN_ESR_ALL_INT) {
+	/* ACK all bus error, state change and wake IRQ sources */
+	if (reg_esr & (FLEXCAN_ESR_ALL_INT | FLEXCAN_ESR_WAK_INT)) {
 		handled = IRQ_HANDLED;
-		priv->write(reg_esr & FLEXCAN_ESR_ALL_INT, &regs->esr);
+		priv->write(reg_esr & (FLEXCAN_ESR_ALL_INT | FLEXCAN_ESR_WAK_INT), &regs->esr);
 	}
 
 	/* state change interrupt or broken error state quirk fix is enabled */
-- 
2.17.1


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

* [PATCH V3 3/6] can: flexcan: add low power enter/exit acknowledgment helper
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 1/6] can: flexcan: fix deadlock when using self wakeup Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 2/6] can: flexcan: Ack wakeup interrupt separately Joakim Zhang
@ 2019-12-04 11:36 ` Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 4/6] can: flexcan: change the way of stop mode acknowledgment Joakim Zhang
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-04 11:36 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev, Joakim Zhang

MCR[LPMACK] this read-only bit indicates that FlexCAN is in a
lower-power mode (Disabled mode, Doze mode, Stop mode), CPU can poll
this bit to know when FlexCAN has actually entered low power mode.
Low power enter/exit acknowledgment helper will reduce code duplication
for disabled mode, doze mode and stop mode.

Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
-----
ChangeLog:
	V3: * split from patch
	      can: flexcan: change the way of stop mode acknowledgment
---
 drivers/net/can/flexcan.c | 46 +++++++++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 16 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 1b33936790b4..6c4f1bab7042 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -388,6 +388,34 @@ static struct flexcan_mb __iomem *flexcan_get_mb(const struct flexcan_priv *priv
 		(&priv->regs->mb[bank][priv->mb_size * mb_index]);
 }
 
+static int flexcan_low_power_enter_ack(struct flexcan_priv *priv)
+{
+	struct flexcan_regs __iomem *regs = priv->regs;
+	unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
+
+	while (timeout-- && !(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
+		udelay(10);
+
+	if (!(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
+		return -ETIMEDOUT;
+
+	return 0;
+}
+
+static int flexcan_low_power_exit_ack(struct flexcan_priv *priv)
+{
+	struct flexcan_regs __iomem *regs = priv->regs;
+	unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
+
+	while (timeout-- && (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
+		udelay(10);
+
+	if (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK)
+		return -ETIMEDOUT;
+
+	return 0;
+}
+
 static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable)
 {
 	struct flexcan_regs __iomem *regs = priv->regs;
@@ -505,39 +533,25 @@ static inline int flexcan_transceiver_disable(const struct flexcan_priv *priv)
 static int flexcan_chip_enable(struct flexcan_priv *priv)
 {
 	struct flexcan_regs __iomem *regs = priv->regs;
-	unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
 	u32 reg;
 
 	reg = priv->read(&regs->mcr);
 	reg &= ~FLEXCAN_MCR_MDIS;
 	priv->write(reg, &regs->mcr);
 
-	while (timeout-- && (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
-		udelay(10);
-
-	if (priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK)
-		return -ETIMEDOUT;
-
-	return 0;
+	return flexcan_low_power_exit_ack(priv);
 }
 
 static int flexcan_chip_disable(struct flexcan_priv *priv)
 {
 	struct flexcan_regs __iomem *regs = priv->regs;
-	unsigned int timeout = FLEXCAN_TIMEOUT_US / 10;
 	u32 reg;
 
 	reg = priv->read(&regs->mcr);
 	reg |= FLEXCAN_MCR_MDIS;
 	priv->write(reg, &regs->mcr);
 
-	while (timeout-- && !(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
-		udelay(10);
-
-	if (!(priv->read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
-		return -ETIMEDOUT;
-
-	return 0;
+	return flexcan_low_power_enter_ack(priv);
 }
 
 static int flexcan_chip_freeze(struct flexcan_priv *priv)
-- 
2.17.1


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

* [PATCH V3 4/6] can: flexcan: change the way of stop mode acknowledgment
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
                   ` (2 preceding siblings ...)
  2019-12-04 11:36 ` [PATCH V3 3/6] can: flexcan: add low power enter/exit acknowledgment helper Joakim Zhang
@ 2019-12-04 11:36 ` Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 5/6] can: flexcan: propagate error value of flexcan_chip_stop() Joakim Zhang
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-04 11:36 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev, Joakim Zhang

Stop mode is entered when Stop mode is requested at chip level and
MCR[LPM_ACK] is asserted by the FlexCAN.

Double check with IP owner, should poll MCR[LPM_ACK] for stop mode
acknowledgment, not the acknowledgment from chip level which is used
to gate flexcan clocks.

Fixes: 5f186c257fa4 (can: flexcan: fix stop mode acknowledgment)
Tested-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
-----
ChangeLog:
	V1->V2: * no change.

	V2->V3: * spilt the patch.
---
 drivers/net/can/flexcan.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 6c4f1bab7042..19602b77907f 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -434,7 +434,6 @@ static void flexcan_enable_wakeup_irq(struct flexcan_priv *priv, bool enable)
 static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
 {
 	struct flexcan_regs __iomem *regs = priv->regs;
-	unsigned int ackval;
 	u32 reg_mcr;
 
 	reg_mcr = priv->read(&regs->mcr);
@@ -445,36 +444,24 @@ static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
 	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
 			   1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
 
-	/* get stop acknowledgment */
-	if (regmap_read_poll_timeout(priv->stm.gpr, priv->stm.ack_gpr,
-				     ackval, ackval & (1 << priv->stm.ack_bit),
-				     0, FLEXCAN_TIMEOUT_US))
-		return -ETIMEDOUT;
-
-	return 0;
+	return flexcan_low_power_enter_ack(priv);
 }
 
 static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
 {
 	struct flexcan_regs __iomem *regs = priv->regs;
-	unsigned int ackval;
 	u32 reg_mcr;
 
 	/* remove stop request */
 	regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
 			   1 << priv->stm.req_bit, 0);
 
-	/* get stop acknowledgment */
-	if (regmap_read_poll_timeout(priv->stm.gpr, priv->stm.ack_gpr,
-				     ackval, !(ackval & (1 << priv->stm.ack_bit)),
-				     0, FLEXCAN_TIMEOUT_US))
-		return -ETIMEDOUT;
 
 	reg_mcr = priv->read(&regs->mcr);
 	reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
 	priv->write(reg_mcr, &regs->mcr);
 
-	return 0;
+	return flexcan_low_power_exit_ack(priv);
 }
 
 static inline void flexcan_error_irq_enable(const struct flexcan_priv *priv)
-- 
2.17.1


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

* [PATCH V3 5/6] can: flexcan: propagate error value of flexcan_chip_stop()
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
                   ` (3 preceding siblings ...)
  2019-12-04 11:36 ` [PATCH V3 4/6] can: flexcan: change the way of stop mode acknowledgment Joakim Zhang
@ 2019-12-04 11:36 ` Joakim Zhang
  2019-12-04 11:36 ` [PATCH V3 6/6] can: flexcan: add LPSR mode support Joakim Zhang
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-04 11:36 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev, Joakim Zhang

Propagate error value of flexcan_chip_stop(), since this could be called
from flexcan_suspend() in some SoCs which support LPSR mode.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
------
ChangeLog:
	V3: * new add.
---
 drivers/net/can/flexcan.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 19602b77907f..c5e4b6928dee 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1263,14 +1263,19 @@ static int flexcan_chip_start(struct net_device *dev)
  *
  * this functions is entered with clocks enabled
  */
-static void flexcan_chip_stop(struct net_device *dev)
+static int flexcan_chip_stop(struct net_device *dev)
 {
 	struct flexcan_priv *priv = netdev_priv(dev);
 	struct flexcan_regs __iomem *regs = priv->regs;
+	int err;
 
 	/* freeze + disable module */
-	flexcan_chip_freeze(priv);
-	flexcan_chip_disable(priv);
+	err = flexcan_chip_freeze(priv);
+	if (err)
+		return err;
+	err = flexcan_chip_disable(priv);
+	if (err)
+		goto out_chip_unfreeze;
 
 	/* Disable all interrupts */
 	priv->write(0, &regs->imask2);
@@ -1278,8 +1283,19 @@ static void flexcan_chip_stop(struct net_device *dev)
 	priv->write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
 		    &regs->ctrl);
 
-	flexcan_transceiver_disable(priv);
+	err = flexcan_transceiver_disable(priv);
+	if (err)
+		goto out_chip_enable;
+
 	priv->can.state = CAN_STATE_STOPPED;
+
+	return 0;
+
+out_chip_enable:
+	flexcan_chip_enable(priv);
+out_chip_unfreeze:
+	flexcan_chip_unfreeze(priv);
+	return err;
 }
 
 static int flexcan_open(struct net_device *dev)
-- 
2.17.1


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

* [PATCH V3 6/6] can: flexcan: add LPSR mode support
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
                   ` (4 preceding siblings ...)
  2019-12-04 11:36 ` [PATCH V3 5/6] can: flexcan: propagate error value of flexcan_chip_stop() Joakim Zhang
@ 2019-12-04 11:36 ` Joakim Zhang
  2019-12-06  7:52 ` [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
  2019-12-07 14:10 ` Marc Kleine-Budde
  7 siblings, 0 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-04 11:36 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev, Joakim Zhang

For i.MX7D LPSR mode, the controller will lost power and got the
configuration state lost after system resume back. (coming i.MX8QM/QXP
will also completely power off the domain, the controller state will be
lost and needs restore).
So we need to set pinctrl state again and re-start chip to do
re-configuration after resume.

For wakeup case, it should not set pinctrl to sleep state by
pinctrl_pm_select_sleep_state.
For interface is not up before suspend case, we don't need
re-configure as it will be configured by user later by interface up.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
------
ChangeLog:
	V1->V2: *no change.

	V2->V3: *add error handling for pinctrl_pm_xx_xx_state()
		 function.
---
 drivers/net/can/flexcan.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index c5e4b6928dee..3570ebe3b8f2 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -26,6 +26,7 @@
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/regmap.h>
 
 #define DRV_NAME			"flexcan"
@@ -1700,7 +1701,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 err = 0;
+	int err;
 
 	if (netif_running(dev)) {
 		/* if wakeup is enabled, enter stop mode
@@ -1712,25 +1713,31 @@ static int __maybe_unused flexcan_suspend(struct device *device)
 			if (err)
 				return err;
 		} else {
-			err = flexcan_chip_disable(priv);
+			err = flexcan_chip_stop(dev);
 			if (err)
 				return err;
 
 			err = pm_runtime_force_suspend(device);
+			if (err)
+				return err;
+
+			err = pinctrl_pm_select_sleep_state(device);
+			if (err)
+				return err;
 		}
 		netif_stop_queue(dev);
 		netif_device_detach(dev);
 	}
 	priv->can.state = CAN_STATE_SLEEPING;
 
-	return err;
+	return 0;
 }
 
 static int __maybe_unused flexcan_resume(struct device *device)
 {
 	struct net_device *dev = dev_get_drvdata(device);
 	struct flexcan_priv *priv = netdev_priv(dev);
-	int err = 0;
+	int err;
 
 	priv->can.state = CAN_STATE_ERROR_ACTIVE;
 	if (netif_running(dev)) {
@@ -1742,15 +1749,21 @@ static int __maybe_unused flexcan_resume(struct device *device)
 			if (err)
 				return err;
 		} else {
+			err = pinctrl_pm_select_default_state(device);
+			if (err)
+				return err;
+
 			err = pm_runtime_force_resume(device);
 			if (err)
 				return err;
 
-			err = flexcan_chip_enable(priv);
+			err = flexcan_chip_start(dev);
+			if (err)
+				return err;
 		}
 	}
 
-	return err;
+	return 0;
 }
 
 static int __maybe_unused flexcan_runtime_suspend(struct device *device)
-- 
2.17.1


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

* RE: [PATCH V3 0/6] can: flexcan: fixes for stop mode
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
                   ` (5 preceding siblings ...)
  2019-12-04 11:36 ` [PATCH V3 6/6] can: flexcan: add LPSR mode support Joakim Zhang
@ 2019-12-06  7:52 ` Joakim Zhang
  2019-12-07 14:10 ` Marc Kleine-Budde
  7 siblings, 0 replies; 11+ messages in thread
From: Joakim Zhang @ 2019-12-06  7:52 UTC (permalink / raw)
  To: mkl, sean, linux-can; +Cc: dl-linux-imx, netdev


> -----Original Message-----
> From: Joakim Zhang <qiangqing.zhang@nxp.com>
> Sent: 2019年12月4日 19:36
> To: mkl@pengutronix.de; sean@geanix.com; linux-can@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>; netdev@vger.kernel.org; Joakim Zhang
> <qiangqing.zhang@nxp.com>
> Subject: [PATCH V3 0/6] can: flexcan: fixes for stop mode
> 
> Hi Marc,
> 
>    I removed the patch (can: flexcan: try to exit stop mode during probe stage)
> out of this patch set for now. This patch should further discuss with Sean and I
> will prepare it according to final conclusion. Thanks.

Hi Marc,

After discussed with Sean, CAN-IP stuck in stop mode disappeared with patch(can: flexcan: fix deadlock when using self wakeup), so I think we don't need
another patch to fix the same issue. But this fix patch had better go to stable tree.

Any comments about this patch set?

Best Regards,
Joakim Zhang
> Regards,
> Joakim Zhang
> 
> Joakim Zhang (5):
>   can: flexcan: Ack wakeup interrupt separately
>   can: flexcan: add low power enter/exit acknowledgment helper
>   can: flexcan: change the way of stop mode acknowledgment
>   can: flexcan: propagate error value of flexcan_chip_stop()
>   can: flexcan: add LPSR mode support
> 
> Sean Nyekjaer (1):
>   can: flexcan: fix deadlock when using self wakeup
> 
>  drivers/net/can/flexcan.c | 131 +++++++++++++++++++++++---------------
>  1 file changed, 79 insertions(+), 52 deletions(-)
> 
> --
> 2.17.1


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

* Re: [PATCH V3 0/6] can: flexcan: fixes for stop mode
  2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
                   ` (6 preceding siblings ...)
  2019-12-06  7:52 ` [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
@ 2019-12-07 14:10 ` Marc Kleine-Budde
  2019-12-09  8:28   ` Joakim Zhang
  7 siblings, 1 reply; 11+ messages in thread
From: Marc Kleine-Budde @ 2019-12-07 14:10 UTC (permalink / raw)
  To: Joakim Zhang, sean, linux-can; +Cc: dl-linux-imx, netdev


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

On 12/4/19 12:36 PM, Joakim Zhang wrote:
> Hi Marc,
> 
>    I removed the patch (can: flexcan: try to exit stop mode during probe stage)
> out of this patch set for now. This patch should further discuss with Sean and
> I will prepare it according to final conclusion. Thanks.
> 
> Regards,
> Joakim Zhang
> 
> Joakim Zhang (5):
>   can: flexcan: Ack wakeup interrupt separately
>   can: flexcan: add low power enter/exit acknowledgment helper
>   can: flexcan: change the way of stop mode acknowledgment

Above 3 applied to linux-can.

>   can: flexcan: propagate error value of flexcan_chip_stop()
>   can: flexcan: add LPSR mode support

Above 2 applied to linux-can-next

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] 11+ messages in thread

* RE: [PATCH V3 0/6] can: flexcan: fixes for stop mode
  2019-12-07 14:10 ` Marc Kleine-Budde
@ 2019-12-09  8:28   ` Joakim Zhang
  2019-12-09  8:43     ` Marc Kleine-Budde
  0 siblings, 1 reply; 11+ messages in thread
From: Joakim Zhang @ 2019-12-09  8:28 UTC (permalink / raw)
  To: Marc Kleine-Budde, sean, linux-can; +Cc: dl-linux-imx, netdev


> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: 2019年12月7日 22:11
> To: Joakim Zhang <qiangqing.zhang@nxp.com>; sean@geanix.com;
> linux-can@vger.kernel.org
> Cc: dl-linux-imx <linux-imx@nxp.com>; netdev@vger.kernel.org
> Subject: Re: [PATCH V3 0/6] can: flexcan: fixes for stop mode
> 
> On 12/4/19 12:36 PM, Joakim Zhang wrote:
> > Hi Marc,
> >
> >    I removed the patch (can: flexcan: try to exit stop mode during
> > probe stage) out of this patch set for now. This patch should further
> > discuss with Sean and I will prepare it according to final conclusion. Thanks.
> >
> > Regards,
> > Joakim Zhang
> >
> > Joakim Zhang (5):
> >   can: flexcan: Ack wakeup interrupt separately
> >   can: flexcan: add low power enter/exit acknowledgment helper
> >   can: flexcan: change the way of stop mode acknowledgment
> 
> Above 3 applied to linux-can.
Hi Marc,

From below link, I have not found the patch: can: flexcan: Ack wakeup interrupt separately
https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git/log/?h=linux-can-fixes-for-5.5-20191208

> >   can: flexcan: propagate error value of flexcan_chip_stop()
> >   can: flexcan: add LPSR mode support
> 
> Above 2 applied to linux-can-next

I also have not found these two patch on linux-can-next, which branch has you pushed?

Thanks.

Best Regards,
Joakim Zhang
> 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 |


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

* Re: [PATCH V3 0/6] can: flexcan: fixes for stop mode
  2019-12-09  8:28   ` Joakim Zhang
@ 2019-12-09  8:43     ` Marc Kleine-Budde
  0 siblings, 0 replies; 11+ messages in thread
From: Marc Kleine-Budde @ 2019-12-09  8:43 UTC (permalink / raw)
  To: Joakim Zhang, sean, linux-can; +Cc: dl-linux-imx, netdev


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

On 12/9/19 9:28 AM, Joakim Zhang wrote:
> 
>> -----Original Message-----
>> From: Marc Kleine-Budde <mkl@pengutronix.de>
>> Sent: 2019年12月7日 22:11
>> To: Joakim Zhang <qiangqing.zhang@nxp.com>; sean@geanix.com;
>> linux-can@vger.kernel.org
>> Cc: dl-linux-imx <linux-imx@nxp.com>; netdev@vger.kernel.org
>> Subject: Re: [PATCH V3 0/6] can: flexcan: fixes for stop mode
>>
>> On 12/4/19 12:36 PM, Joakim Zhang wrote:
>>> Hi Marc,
>>>
>>>    I removed the patch (can: flexcan: try to exit stop mode during
>>> probe stage) out of this patch set for now. This patch should further
>>> discuss with Sean and I will prepare it according to final conclusion. Thanks.
>>>
>>> Regards,
>>> Joakim Zhang
>>>
>>> Joakim Zhang (5):
>>>   can: flexcan: Ack wakeup interrupt separately
>>>   can: flexcan: add low power enter/exit acknowledgment helper
>>>   can: flexcan: change the way of stop mode acknowledgment
>>
>> Above 3 applied to linux-can.
> 
> From below link, I have not found the patch: can: flexcan: Ack wakeup interrupt separately
> https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git/log/?h=linux-can-fixes-for-5.5-20191208

Right, "Ack wakeup interrupt separately" went into linux-can-next.

>>>   can: flexcan: propagate error value of flexcan_chip_stop()
>>>   can: flexcan: add LPSR mode support
>>
>> Above 2 applied to linux-can-next
> 
> I also have not found these two patch on linux-can-next, which branch has you pushed?

It's in linux-can-test/testing.

I just pushed both linux-can/testing and linux-can-test/testing.

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] 11+ messages in thread

end of thread, other threads:[~2019-12-09  8:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04 11:36 [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
2019-12-04 11:36 ` [PATCH V3 1/6] can: flexcan: fix deadlock when using self wakeup Joakim Zhang
2019-12-04 11:36 ` [PATCH V3 2/6] can: flexcan: Ack wakeup interrupt separately Joakim Zhang
2019-12-04 11:36 ` [PATCH V3 3/6] can: flexcan: add low power enter/exit acknowledgment helper Joakim Zhang
2019-12-04 11:36 ` [PATCH V3 4/6] can: flexcan: change the way of stop mode acknowledgment Joakim Zhang
2019-12-04 11:36 ` [PATCH V3 5/6] can: flexcan: propagate error value of flexcan_chip_stop() Joakim Zhang
2019-12-04 11:36 ` [PATCH V3 6/6] can: flexcan: add LPSR mode support Joakim Zhang
2019-12-06  7:52 ` [PATCH V3 0/6] can: flexcan: fixes for stop mode Joakim Zhang
2019-12-07 14:10 ` Marc Kleine-Budde
2019-12-09  8:28   ` Joakim Zhang
2019-12-09  8:43     ` 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).