* [PATCH] net/phy: micrel: Reenable interrupts during resume
@ 2015-07-29 15:21 Nathan Sullivan
2015-07-30 6:55 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Sullivan @ 2015-07-29 15:21 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, linux-kernel, Nathan Sullivan
The ksz9031 has a behavior where it will clear the interrupt enable bits
when leaving power down. To work around this, make sure the interrupt
bits are in the state they are expected to be when resuming.
Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
---
drivers/net/phy/micrel.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 499185e..7a93af6 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -447,6 +447,22 @@ static int ksz9031_center_flp_timing(struct phy_device *phydev)
return genphy_restart_aneg(phydev);
}
+static int ksz9031_resume(struct phy_device *phydev)
+{
+ int result;
+
+ result = genphy_resume(phydev);
+
+ if (result)
+ return result;
+
+ /* This phy will reset interrupt enables when leaving power down */
+ if (PHY_INTERRUPT_ENABLED & phydev->interrupts)
+ result = kszphy_set_interrupt(phydev);
+
+ return result;
+}
+
static int ksz9031_config_init(struct phy_device *phydev)
{
const struct device *dev = &phydev->dev;
@@ -776,7 +792,7 @@ static struct phy_driver ksphy_driver[] = {
.ack_interrupt = kszphy_ack_interrupt,
.config_intr = kszphy_config_intr,
.suspend = genphy_suspend,
- .resume = genphy_resume,
+ .resume = ksz9031_resume,
.driver = { .owner = THIS_MODULE, },
}, {
.phy_id = PHY_ID_KSZ8873MLL,
--
1.7.10.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/phy: micrel: Reenable interrupts during resume
2015-07-29 15:21 [PATCH] net/phy: micrel: Reenable interrupts during resume Nathan Sullivan
@ 2015-07-30 6:55 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-07-30 6:55 UTC (permalink / raw)
To: nathan.sullivan; +Cc: f.fainelli, netdev, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=iso-8859-7, Size: 1265 bytes --]
From: Nathan Sullivan <nathan.sullivan@ni.com>
Date: Wed, 29 Jul 2015 10:21:14 -0500
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 499185e..7a93af6 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -447,6 +447,22 @@ static int ksz9031_center_flp_timing(struct phy_device *phydev)
> return genphy_restart_aneg(phydev);
> }
>
> +static int ksz9031_resume(struct phy_device *phydev)
> +{
> + int result;
> +
> + result = genphy_resume(phydev);
> +
> + if (result)
> + return result;
> +
> + /* This phy will reset interrupt enables when leaving power down */
> + if (PHY_INTERRUPT_ENABLED & phydev->interrupts)
> + result = kszphy_set_interrupt(phydev);
> +
This doesn't compile.
drivers/net/phy/micrel.c: In function ¡ksz9031_resume¢:
drivers/net/phy/micrel.c:461:3: error: implicit declaration of function ¡kszphy_set_interrupt¢ [-Werror=implicit-function-declaration]
result = kszphy_set_interrupt(phydev);
^
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target 'drivers/net/phy/micrel.o' failed
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-30 6:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 15:21 [PATCH] net/phy: micrel: Reenable interrupts during resume Nathan Sullivan
2015-07-30 6:55 ` David Miller
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®