[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CEE05A0D7856E14880AD5560634EBEA82AA789D1@365EXCH-MBX-P5.nbttech.com>
Date: Fri, 16 Dec 2011 02:28:03 +0000
From: Jiang Wang <Jiang.Wang@...erbed.com>
To: Ben Hutchings <bhutchings@...arflare.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Bruce Allan <bruce.w.allan@...el.com>,
Carolyn Wyborny <carolyn.wyborny@...el.com>,
Don Skidmore <donald.c.skidmore@...el.com>,
Greg Rose <gregory.v.rose@...el.com>,
Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@...el.com>,
Alex Duyck <alexander.h.duyck@...el.com>,
John Ronciak <john.ronciak@...el.com>,
"e1000-devel@...ts.sourceforge.net"
<e1000-devel@...ts.sourceforge.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Prasanna Panchamukhi <Prasanna.Panchamukhi@...erbed.com>,
Chaitanya Lala <Chaitanya.Lala@...erbed.com>,
"Francis St. Amant" <Francis.St.Amant@...erbed.com>,
"miles.ito@...el.com" <miles.ito@...el.com>
Subject: RE: [PATCH 1/2] e100: power down PHY if WOL is not enabled
Modified the patch.
From 16c145e8c6b9fdaf94dfdc91211faba88359aaab Mon Sep 17 00:00:00 2001
From: Jiang Wang <Jiang.Wang@...erbed.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@...erbed.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@...erbed.com
www.riverbed.com
-----Original Message-----
From: Ben Hutchings [mailto:bhutchings@...arflare.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@...ts.sourceforge.net; netdev@...r.kernel.org; linux-kernel@...r.kernel.org; Prasanna Panchamukhi; Chaitanya Lala; Francis St. Amant; miles.ito@...el.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.
Powered by blists - more mailing lists