diff mbox

[3.3.0] phy:icplus:fix Auto Power Saving in ip101a_config_init.

Message ID 1333360929-31506-1-git-send-email-srinivas.kandagatla@st.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Srinivas KANDAGATLA April 2, 2012, 10:02 a.m. UTC
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>

This patch fixes Auto Power Saving configuration in ip101a_config_init
which was broken as there is no phy register write followed after
setting IP101A_APS_ON flag.

This patch also fixes the return value of ip101a_config_init.

Without this patch ip101a_config_init returns 2 which is not an error
accroding to IS_ERR and the mac driver will continue accessing 2 as
valid pointer to phy_dev resulting in memory fault.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
Hi All, 
This patch fixes broken ip101a_config_init in icplus.c.

Thanks,
srini

 drivers/net/phy/icplus.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

David Miller April 3, 2012, 10:49 p.m. UTC | #1
From: Srinivas KANDAGATLA <srinivas.kandagatla@st.com>
Date: Mon,  2 Apr 2012 11:02:09 +0100

> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> 
> This patch fixes Auto Power Saving configuration in ip101a_config_init
> which was broken as there is no phy register write followed after
> setting IP101A_APS_ON flag.
> 
> This patch also fixes the return value of ip101a_config_init.
> 
> Without this patch ip101a_config_init returns 2 which is not an error
> accroding to IS_ERR and the mac driver will continue accessing 2 as
> valid pointer to phy_dev resulting in memory fault.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 0856e1b..f08c85a 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -162,7 +162,8 @@  static int ip101a_g_config_init(struct phy_device *phydev)
 	/* Enable Auto Power Saving mode */
 	c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
 	c |= IP101A_G_APS_ON;
-	return c;
+
+	return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
 }
 
 static int ip175c_read_status(struct phy_device *phydev)