From: <srinivas.kandagatla@st.com>
To: <netdev@vger.kernel.org>
Cc: Giuseppe CAVALLARO <peppe.cavallaro@st.com>,
David Miller <davem@davemloft.net>,
<linux-kernel@vger.kernel.org>, <srinivas.kandagatla@st.com>
Subject: [PATCH v2 6/9] net: stmmac: fix power management suspend-resume case
Date: Thu, 16 Jan 2014 10:52:35 +0000 [thread overview]
Message-ID: <1389869555-28259-1-git-send-email-srinivas.kandagatla@st.com> (raw)
In-Reply-To: <1389869450-28003-1-git-send-email-srinivas.kandagatla@st.com>
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
The driver PM resume assumes that the IP is still powered up and the
all the register contents are not disturbed when it comes out of low
power suspend case. This assumption is wrong, basically the driver
should not consider any state of registers after it comes out of low
power. However driver can keep the part of the IP powered up if its a
wake up source. But it can not assume the register state of the IP. Also
its possible that SOC glue layer can take the power off the IP if its
not wake-up source to reduce the power consumption.
This patch re initializes hardware by calling stmmac_hw_setup function in
resume case.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 341c8dc..742a83f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2887,18 +2887,19 @@ int stmmac_resume(struct net_device *ndev)
* this bit because it can generate problems while resuming
* from another devices (e.g. serial console).
*/
- if (device_may_wakeup(priv->device))
+ if (device_may_wakeup(priv->device)) {
priv->hw->mac->pmt(priv->ioaddr, 0);
- else
+ } else {
/* enable the clk prevously disabled */
clk_prepare_enable(priv->stmmac_clk);
+ /* reset the phy so that it's ready */
+ if (priv->mii)
+ stmmac_mdio_reset(priv->mii);
+ }
netif_device_attach(ndev);
- /* Enable the MAC and DMA */
- stmmac_set_mac(priv->ioaddr, true);
- priv->hw->dma->start_tx(priv->ioaddr);
- priv->hw->dma->start_rx(priv->ioaddr);
+ stmmac_hw_setup(ndev);
napi_enable(&priv->napi);
--
1.7.6.5
next prev parent reply other threads:[~2014-01-16 10:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-18 11:30 [PATCH RFC 0/9]net: stmmac PM related fixes srinivas.kandagatla
2013-11-18 11:31 ` [PATCH RFC 1/9] net: stmmac: support max-speed device tree property srinivas.kandagatla
2013-11-18 11:31 ` [PATCH RFC 2/9] net: stmmac: mdio: remove reset gpio free srinivas.kandagatla
2013-11-18 11:31 ` [PATCH RFC 3/9] net: stmmac: move dma allocation to new function srinivas.kandagatla
2013-11-18 11:32 ` [PATCH RFC 4/9] net: stmmac: move hardware setup for stmmac_open " srinivas.kandagatla
2013-11-18 11:32 ` [PATCH RFC 5/9] net: stmmac: make stmmac_mdio_reset non-static srinivas.kandagatla
2013-11-18 11:32 ` [PATCH RFC 6/9] net: stmmac: fix power mangement suspend-resume case srinivas.kandagatla
2013-11-18 11:32 ` [PATCH RFC 7/9] net: stmmac: use suspend functions for hibernation srinivas.kandagatla
2013-11-18 11:32 ` [PATCH RFC 8/9] net: stmmac: restore pinstate in pm resume srinivas.kandagatla
2013-11-18 11:32 ` [PATCH RFC 9/9] net: stmmac: notify the PM core of a wakeup event srinivas.kandagatla
2013-11-19 5:24 ` [PATCH RFC 0/9]net: stmmac PM related fixes Giuseppe CAVALLARO
2013-11-19 9:03 ` srinivas kandagatla
2013-12-02 10:48 ` srinivas kandagatla
2013-12-02 16:18 ` David Miller
2014-01-14 10:05 ` srinivas kandagatla
2014-01-15 21:49 ` David Miller
2014-01-16 10:48 ` [PATCH v2 0/9] net: " srinivas.kandagatla
2014-01-16 23:24 ` David Miller
2014-01-16 10:50 ` srinivas.kandagatla
2014-01-16 10:51 ` [PATCH v2 1/9] net: stmmac: support max-speed device tree property srinivas.kandagatla
2014-01-16 10:51 ` [PATCH v2 2/9] net: stmmac: mdio: remove reset gpio free srinivas.kandagatla
2014-01-16 10:52 ` [PATCH v2 3/9] net: stmmac: move dma allocation to new function srinivas.kandagatla
2014-01-16 10:52 ` [PATCH v2 4/9] net: stmmac: move hardware setup for stmmac_open " srinivas.kandagatla
2014-01-16 10:52 ` [PATCH v2 5/9] net: stmmac: make stmmac_mdio_reset non-static srinivas.kandagatla
2014-01-16 10:52 ` srinivas.kandagatla [this message]
2014-01-16 10:52 ` [PATCH v2 7/9] net: stmmac: use suspend functions for hibernation srinivas.kandagatla
2014-01-16 10:52 ` [PATCH v2 8/9] net: stmmac: restore pinstate in pm resume srinivas.kandagatla
2014-01-16 10:53 ` [PATCH v2 9/9] net: stmmac: notify the PM core of a wakeup event srinivas.kandagatla
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=1389869555-28259-1-git-send-email-srinivas.kandagatla@st.com \
--to=srinivas.kandagatla@st.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
/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
all inboxes | Powered by JetHome®