* [PATCH 1/2] can: m_can_platform: set net_device structure as driver data
2019-11-19 10:20 ` [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Pankaj Sharma
@ 2019-11-19 10:20 ` Pankaj Sharma
2019-11-19 14:43 ` Dan Murphy
2019-11-19 10:20 ` [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call Pankaj Sharma
2019-12-05 20:57 ` [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Dan Murphy
2 siblings, 1 reply; 8+ messages in thread
From: Pankaj Sharma @ 2019-11-19 10:20 UTC (permalink / raw)
To: linux-can, netdev, linux-kernel
Cc: wg, mkl, davem, dmurphy, rcsekar, pankaj.dubey, Pankaj Sharma,
Sriram Dash
A device driver for CAN controller hardware registers itself with the
Linux network layer as a network device. So, the driver data for m_can
should ideally be of type net_device.
Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
Signed-off-by: Pankaj Sharma <pankj.sharma@samsung.com>
Signed-off-by: Sriram Dash <sriram.dash@samsung.com>
---
drivers/net/can/m_can/m_can_platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
index 6ac4c35..2eaa354 100644
--- a/drivers/net/can/m_can/m_can_platform.c
+++ b/drivers/net/can/m_can/m_can_platform.c
@@ -107,7 +107,7 @@ static int m_can_plat_probe(struct platform_device *pdev)
mcan_class->is_peripheral = false;
- platform_set_drvdata(pdev, mcan_class->dev);
+ platform_set_drvdata(pdev, mcan_class->net);
m_can_init_ram(mcan_class);
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 1/2] can: m_can_platform: set net_device structure as driver data
2019-11-19 10:20 ` [PATCH 1/2] can: m_can_platform: set net_device structure as driver data Pankaj Sharma
@ 2019-11-19 14:43 ` Dan Murphy
0 siblings, 0 replies; 8+ messages in thread
From: Dan Murphy @ 2019-11-19 14:43 UTC (permalink / raw)
To: Pankaj Sharma, linux-can, netdev, linux-kernel
Cc: wg, mkl, davem, rcsekar, pankaj.dubey, Sriram Dash
Pankaj
On 11/19/19 4:20 AM, Pankaj Sharma wrote:
> A device driver for CAN controller hardware registers itself with the
> Linux network layer as a network device. So, the driver data for m_can
> should ideally be of type net_device.
>
> Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
>
> Signed-off-by: Pankaj Sharma <pankj.sharma@samsung.com>
> Signed-off-by: Sriram Dash <sriram.dash@samsung.com>
> ---
> drivers/net/can/m_can/m_can_platform.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
> index 6ac4c35..2eaa354 100644
> --- a/drivers/net/can/m_can/m_can_platform.c
> +++ b/drivers/net/can/m_can/m_can_platform.c
> @@ -107,7 +107,7 @@ static int m_can_plat_probe(struct platform_device *pdev)
>
> mcan_class->is_peripheral = false;
>
> - platform_set_drvdata(pdev, mcan_class->dev);
> + platform_set_drvdata(pdev, mcan_class->net);
>
> m_can_init_ram(mcan_class);
>
Thanks for the fix.
Acked-by: Dan Murphy <dmurphy@ti.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call
2019-11-19 10:20 ` [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Pankaj Sharma
2019-11-19 10:20 ` [PATCH 1/2] can: m_can_platform: set net_device structure as driver data Pankaj Sharma
@ 2019-11-19 10:20 ` Pankaj Sharma
2019-11-19 14:45 ` Dan Murphy
2019-12-05 20:57 ` [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Dan Murphy
2 siblings, 1 reply; 8+ messages in thread
From: Pankaj Sharma @ 2019-11-19 10:20 UTC (permalink / raw)
To: linux-can, netdev, linux-kernel
Cc: wg, mkl, davem, dmurphy, rcsekar, pankaj.dubey, Pankaj Sharma,
Sriram Dash
The function m_can_runtime_resume() is getting recursively called from
m_can_class_resume(). This results in a lock up.
We need not call m_can_class_resume() during m_can_runtime_resume().
Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
Signed-off-by: Pankaj Sharma <pankj.sharma@samsung.com>
Signed-off-by: Sriram Dash <sriram.dash@samsung.com>
---
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 2eaa354..38ea5e6 100644
--- a/drivers/net/can/m_can/m_can_platform.c
+++ b/drivers/net/can/m_can/m_can_platform.c
@@ -166,8 +166,6 @@ static int __maybe_unused m_can_runtime_resume(struct device *dev)
if (err)
clk_disable_unprepare(mcan_class->hclk);
- m_can_class_resume(dev);
-
return err;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call
2019-11-19 10:20 ` [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call Pankaj Sharma
@ 2019-11-19 14:45 ` Dan Murphy
0 siblings, 0 replies; 8+ messages in thread
From: Dan Murphy @ 2019-11-19 14:45 UTC (permalink / raw)
To: Pankaj Sharma, linux-can, netdev, linux-kernel
Cc: wg, mkl, davem, rcsekar, pankaj.dubey, Sriram Dash
Pankaj
On 11/19/19 4:20 AM, Pankaj Sharma wrote:
> The function m_can_runtime_resume() is getting recursively called from
> m_can_class_resume(). This results in a lock up.
>
> We need not call m_can_class_resume() during m_can_runtime_resume().
>
> Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
>
> Signed-off-by: Pankaj Sharma <pankj.sharma@samsung.com>
> Signed-off-by: Sriram Dash <sriram.dash@samsung.com>
> ---
> 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 2eaa354..38ea5e6 100644
> --- a/drivers/net/can/m_can/m_can_platform.c
> +++ b/drivers/net/can/m_can/m_can_platform.c
> @@ -166,8 +166,6 @@ static int __maybe_unused m_can_runtime_resume(struct device *dev)
> if (err)
> clk_disable_unprepare(mcan_class->hclk);
>
> - m_can_class_resume(dev);
> -
> return err;
> }
>
Acked-by: Dan Murphy <dmurphy@ti.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for
2019-11-19 10:20 ` [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Pankaj Sharma
2019-11-19 10:20 ` [PATCH 1/2] can: m_can_platform: set net_device structure as driver data Pankaj Sharma
2019-11-19 10:20 ` [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call Pankaj Sharma
@ 2019-12-05 20:57 ` Dan Murphy
2019-12-06 6:53 ` pankj.sharma
2019-12-06 7:39 ` Marc Kleine-Budde
2 siblings, 2 replies; 8+ messages in thread
From: Dan Murphy @ 2019-12-05 20:57 UTC (permalink / raw)
To: Pankaj Sharma, linux-can, netdev, linux-kernel
Cc: wg, mkl, davem, rcsekar, pankaj.dubey
Pankaj
On 11/19/19 4:20 AM, Pankaj Sharma wrote:
> The current code is failing while clock prepare enable because of not
> getting proper clock from platform device.
> A device driver for CAN controller hardware registers itself with the
> Linux network layer as a network device. So, the driver data for m_can
> should ideally be of type net_device.
>
> Further even when passing the proper net device in probe function the
> code was hanging because of the function m_can_runtime_resume() getting
> recursively called from m_can_class_resume().
>
> Pankaj Sharma (2):
> can: m_can_platform: set net_device structure as driver data
> can: m_can_platform: remove unnecessary m_can_class_resume() call
Did you CC: linux-stable for these? We are probably going to have
customers picking up 5.4 LTS and would need these bug fixes.
Or at the very least see if the stable automation will pick these up.
Dan
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for
2019-12-05 20:57 ` [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Dan Murphy
@ 2019-12-06 6:53 ` pankj.sharma
2019-12-06 7:39 ` Marc Kleine-Budde
1 sibling, 0 replies; 8+ messages in thread
From: pankj.sharma @ 2019-12-06 6:53 UTC (permalink / raw)
To: 'Dan Murphy'
Cc: wg, mkl, davem, rcsekar, pankaj.dubey, linux-can, netdev,
linux-kernel
> From: Dan Murphy <dmurphy@ti.com>
> Subject: Re: [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for
>
> Pankaj
>
> On 11/19/19 4:20 AM, Pankaj Sharma wrote:
> > The current code is failing while clock prepare enable because of not
> > getting proper clock from platform device.
> > A device driver for CAN controller hardware registers itself with the
> > Linux network layer as a network device. So, the driver data for m_can
> > should ideally be of type net_device.
> >
> > Further even when passing the proper net device in probe function the
> > code was hanging because of the function m_can_runtime_resume()
> > getting recursively called from m_can_class_resume().
> >
> > Pankaj Sharma (2):
> > can: m_can_platform: set net_device structure as driver data
> > can: m_can_platform: remove unnecessary m_can_class_resume() call
>
> Did you CC: linux-stable for these? We are probably going to have customers
> picking up 5.4 LTS and would need these bug fixes.
Hello Dan,
I haven’t copied to linux-stable, but the patches are already in linux-stable branch.
You can check in following link.
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=linux-5.4.y
Pankaj
>
> Or at the very least see if the stable automation will pick these up.
>
> Dan
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for
2019-12-05 20:57 ` [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Dan Murphy
2019-12-06 6:53 ` pankj.sharma
@ 2019-12-06 7:39 ` Marc Kleine-Budde
1 sibling, 0 replies; 8+ messages in thread
From: Marc Kleine-Budde @ 2019-12-06 7:39 UTC (permalink / raw)
To: Dan Murphy, Pankaj Sharma, linux-can, netdev, linux-kernel
Cc: wg, davem, rcsekar, pankaj.dubey
[-- Attachment #1.1: Type: text/plain, Size: 1273 bytes --]
On 12/5/19 9:57 PM, Dan Murphy wrote:
> Pankaj
>
> On 11/19/19 4:20 AM, Pankaj Sharma wrote:
>> The current code is failing while clock prepare enable because of not
>> getting proper clock from platform device.
>> A device driver for CAN controller hardware registers itself with the
>> Linux network layer as a network device. So, the driver data for m_can
>> should ideally be of type net_device.
>>
>> Further even when passing the proper net device in probe function the
>> code was hanging because of the function m_can_runtime_resume() getting
>> recursively called from m_can_class_resume().
>>
>> Pankaj Sharma (2):
>> can: m_can_platform: set net_device structure as driver data
>> can: m_can_platform: remove unnecessary m_can_class_resume() call
>
> Did you CC: linux-stable for these? We are probably going to have
> customers picking up 5.4 LTS and would need these bug fixes.
Both patches made it into the v5.4 release. So no need for stable.
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] 8+ messages in thread