* [PATCH 1/2] e100: power down PHY if WOL is not enabled
@ 2011-12-14 2:49 Jiang Wang
2011-12-14 2:49 ` [PATCH 2/2] e100: power off PHY after reset when interface is down Jiang Wang
2011-12-14 20:30 ` [PATCH 1/2] e100: power down PHY if WOL is not enabled Ben Hutchings
0 siblings, 2 replies; 8+ messages in thread
From: Jiang Wang @ 2011-12-14 2:49 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel, netdev, linux-kernel
Cc: ppanchamukhi, clala, Francis.St.Amant, miles.ito, Jiang Wang
Since the interface will not be used after being put down and WOL is disabled,
just power it off.
When bring up the interface, power on the PHY.
Signed-off-by: Jiang Wang <Jiang.Wang@riverbed.com>
---
drivers/net/ethernet/intel/e100.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 5a2fdf7..9824e0a 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -1449,6 +1449,14 @@ static int e100_phy_init(struct nic *nic)
netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
"phy_addr = %d\n", nic->mii.phy_id);
+ /* Make sure power to the PHY is enabled */
+ if (!(nic->flags & wol_magic)) {
+ uint16_t phy_data;
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data &= ~BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ }
+
/* Get phy ID */
id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
@@ -2261,6 +2269,15 @@ static void e100_down(struct nic *nic)
napi_disable(&nic->napi);
netif_stop_queue(nic->netdev);
e100_hw_reset(nic);
+
+ /* If wake on LAN is not enabled, power down the PHY */
+ if (!(nic->flags & wol_magic)) {
+ uint16_t phy_data;
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data |= BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ }
+
free_irq(nic->pdev->irq, nic->netdev);
del_timer_sync(&nic->watchdog);
netif_carrier_off(nic->netdev);
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] e100: power off PHY after reset when interface is down
2011-12-14 2:49 [PATCH 1/2] e100: power down PHY if WOL is not enabled Jiang Wang
@ 2011-12-14 2:49 ` Jiang Wang
2011-12-16 2:29 ` Jiang Wang
2011-12-14 20:30 ` [PATCH 1/2] e100: power down PHY if WOL is not enabled Ben Hutchings
1 sibling, 1 reply; 8+ messages in thread
From: Jiang Wang @ 2011-12-14 2:49 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel, netdev, linux-kernel
Cc: Francis.St.Amant, miles.ito, clala, ppanchamukhi, Jiang Wang
PHYs supported by e100 re-starts auto-negotiation after writing to
BMCR_RESET bit. This patch powers down PHY when the interface is down
and reset is issued.
Signed-off-by: Jiang Wang <Jiang.Wang@riverbed.com>
---
drivers/net/ethernet/intel/e100.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 9824e0a..b8e4910 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2386,6 +2386,13 @@ static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
err = mii_ethtool_sset(&nic->mii, cmd);
e100_exec_cb(nic, NULL, e100_configure);
+ if (!netif_running(netdev) && !(nic->flags & wol_magic)) {
+ uint16_t phy_data;
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data |= BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ }
+
return err;
}
--
1.7.1
------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits?
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] e100: power down PHY if WOL is not enabled
2011-12-14 2:49 [PATCH 1/2] e100: power down PHY if WOL is not enabled Jiang Wang
2011-12-14 2:49 ` [PATCH 2/2] e100: power off PHY after reset when interface is down Jiang Wang
@ 2011-12-14 20:30 ` Ben Hutchings
2011-12-14 21:59 ` Jiang Wang
1 sibling, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2011-12-14 20:30 UTC (permalink / raw)
To: Jiang Wang
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel, netdev, linux-kernel, ppanchamukhi,
clala, Francis.St.Amant, miles.ito
On Tue, 2011-12-13 at 18:49 -0800, Jiang Wang wrote:
> Since the interface will not be used after being put down and WOL is disabled,
> just power it off.
> When bring up the interface, power on the PHY.
Don't you need to cover the case where WOL is enabled while the
interface is down?
Ben.
> Signed-off-by: Jiang Wang <Jiang.Wang@riverbed.com>
> ---
> drivers/net/ethernet/intel/e100.c | 17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
> index 5a2fdf7..9824e0a 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -1449,6 +1449,14 @@ static int e100_phy_init(struct nic *nic)
> netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
> "phy_addr = %d\n", nic->mii.phy_id);
>
> + /* Make sure power to the PHY is enabled */
> + if (!(nic->flags & wol_magic)) {
> + uint16_t phy_data;
> + phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
> + phy_data &= ~BMCR_PDOWN;
> + mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
> + }
> +
> /* Get phy ID */
> id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
> id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
> @@ -2261,6 +2269,15 @@ static void e100_down(struct nic *nic)
> napi_disable(&nic->napi);
> netif_stop_queue(nic->netdev);
> e100_hw_reset(nic);
> +
> + /* If wake on LAN is not enabled, power down the PHY */
> + if (!(nic->flags & wol_magic)) {
> + uint16_t phy_data;
> + phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
> + phy_data |= BMCR_PDOWN;
> + mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
> + }
> +
> free_irq(nic->pdev->irq, nic->netdev);
> del_timer_sync(&nic->watchdog);
> netif_carrier_off(nic->netdev);
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] e100: power down PHY if WOL is not enabled
2011-12-14 20:30 ` [PATCH 1/2] e100: power down PHY if WOL is not enabled Ben Hutchings
@ 2011-12-14 21:59 ` Jiang Wang
2011-12-14 22:07 ` Ben Hutchings
0 siblings, 1 reply; 8+ messages in thread
From: Jiang Wang @ 2011-12-14 21:59 UTC (permalink / raw)
To: Ben Hutchings
Cc: Francis St. Amant, Panchamukhi, Carolyn, miles.ito@intel.com,
e1000-devel@lists.sourceforge.net, Bruce Allan, Jesse Brandeburg,
linux-kernel@vger.kernel.org, John Ronciak, Prasanna,
netdev@vger.kernel.org, Chaitanya Lala, Peter
Hi Ben,
Do you mean the WOL is enabled but PHY is powered off somehow? That scenario should never happen. If WOL is enabled, there is no code to power off PHY.
Regards,
Jiang
-------------------------------------
Jiang Wang
Member of Technical Staff
Riverbed Technology
Tel: (408) 522-5109
Email: Jiang.Wang@riverbed.com
www.riverbed.com
-----Original Message-----
From: Ben Hutchings [mailto:bhutchings@solarflare.com]
Sent: Wednesday, December 14, 2011 12:31 PM
To: Jiang Wang
Cc: Jeff Kirsher; Jesse Brandeburg; Bruce Allan; Carolyn Wyborny; Don Skidmore; Greg Rose; Peter P Waskiewicz Jr; Alex Duyck; John Ronciak; e1000-devel@lists.sourceforge.net; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Prasanna Panchamukhi; Chaitanya Lala; Francis St. Amant; miles.ito@intel.com
Subject: Re: [PATCH 1/2] e100: power down PHY if WOL is not enabled
On Tue, 2011-12-13 at 18:49 -0800, Jiang Wang wrote:
> Since the interface will not be used after being put down and WOL is
> disabled, just power it off.
> When bring up the interface, power on the PHY.
Don't you need to cover the case where WOL is enabled while the interface is down?
Ben.
> Signed-off-by: Jiang Wang <Jiang.Wang@riverbed.com>
> ---
> drivers/net/ethernet/intel/e100.c | 17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e100.c
> b/drivers/net/ethernet/intel/e100.c
> index 5a2fdf7..9824e0a 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -1449,6 +1449,14 @@ static int e100_phy_init(struct nic *nic)
> netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
> "phy_addr = %d\n", nic->mii.phy_id);
>
> + /* Make sure power to the PHY is enabled */
> + if (!(nic->flags & wol_magic)) {
> + uint16_t phy_data;
> + phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
> + phy_data &= ~BMCR_PDOWN;
> + mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
> + }
> +
> /* Get phy ID */
> id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
> id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); @@ -2261,6
> +2269,15 @@ static void e100_down(struct nic *nic)
> napi_disable(&nic->napi);
> netif_stop_queue(nic->netdev);
> e100_hw_reset(nic);
> +
> + /* If wake on LAN is not enabled, power down the PHY */
> + if (!(nic->flags & wol_magic)) {
> + uint16_t phy_data;
> + phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
> + phy_data |= BMCR_PDOWN;
> + mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
> + }
> +
> free_irq(nic->pdev->irq, nic->netdev);
> del_timer_sync(&nic->watchdog);
> netif_carrier_off(nic->netdev);
--
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits?
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] e100: power down PHY if WOL is not enabled
2011-12-14 21:59 ` Jiang Wang
@ 2011-12-14 22:07 ` Ben Hutchings
2011-12-14 22:16 ` Jiang Wang
2011-12-16 2:28 ` Jiang Wang
0 siblings, 2 replies; 8+ messages in thread
From: Ben Hutchings @ 2011-12-14 22:07 UTC (permalink / raw)
To: Jiang Wang
Cc: Francis St. Amant, Panchamukhi, Carolyn, miles.ito@intel.com,
e1000-devel@lists.sourceforge.net, Bruce Allan, Jesse Brandeburg,
linux-kernel@vger.kernel.org, John Ronciak, Prasanna,
netdev@vger.kernel.org, Chaitanya Lala, Peter
On Wed, 2011-12-14 at 21:59 +0000, Jiang Wang wrote:
> Hi Ben,
>
> Do you mean the WOL is enabled but PHY is powered off somehow? That
> scenario should never happen. If WOL is enabled, there is no code to
> power off PHY.
[...]
Initial conditions: interface up, WOL off, PHY on.
1. Bring interface down. PHY is turned off.
2. Turn WOL on. PHY is still off, but needs to be on.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits?
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 1/2] e100: power down PHY if WOL is not enabled
2011-12-14 22:07 ` Ben Hutchings
@ 2011-12-14 22:16 ` Jiang Wang
2011-12-16 2:28 ` Jiang Wang
1 sibling, 0 replies; 8+ messages in thread
From: Jiang Wang @ 2011-12-14 22:16 UTC (permalink / raw)
To: Ben Hutchings
Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don Skidmore, Greg Rose, Peter P Waskiewicz Jr, Alex Duyck,
John Ronciak, e1000-devel@lists.sourceforge.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Prasanna Panchamukhi, Chaitanya Lala, Francis St. Amant,
miles.ito@intel.com
I see. I will add one more check for that. Thanks.
-------------------------------------
Jiang Wang
Member of Technical Staff
Riverbed Technology
Tel: (408) 522-5109
Email: Jiang.Wang@riverbed.com
www.riverbed.com
-----Original Message-----
From: Ben Hutchings [mailto:bhutchings@solarflare.com]
Sent: Wednesday, December 14, 2011 2:08 PM
To: Jiang Wang
Cc: Jeff Kirsher; Jesse Brandeburg; Bruce Allan; Carolyn Wyborny; Don Skidmore; Greg Rose; Peter P Waskiewicz Jr; Alex Duyck; John Ronciak; e1000-devel@lists.sourceforge.net; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Prasanna Panchamukhi; Chaitanya Lala; Francis St. Amant; miles.ito@intel.com
Subject: RE: [PATCH 1/2] e100: power down PHY if WOL is not enabled
On Wed, 2011-12-14 at 21:59 +0000, Jiang Wang wrote:
> Hi Ben,
>
> Do you mean the WOL is enabled but PHY is powered off somehow? That
> scenario should never happen. If WOL is enabled, there is no code to
> power off PHY.
[...]
Initial conditions: interface up, WOL off, PHY on.
1. Bring interface down. PHY is turned off.
2. Turn WOL on. PHY is still off, but needs to be on.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] e100: power down PHY if WOL is not enabled
2011-12-14 22:07 ` Ben Hutchings
2011-12-14 22:16 ` Jiang Wang
@ 2011-12-16 2:28 ` Jiang Wang
1 sibling, 0 replies; 8+ messages in thread
From: Jiang Wang @ 2011-12-16 2:28 UTC (permalink / raw)
To: Ben Hutchings
Cc: Francis St. Amant, Panchamukhi, Carolyn, miles.ito@intel.com,
e1000-devel@lists.sourceforge.net, Bruce Allan, Jesse Brandeburg,
linux-kernel@vger.kernel.org, John Ronciak, Prasanna,
netdev@vger.kernel.org, Chaitanya Lala, Peter
Modified the patch.
>From 16c145e8c6b9fdaf94dfdc91211faba88359aaab Mon Sep 17 00:00:00 2001
From: Jiang Wang <Jiang.Wang@riverbed.com>
Date: Thu, 15 Dec 2011 17:08:32 -0800
Subject: [PATCH 1/2] e100: power down PHY if WOL is not enabled
Since the interface will not be used after being put down and WOL is disabled,
just power it off.
When bring up the interface, power on the PHY.
Signed-off-by: Jiang Wang <Jiang.Wang@riverbed.com>
---
drivers/net/ethernet/intel/e100.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 5a2fdf7..ca994da 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -1449,6 +1449,11 @@ static int e100_phy_init(struct nic *nic)
netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
"phy_addr = %d\n", nic->mii.phy_id);
+ /* Make sure power to the PHY is enabled */
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data &= ~BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+
/* Get phy ID */
id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
@@ -2261,6 +2266,15 @@ static void e100_down(struct nic *nic)
napi_disable(&nic->napi);
netif_stop_queue(nic->netdev);
e100_hw_reset(nic);
+
+ /* If wake on LAN is not enabled, power down the PHY */
+ if (!(nic->flags & wol_magic)) {
+ uint16_t phy_data;
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data |= BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ }
+
free_irq(nic->pdev->irq, nic->netdev);
del_timer_sync(&nic->watchdog);
netif_carrier_off(nic->netdev);
--
1.7.1
-------------------------------------
Jiang Wang
Member of Technical Staff
Riverbed Technology
Tel: (408) 522-5109
Email: Jiang.Wang@riverbed.com
www.riverbed.com
-----Original Message-----
From: Ben Hutchings [mailto:bhutchings@solarflare.com]
Sent: Wednesday, December 14, 2011 2:08 PM
To: Jiang Wang
Cc: Jeff Kirsher; Jesse Brandeburg; Bruce Allan; Carolyn Wyborny; Don Skidmore; Greg Rose; Peter P Waskiewicz Jr; Alex Duyck; John Ronciak; e1000-devel@lists.sourceforge.net; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Prasanna Panchamukhi; Chaitanya Lala; Francis St. Amant; miles.ito@intel.com
Subject: RE: [PATCH 1/2] e100: power down PHY if WOL is not enabled
On Wed, 2011-12-14 at 21:59 +0000, Jiang Wang wrote:
> Hi Ben,
>
> Do you mean the WOL is enabled but PHY is powered off somehow? That
> scenario should never happen. If WOL is enabled, there is no code to
> power off PHY.
[...]
Initial conditions: interface up, WOL off, PHY on.
1. Bring interface down. PHY is turned off.
2. Turn WOL on. PHY is still off, but needs to be on.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] e100: power off PHY after reset when interface is down
2011-12-14 2:49 ` [PATCH 2/2] e100: power off PHY after reset when interface is down Jiang Wang
@ 2011-12-16 2:29 ` Jiang Wang
0 siblings, 0 replies; 8+ messages in thread
From: Jiang Wang @ 2011-12-16 2:29 UTC (permalink / raw)
To: Jiang Wang, Jeff Kirsher, Jesse Brandeburg, Bruce Allan,
Carolyn Wyborny, Don Skidmore, Greg Rose, Peter P Waskiewicz Jr,
Alex Duyck, John Ronciak, e1000-devel@lists.sourceforge.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Chaitanya Lala, Francis St. Amant, Prasanna Panchamukhi,
miles.ito@intel.com
Modified the patch.
>From a74d3114934a82d17a43eae7b5bb1488d2c1b6c8 Mon Sep 17 00:00:00 2001
From: Jiang Wang <Jiang.Wang@riverbed.com>
Date: Thu, 15 Dec 2011 17:44:20 -0800
Subject: [PATCH 2/2] e100: power off PHY after reset when interface is down
PHYs supported by e100 re-starts auto-negotiation after writing to
BMCR_RESET bit. This patch powers down PHY when the interface is down
and reset is issued.
Signed-off-by: Jiang Wang <Jiang.Wang@riverbed.com>
---
drivers/net/ethernet/intel/e100.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index ca994da..2764cdd 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -589,6 +589,7 @@ struct nic {
multicast_all = (1 << 2),
wol_magic = (1 << 3),
ich_10h_workaround = (1 << 4),
+ powered_off = (1 << 5),
} flags ____cacheline_aligned;
enum mac mac;
@@ -1454,6 +1455,8 @@ static int e100_phy_init(struct nic *nic)
phy_data &= ~BMCR_PDOWN;
mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ nic->flags &= ~powered_off;
+
/* Get phy ID */
id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
@@ -2273,6 +2276,7 @@ static void e100_down(struct nic *nic)
phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
phy_data |= BMCR_PDOWN;
mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ nic->flags |= powered_off;
}
free_irq(nic->pdev->irq, nic->netdev);
@@ -2383,6 +2387,13 @@ static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
err = mii_ethtool_sset(&nic->mii, cmd);
e100_exec_cb(nic, NULL, e100_configure);
+ if (nic->flags & powered_off) {
+ uint16_t phy_data;
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data |= BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ }
+
return err;
}
--
1.7.1
-------------------------------------
Jiang Wang
Member of Technical Staff
Riverbed Technology
Tel: (408) 522-5109
Email: Jiang.Wang@riverbed.com
www.riverbed.com
-----Original Message-----
From: Jiang Wang [mailto:Jiang.Wang@riverbed.com]
Sent: Tuesday, December 13, 2011 6:50 PM
To: Jeff Kirsher; Jesse Brandeburg; Bruce Allan; Carolyn Wyborny; Don Skidmore; Greg Rose; Peter P Waskiewicz Jr; Alex Duyck; John Ronciak; e1000-devel@lists.sourceforge.net; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
Cc: Prasanna Panchamukhi; Chaitanya Lala; Francis St. Amant; miles.ito@intel.com; Jiang Wang
Subject: [PATCH 2/2] e100: power off PHY after reset when interface is down
PHYs supported by e100 re-starts auto-negotiation after writing to BMCR_RESET bit. This patch powers down PHY when the interface is down and reset is issued.
Signed-off-by: Jiang Wang <Jiang.Wang@riverbed.com>
---
drivers/net/ethernet/intel/e100.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 9824e0a..b8e4910 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2386,6 +2386,13 @@ static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
err = mii_ethtool_sset(&nic->mii, cmd);
e100_exec_cb(nic, NULL, e100_configure);
+ if (!netif_running(netdev) && !(nic->flags & wol_magic)) {
+ uint16_t phy_data;
+ phy_data = mdio_read(nic->netdev, nic->mii.phy_id, MII_BMCR);
+ phy_data |= BMCR_PDOWN;
+ mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, phy_data);
+ }
+
return err;
}
--
1.7.1
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-16 2:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 2:49 [PATCH 1/2] e100: power down PHY if WOL is not enabled Jiang Wang
2011-12-14 2:49 ` [PATCH 2/2] e100: power off PHY after reset when interface is down Jiang Wang
2011-12-16 2:29 ` Jiang Wang
2011-12-14 20:30 ` [PATCH 1/2] e100: power down PHY if WOL is not enabled Ben Hutchings
2011-12-14 21:59 ` Jiang Wang
2011-12-14 22:07 ` Ben Hutchings
2011-12-14 22:16 ` Jiang Wang
2011-12-16 2:28 ` Jiang Wang
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).