]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drivers: net: cpsw: fix wrong regs access in cpsw_ndo_open
authorGrygorii Strashko <grygorii.strashko@ti.com>
Tue, 19 Apr 2016 18:09:49 +0000 (21:09 +0300)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 20 Oct 2016 13:06:37 +0000 (08:06 -0500)
BugLink: http://bugs.launchpad.net/bugs/1625177
The cpsw_ndo_open() could try to access CPSW registers before
calling pm_runtime_get_sync(). This will trigger L3 error:

 WARNING: CPU: 0 PID: 21 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x220/0x34c()
 44000000.ocp:L3 Custom Error: MASTER M2 (64-bit) TARGET L4_FAST (Idle): Data Access in Supervisor mode during Functional access

and CPSW will stop functioning.

Hence, fix it by moving pm_runtime_get_sync() before the first access
to CPSW registers in cpsw_ndo_open().

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3fa88c51c73a67e7eeda1fcafd809f9185790b31)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/net/ethernet/ti/cpsw.c

index 22418563939f722c71daef29b0e86aaf8ed59990..41e9576cedb33d584f0a047b50a8ddd1e4296972 100644 (file)
@@ -1252,12 +1252,12 @@ static int cpsw_ndo_open(struct net_device *ndev)
        int i, ret;
        u32 reg;
 
+       pm_runtime_get_sync(&priv->pdev->dev);
+
        if (!cpsw_common_res_usage_state(priv))
                cpsw_intr_disable(priv);
        netif_carrier_off(ndev);
 
-       pm_runtime_get_sync(&priv->pdev->dev);
-
        reg = priv->version;
 
        dev_info(priv->dev, "initializing cpsw version %d.%d (%d)\n",