From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Arun Parameswaran <arun.parameswaran@broadcom.com>,
Scott Branden <scott.branden@broadcom.com>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH AUTOSEL 4.14 11/22] net: phy: restore mdio regs in the iproc mdio driver
Date: Mon, 2 Mar 2020 21:49:22 -0500 [thread overview]
Message-ID: <20200303024933.10371-11-sashal@kernel.org> (raw)
In-Reply-To: <20200303024933.10371-1-sashal@kernel.org>
From: Arun Parameswaran <arun.parameswaran@broadcom.com>
[ Upstream commit 6f08e98d62799e53c89dbf2c9a49d77e20ca648c ]
The mii management register in iproc mdio block
does not have a retention register so it is lost on suspend.
Save and restore value of register while resuming from suspend.
Fixes: bb1a619735b4 ("net: phy: Initialize mdio clock at probe function")
Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/phy/mdio-bcm-iproc.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/net/phy/mdio-bcm-iproc.c b/drivers/net/phy/mdio-bcm-iproc.c
index 46fe1ae919a30..51ce3ea17fb37 100644
--- a/drivers/net/phy/mdio-bcm-iproc.c
+++ b/drivers/net/phy/mdio-bcm-iproc.c
@@ -188,6 +188,23 @@ static int iproc_mdio_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+int iproc_mdio_resume(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct iproc_mdio_priv *priv = platform_get_drvdata(pdev);
+
+ /* restore the mii clock configuration */
+ iproc_mdio_config_clk(priv->base);
+
+ return 0;
+}
+
+static const struct dev_pm_ops iproc_mdio_pm_ops = {
+ .resume = iproc_mdio_resume
+};
+#endif /* CONFIG_PM_SLEEP */
+
static const struct of_device_id iproc_mdio_of_match[] = {
{ .compatible = "brcm,iproc-mdio", },
{ /* sentinel */ },
@@ -198,6 +215,9 @@ static struct platform_driver iproc_mdio_driver = {
.driver = {
.name = "iproc-mdio",
.of_match_table = iproc_mdio_of_match,
+#ifdef CONFIG_PM_SLEEP
+ .pm = &iproc_mdio_pm_ops,
+#endif
},
.probe = iproc_mdio_probe,
.remove = iproc_mdio_remove,
--
2.20.1
next prev parent reply other threads:[~2020-03-03 2:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200303024933.10371-1-sashal@kernel.org>
2020-03-03 2:49 ` [PATCH AUTOSEL 4.14 03/22] selftests: fix too long argument Sasha Levin
2020-03-03 2:49 ` [PATCH AUTOSEL 4.14 10/22] net: atlantic: fix potential error handling Sasha Levin
2020-03-03 2:49 ` Sasha Levin [this message]
2020-03-03 2:49 ` [PATCH AUTOSEL 4.14 12/22] net: ks8851-ml: Remove 8-bit bus accessors Sasha Levin
2020-03-03 2:49 ` [PATCH AUTOSEL 4.14 13/22] net: ks8851-ml: Fix 16-bit data access Sasha Levin
2020-03-03 2:49 ` [PATCH AUTOSEL 4.14 14/22] net: ks8851-ml: Fix 16-bit IO operation Sasha Levin
2020-03-03 2:49 ` [PATCH AUTOSEL 4.14 20/22] nfc: pn544: Fix occasional HW initialization failure Sasha Levin
2020-03-03 2:49 ` [PATCH AUTOSEL 4.14 22/22] net: thunderx: workaround BGX TX Underflow issue Sasha Levin
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=20200303024933.10371-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=andrew@lunn.ch \
--cc=arun.parameswaran@broadcom.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=scott.branden@broadcom.com \
--cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).