From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
Sekhar Nori <nsekhar@ti.com>, Mugunthan V N <mugunthanvnm@ti.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>,
Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
Rob Herring <robh+dt@kernel.org>, <devicetree@vger.kernel.org>,
Grygorii Strashko <grygorii.strashko@ti.com>
Subject: [PATCH 01/15] drivers: net: cpsw: fix suspend when all ethX devices are down
Date: Wed, 15 Jun 2016 14:55:49 +0300 [thread overview]
Message-ID: <20160615115603.4897-2-grygorii.strashko@ti.com> (raw)
In-Reply-To: <20160615115603.4897-1-grygorii.strashko@ti.com>
The cpsw_suspend() could trigger L3 error and CPSW will stop
functioning if System enters suspend when all ethX net-devices are
down - in this case CPSW could be already suspended by PM runtime, but
cpsw_suspend() will try to call soft_reset_slave() unconditionally
and access CPSW registers.
Hence, fix it by moving soft_reset_slave() from cpsw_suspend() to
cpsw_slave_stop(). This way slave ports will be reset when CPSW is
active and will be in proper state during Suspend.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index e6bb0ec..736c77a 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1244,6 +1244,7 @@ static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
slave->phy = NULL;
cpsw_ale_control_set(priv->ale, slave_port,
ALE_PORT_STATE, ALE_PORT_STATE_DISABLE);
+ soft_reset_slave(slave);
}
static int cpsw_ndo_open(struct net_device *ndev)
@@ -2558,12 +2559,10 @@ static int cpsw_suspend(struct device *dev)
for (i = 0; i < priv->data.slaves; i++) {
if (netif_running(priv->slaves[i].ndev))
cpsw_ndo_stop(priv->slaves[i].ndev);
- soft_reset_slave(priv->slaves + i);
}
} else {
if (netif_running(ndev))
cpsw_ndo_stop(ndev);
- for_each_slave(priv, soft_reset_slave);
}
pm_runtime_put_sync(&pdev->dev);
--
2.8.4
next prev parent reply other threads:[~2016-06-15 11:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 11:55 [PATCH 00/15] drivers: net: cpsw: improve runtime pm Grygorii Strashko
2016-06-15 11:55 ` Grygorii Strashko [this message]
2016-06-15 11:55 ` [PATCH 02/15] drivers: net: cpsw: check return code from pm runtime calls Grygorii Strashko
2016-06-15 11:55 ` [PATCH 03/15] drivers: net: cpsw: remove pm runtime calls from suspend callbacks Grygorii Strashko
2016-06-15 11:55 ` [PATCH 04/15] drivers: net: cpsw: ethtool: fix accessing to suspended device Grygorii Strashko
2016-06-15 16:14 ` Florian Fainelli
2016-06-15 16:45 ` Grygorii Strashko
2016-06-16 12:48 ` Ivan Khoronzhuk
2016-06-16 13:32 ` Ivan Khoronzhuk
2016-06-15 11:55 ` [PATCH 05/15] drivers: net: cpsw: ndev: " Grygorii Strashko
2016-06-15 11:55 ` [PATCH 06/15] drivers: net: davinci_mdio: do pm runtime initialization later in probe Grygorii Strashko
2016-06-15 11:55 ` [PATCH 07/15] drivers: net: davinci_mdio: remove pm runtime calls from suspend callbacks Grygorii Strashko
2016-06-15 11:55 ` [PATCH 08/15] drivers: net: davinci_mdio: drop suspended and lock fields from mdio_data Grygorii Strashko
2016-06-15 11:55 ` [PATCH 09/15] drivers: net: davinci_mdio: split reset function on init_clk and enable Grygorii Strashko
2016-06-15 11:55 ` [PATCH 10/15] drivers: net: davinci_mdio: add pm runtime callbacks Grygorii Strashko
2016-06-15 11:55 ` [PATCH 11/15] drivers: net: davinci_mdio: implement pm runtime auto mode Grygorii Strashko
2016-06-15 11:56 ` [PATCH 12/15] net: davinci_mdio: document missed "ti,am4372-mdio" compat string Grygorii Strashko
2016-06-19 14:35 ` Rob Herring
2016-06-22 10:26 ` Grygorii Strashko
2016-06-15 11:56 ` [PATCH 13/15] net: davinci_mdio: introduce "ti,cpsw-mdio" " Grygorii Strashko
2016-06-15 11:56 ` [PATCH 14/15] drivers: net: davinci_mdio: enable pm runtime auto for ti cpsw-mdio Grygorii Strashko
2016-06-15 13:48 ` kbuild test robot
2016-06-15 11:56 ` [PATCH 15/15] ARM: dts: am335x/am437x/dra7: use new "ti,cpsw-mdio" compat string Grygorii Strashko
2016-06-21 11:34 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160615115603.4897-2-grygorii.strashko@ti.com \
--to=grygorii.strashko@ti.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=ivan.khoronzhuk@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome