* [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet
@ 2013-12-12 4:09 Felipe Balbi
2013-12-12 4:09 ` [PATCH 2/2] drivers: net: cpsw: fix for cpsw crash when build as modules Felipe Balbi
2013-12-12 8:11 ` [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Mugunthan V N
0 siblings, 2 replies; 5+ messages in thread
From: Felipe Balbi @ 2013-12-12 4:09 UTC (permalink / raw)
To: davem
Cc: mugunthanvnm, Sebastian Andrzej Siewior, netdev,
Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi
From: Mugunthan V N <mugunthanvnm@ti.com>
When only one port of the two port is pinned out, then dt probe is failing
because second port phy is not found. fixing this by checking the number of
slaves and breaking the loop.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
both patches were taken from TI's 3.12 tree [1]
and have been tested on am335x, am437x and
dra7xx.
Mugunthan, I took the patches because I got bug reports
on v3.13-rc which these patches fix. Let me know if you
prefer to send another version of them for whatever
reason.
cheers
drivers/net/ethernet/ti/cpsw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 7536a4c..a91f0c9 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1816,6 +1816,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
}
i++;
+ if (i == data->slaves)
+ break;
}
return 0;
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] drivers: net: cpsw: fix for cpsw crash when build as modules
2013-12-12 4:09 [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Felipe Balbi
@ 2013-12-12 4:09 ` Felipe Balbi
2013-12-12 18:47 ` David Miller
2013-12-12 8:11 ` [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Mugunthan V N
1 sibling, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2013-12-12 4:09 UTC (permalink / raw)
To: davem
Cc: mugunthanvnm, Sebastian Andrzej Siewior, netdev,
Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi
From: Mugunthan V N <mugunthanvnm@ti.com>
When CPSW and Davinci MDIO are build as modules, CPSW crashes when
accessing CPSW registers in CPSW probe. The same is working in built-in
as the CPSW clocks are enabled in Davindi MDIO probe, SO Enabling the
clocks before accessing the version register and moving out the other
register access to cpsw device open.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index a91f0c9..5120d9c 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1151,6 +1151,12 @@ static int cpsw_ndo_open(struct net_device *ndev)
* receive descs
*/
cpsw_info(priv, ifup, "submitted %d rx descriptors\n", i);
+
+ if (cpts_register(&priv->pdev->dev, priv->cpts,
+ priv->data.cpts_clock_mult,
+ priv->data.cpts_clock_shift))
+ dev_err(priv->dev, "error registering cpts device\n");
+
}
/* Enable Interrupt pacing if configured */
@@ -1197,6 +1203,7 @@ static int cpsw_ndo_stop(struct net_device *ndev)
netif_carrier_off(priv->ndev);
if (cpsw_common_res_usage_state(priv) <= 1) {
+ cpts_unregister(priv->cpts);
cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
cpdma_ctlr_stop(priv->dma);
@@ -1985,9 +1992,15 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_runtime_disable_ret;
}
priv->regs = ss_regs;
- priv->version = __raw_readl(&priv->regs->id_ver);
priv->host_port = HOST_PORT_NUM;
+ /* Need to enable clocks with runtime PM api to access module
+ * registers
+ */
+ pm_runtime_get_sync(&pdev->dev);
+ priv->version = readl(&priv->regs->id_ver);
+ pm_runtime_put_sync(&pdev->dev);
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
priv->wr_regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->wr_regs)) {
@@ -2157,8 +2170,6 @@ static int cpsw_remove(struct platform_device *pdev)
unregister_netdev(cpsw_get_slave_ndev(priv, 1));
unregister_netdev(ndev);
- cpts_unregister(priv->cpts);
-
cpsw_ale_destroy(priv->ale);
cpdma_chan_destroy(priv->txch);
cpdma_chan_destroy(priv->rxch);
--
1.8.4.GIT
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet
2013-12-12 4:09 [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Felipe Balbi
2013-12-12 4:09 ` [PATCH 2/2] drivers: net: cpsw: fix for cpsw crash when build as modules Felipe Balbi
@ 2013-12-12 8:11 ` Mugunthan V N
2013-12-12 15:44 ` Felipe Balbi
1 sibling, 1 reply; 5+ messages in thread
From: Mugunthan V N @ 2013-12-12 8:11 UTC (permalink / raw)
To: Felipe Balbi
Cc: davem, Sebastian Andrzej Siewior, netdev,
Linux Kernel Mailing List, Linux OMAP Mailing List
Balbi
On Thursday 12 December 2013 09:39 AM, Felipe Balbi wrote:
> From: Mugunthan V N <mugunthanvnm@ti.com>
>
> When only one port of the two port is pinned out, then dt probe is failing
> because second port phy is not found. fixing this by checking the number of
> slaves and breaking the loop.
>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
This patch is already applied to net branch and its commit id is
3a27bfac17fe375539c4e0a53478679645eb5ae2.
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet
2013-12-12 8:11 ` [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Mugunthan V N
@ 2013-12-12 15:44 ` Felipe Balbi
0 siblings, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2013-12-12 15:44 UTC (permalink / raw)
To: Mugunthan V N
Cc: Felipe Balbi, davem, Sebastian Andrzej Siewior, netdev,
Linux Kernel Mailing List, Linux OMAP Mailing List
[-- Attachment #1: Type: text/plain, Size: 719 bytes --]
Hi,
On Thu, Dec 12, 2013 at 01:41:11PM +0530, Mugunthan V N wrote:
> On Thursday 12 December 2013 09:39 AM, Felipe Balbi wrote:
> > From: Mugunthan V N <mugunthanvnm@ti.com>
> >
> > When only one port of the two port is pinned out, then dt probe is failing
> > because second port phy is not found. fixing this by checking the number of
> > slaves and breaking the loop.
> >
> > Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
>
> This patch is already applied to net branch and its commit id is
> 3a27bfac17fe375539c4e0a53478679645eb5ae2.
Ok, cool. Should it be backported to v3.12 stable tree ? I can see it's
applicable there too.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] drivers: net: cpsw: fix for cpsw crash when build as modules
2013-12-12 4:09 ` [PATCH 2/2] drivers: net: cpsw: fix for cpsw crash when build as modules Felipe Balbi
@ 2013-12-12 18:47 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-12-12 18:47 UTC (permalink / raw)
To: balbi; +Cc: mugunthanvnm, bigeasy, netdev, linux-kernel, linux-omap
From: Felipe Balbi <balbi@ti.com>
Date: Wed, 11 Dec 2013 22:09:05 -0600
> From: Mugunthan V N <mugunthanvnm@ti.com>
>
> When CPSW and Davinci MDIO are build as modules, CPSW crashes when
> accessing CPSW registers in CPSW probe. The same is working in built-in
> as the CPSW clocks are enabled in Davindi MDIO probe, SO Enabling the
> clocks before accessing the version register and moving out the other
> register access to cpsw device open.
>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-12-12 18:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12 4:09 [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Felipe Balbi
2013-12-12 4:09 ` [PATCH 2/2] drivers: net: cpsw: fix for cpsw crash when build as modules Felipe Balbi
2013-12-12 18:47 ` David Miller
2013-12-12 8:11 ` [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Mugunthan V N
2013-12-12 15:44 ` Felipe Balbi
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).