netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull-request: can 2019-11-22
@ 2019-11-22 14:52 Marc Kleine-Budde
  2019-11-22 14:52 ` [PATCH 1/2] can: m_can_platform: set net_device structure as driver data Marc Kleine-Budde
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2019-11-22 14:52 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-can, kernel

Hello David,

this is a pull request of 2 patches for net/master, if possible for the
current release cycle. Otherwise these patches should hit v5.4 via the
stable tree.

Both patches of this pull request target the m_can driver. Pankaj Sharma
fixes the fallout in the m_can_platform part, which appeared with the
introduction of the m_can platform framework.

regards,
Marc

---

The following changes since commit d814b67e50dc53c3c83932d7020d1719af1e68dc:

  Merge branch 'hv_netvsc-Fix-send-indirection-table-offset' (2019-11-21 19:32:23 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-5.4-20191122

for you to fetch changes up to 0704c57436947c9f9f6472fd1a5ade41fc4c19d8:

  can: m_can_platform: remove unnecessary m_can_class_resume() call (2019-11-22 15:34:37 +0100)

----------------------------------------------------------------
linux-can-fixes-for-5.4-20191122

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

 drivers/net/can/m_can/m_can_platform.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



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

* [PATCH 1/2] can: m_can_platform: set net_device structure as driver data
  2019-11-22 14:52 pull-request: can 2019-11-22 Marc Kleine-Budde
@ 2019-11-22 14:52 ` Marc Kleine-Budde
  2019-11-22 14:52 ` [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call Marc Kleine-Budde
  2019-11-22 17:42 ` pull-request: can 2019-11-22 David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2019-11-22 14:52 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Pankaj Sharma, Sriram Dash, Dan Murphy,
	Marc Kleine-Budde

From: Pankaj Sharma <pankj.sharma@samsung.com>

The current code is failing during clock prepare enable because of not
getting proper clock from platform device.

[    0.852089] Call trace:
[    0.854516]  0xffff0000fa22a668
[    0.857638]  clk_prepare+0x20/0x34
[    0.861019]  m_can_runtime_resume+0x2c/0xe4
[    0.865180]  pm_generic_runtime_resume+0x28/0x38
[    0.869770]  __rpm_callback+0x16c/0x1bc
[    0.873583]  rpm_callback+0x24/0x78
[    0.877050]  rpm_resume+0x428/0x560
[    0.880517]  __pm_runtime_resume+0x7c/0xa8
[    0.884593]  m_can_clk_start.isra.9.part.10+0x1c/0xa8
[    0.889618]  m_can_class_register+0x138/0x370
[    0.893950]  m_can_plat_probe+0x120/0x170
[    0.897939]  platform_drv_probe+0x4c/0xa0
[    0.901924]  really_probe+0xd8/0x31c
[    0.905477]  driver_probe_device+0x58/0xe8
[    0.909551]  device_driver_attach+0x68/0x70
[    0.913711]  __driver_attach+0x9c/0xf8
[    0.917437]  bus_for_each_dev+0x50/0xa0
[    0.921251]  driver_attach+0x20/0x28
[    0.924804]  bus_add_driver+0x148/0x1fc
[    0.928617]  driver_register+0x6c/0x124
[    0.932431]  __platform_driver_register+0x48/0x50
[    0.937113]  m_can_plat_driver_init+0x18/0x20
[    0.941446]  do_one_initcall+0x4c/0x19c
[    0.945259]  kernel_init_freeable+0x1d0/0x280
[    0.949591]  kernel_init+0x10/0x100
[    0.953057]  ret_from_fork+0x10/0x18
[    0.956614] Code: 00000000 00000000 00000000 00000000 (fa22a668)
[    0.962681] ---[ end trace 881f71bd609de763 ]---
[    0.967301] Kernel panic - not syncing: Attempted to kill init!

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>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 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 6ac4c35f247a..2eaa3543d233 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.24.0


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

* [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call
  2019-11-22 14:52 pull-request: can 2019-11-22 Marc Kleine-Budde
  2019-11-22 14:52 ` [PATCH 1/2] can: m_can_platform: set net_device structure as driver data Marc Kleine-Budde
@ 2019-11-22 14:52 ` Marc Kleine-Budde
  2019-11-22 17:42 ` pull-request: can 2019-11-22 David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2019-11-22 14:52 UTC (permalink / raw)
  To: netdev
  Cc: davem, linux-can, kernel, Pankaj Sharma, Sriram Dash, Dan Murphy,
	Marc Kleine-Budde

From: Pankaj Sharma <pankj.sharma@samsung.com>

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>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.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 2eaa3543d233..38ea5e600fb8 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.24.0


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

* Re: pull-request: can 2019-11-22
  2019-11-22 14:52 pull-request: can 2019-11-22 Marc Kleine-Budde
  2019-11-22 14:52 ` [PATCH 1/2] can: m_can_platform: set net_device structure as driver data Marc Kleine-Budde
  2019-11-22 14:52 ` [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call Marc Kleine-Budde
@ 2019-11-22 17:42 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-11-22 17:42 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, kernel

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 22 Nov 2019 15:52:49 +0100

> this is a pull request of 2 patches for net/master, if possible for the
> current release cycle. Otherwise these patches should hit v5.4 via the
> stable tree.
> 
> Both patches of this pull request target the m_can driver. Pankaj Sharma
> fixes the fallout in the m_can_platform part, which appeared with the
> introduction of the m_can platform framework.

Pulled, thanks Marc.

^ permalink raw reply	[flat|nested] 6+ 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; 6+ 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] 6+ messages in thread

* [PATCH 1/2] can: m_can_platform: set net_device structure as driver data
       [not found] ` <CGME20191119102155epcas5p34ca3dfaba9eef8de24d1bc9d64ef5335@epcas5p3.samsung.com>
@ 2019-11-19 10:20   ` Pankaj Sharma
  2019-11-19 14:43     ` Dan Murphy
  0 siblings, 1 reply; 6+ 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] 6+ messages in thread

end of thread, other threads:[~2019-11-22 17:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 14:52 pull-request: can 2019-11-22 Marc Kleine-Budde
2019-11-22 14:52 ` [PATCH 1/2] can: m_can_platform: set net_device structure as driver data Marc Kleine-Budde
2019-11-22 14:52 ` [PATCH 2/2] can: m_can_platform: remove unnecessary m_can_class_resume() call Marc Kleine-Budde
2019-11-22 17:42 ` pull-request: can 2019-11-22 David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-11-19 10:20 [PATCH 0/2] can: m_can_platform: Bug fix of kernel panic for Pankaj Sharma
     [not found] ` <CGME20191119102155epcas5p34ca3dfaba9eef8de24d1bc9d64ef5335@epcas5p3.samsung.com>
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

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