All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BUGFIX] can: m_can: make m_can driver work with sleep state pinconfig
@ 2020-06-25 12:24 Lothar Waßmann
  2020-06-25 14:13   ` Dan Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Lothar Waßmann @ 2020-06-25 12:24 UTC (permalink / raw)
  To: Dan Murphy
  Cc: Sriram Dash, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Jakub Kicinski, linux-can, netdev, linux-kernel

Hi,

When trying to use the m_can driver on an stm32mp15 based system, I
found that I could not send or receive any data.
Analyzing the pinctrl registers revealed, that the pins were
configured for sleep state even when the can interfaces were in use.

Looking at the m_can_platform.c driver I found that:

commit f524f829b75a ("can: m_can: Create a m_can platform framework")

introduced a call to m_can_class_suspend() in the m_can_runtime_suspend()
function which wasn't there in the original code and which causes the
pins used by the controller to be configured for sleep state.

commit 0704c5743694 ("can: m_can_platform: remove unnecessary m_can_class_resume() call")
already removed a bogus call to m_can_class_resume() from the
m_can_runtime_resume() function, but failed to remove the matching
call to m_can_class_suspend() from the m_can_runtime_suspend() function.

Removing the bogus call to m_can_class_suspend() in the
m_can_runtime_suspend() function fixes this.

Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
Fixes: 0704c5743694 ("can: m_can_platform: remove unnecessary m_can_class_resume() call")
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/net/can/m_can/m_can_platform.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
index 38ea5e600fb8..e6d0cb9ee02f 100644
--- a/drivers/net/can/m_can/m_can_platform.c
+++ b/drivers/net/can/m_can/m_can_platform.c
@@ -144,8 +144,6 @@ static int __maybe_unused m_can_runtime_suspend(struct device *dev)
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct m_can_classdev *mcan_class = netdev_priv(ndev);
 
-	m_can_class_suspend(dev);
-
 	clk_disable_unprepare(mcan_class->cclk);
 	clk_disable_unprepare(mcan_class->hclk);
 
-- 
2.11.0



-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

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

* Re: [PATCH BUGFIX] can: m_can: make m_can driver work with sleep state pinconfig
  2020-06-25 12:24 [PATCH BUGFIX] can: m_can: make m_can driver work with sleep state pinconfig Lothar Waßmann
@ 2020-06-25 14:13   ` Dan Murphy
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Murphy @ 2020-06-25 14:13 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: Sriram Dash, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Jakub Kicinski, linux-can, netdev, linux-kernel

Lothar

On 6/25/20 7:24 AM, Lothar Waßmann wrote:
> Hi,
>
> When trying to use the m_can driver on an stm32mp15 based system, I
> found that I could not send or receive any data.
> Analyzing the pinctrl registers revealed, that the pins were
> configured for sleep state even when the can interfaces were in use.
>
> Looking at the m_can_platform.c driver I found that:
>
> commit f524f829b75a ("can: m_can: Create a m_can platform framework")
>
> introduced a call to m_can_class_suspend() in the m_can_runtime_suspend()
> function which wasn't there in the original code and which causes the
> pins used by the controller to be configured for sleep state.
>
> commit 0704c5743694 ("can: m_can_platform: remove unnecessary m_can_class_resume() call")
> already removed a bogus call to m_can_class_resume() from the
> m_can_runtime_resume() function, but failed to remove the matching
> call to m_can_class_suspend() from the m_can_runtime_suspend() function.
>
> Removing the bogus call to m_can_class_suspend() in the
> m_can_runtime_suspend() function fixes this.

Thank you for the patch Richard G has already submitted a similar patch

https://lore.kernel.org/patchwork/patch/1253401/

Dan

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

* Re: [PATCH BUGFIX] can: m_can: make m_can driver work with sleep state pinconfig
@ 2020-06-25 14:13   ` Dan Murphy
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Murphy @ 2020-06-25 14:13 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: Sriram Dash, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Jakub Kicinski, linux-can, netdev, linux-kernel

Lothar

On 6/25/20 7:24 AM, Lothar Waßmann wrote:
> Hi,
>
> When trying to use the m_can driver on an stm32mp15 based system, I
> found that I could not send or receive any data.
> Analyzing the pinctrl registers revealed, that the pins were
> configured for sleep state even when the can interfaces were in use.
>
> Looking at the m_can_platform.c driver I found that:
>
> commit f524f829b75a ("can: m_can: Create a m_can platform framework")
>
> introduced a call to m_can_class_suspend() in the m_can_runtime_suspend()
> function which wasn't there in the original code and which causes the
> pins used by the controller to be configured for sleep state.
>
> commit 0704c5743694 ("can: m_can_platform: remove unnecessary m_can_class_resume() call")
> already removed a bogus call to m_can_class_resume() from the
> m_can_runtime_resume() function, but failed to remove the matching
> call to m_can_class_suspend() from the m_can_runtime_suspend() function.
>
> Removing the bogus call to m_can_class_suspend() in the
> m_can_runtime_suspend() function fixes this.

Thank you for the patch Richard G has already submitted a similar patch

https://lore.kernel.org/patchwork/patch/1253401/

Dan



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

end of thread, other threads:[~2020-06-25 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-25 12:24 [PATCH BUGFIX] can: m_can: make m_can driver work with sleep state pinconfig Lothar Waßmann
2020-06-25 14:13 ` Dan Murphy
2020-06-25 14:13   ` Dan Murphy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.