netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Mike McCormack <mikem@ring3k.org>, David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org,
	Rene Mayrhofer <rene.mayrhofer@gibraltar.at>,
	Richard Leitner <leitner@esys.at>
Subject: [PATCH]  sky2: fix management of driver LED
Date: Mon, 31 Aug 2009 10:31:41 -0700	[thread overview]
Message-ID: <20090831103141.77598705@nehalam> (raw)
In-Reply-To: <4A9928C9.7000907@ring3k.org>

Observed by Mike McCormack.

The LED bit here is just a software controlled value used to
turn on one of the LED's on some boards. The register value was wrong,
which could have been causing some power control issues.
Get rid of problematic define use the correct mask.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/sky2.c |   12 ++++++------
 drivers/net/sky2.h |    9 +--------
 2 files changed, 7 insertions(+), 14 deletions(-)

--- a/drivers/net/sky2.c	2009-08-31 09:05:07.941736447 -0700
+++ b/drivers/net/sky2.c	2009-08-31 09:46:24.611967164 -0700
@@ -256,6 +256,9 @@ static void sky2_power_on(struct sky2_hw
 
 		sky2_read32(hw, B2_GP_IO);
 	}
+
+	/* Turn on "driver loaded" LED */
+	sky2_write16(hw, B0_CTST, Y2_LED_STAT_ON);
 }
 
 static void sky2_power_aux(struct sky2_hw *hw)
@@ -274,6 +277,9 @@ static void sky2_power_aux(struct sky2_h
 		sky2_write8(hw, B0_POWER_CTRL,
 			    (PC_VAUX_ENA | PC_VCC_ENA |
 			     PC_VAUX_ON | PC_VCC_OFF));
+
+	/* turn off "driver loaded LED" */
+	sky2_write16(hw, B0_CTST, Y2_LED_STAT_OFF);
 }
 
 static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port)
@@ -1866,9 +1872,6 @@ static int sky2_down(struct net_device *
 	sky2_phy_power_down(hw, port);
 	spin_unlock_bh(&sky2->phy_lock);
 
-	/* turn off LED's */
-	sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
-
 	sky2_tx_reset(hw, port);
 
 	/* Free any pending frames stuck in HW queue */
@@ -2982,8 +2985,6 @@ static void sky2_reset(struct sky2_hw *h
 	sky2_write8(hw, B2_TI_CTRL, TIM_STOP);
 	sky2_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ);
 
-	sky2_write8(hw, B0_Y2LED, LED_STAT_ON);
-
 	/* Turn off descriptor polling */
 	sky2_write32(hw, B28_DPT_CTRL, DPT_STOP);
 
@@ -4600,7 +4601,6 @@ static void __devexit sky2_remove(struct
 
 	sky2_power_aux(hw);
 
-	sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);
 	sky2_write8(hw, B0_CTST, CS_RST_SET);
 	sky2_read8(hw, B0_CTST);
 
--- a/drivers/net/sky2.h	2009-08-31 09:05:07.954719390 -0700
+++ b/drivers/net/sky2.h	2009-08-31 09:05:36.488716877 -0700
@@ -155,7 +155,7 @@ enum pci_cfg_reg1 {
 enum csr_regs {
 	B0_RAP		= 0x0000,
 	B0_CTST		= 0x0004,
-	B0_Y2LED	= 0x0005,
+
 	B0_POWER_CTRL	= 0x0007,
 	B0_ISRC		= 0x0008,
 	B0_IMSK		= 0x000c,
@@ -283,13 +283,6 @@ enum {
 	CS_RST_SET	= 1,	/* Set   Software reset	*/
 };
 
-/*	B0_LED			 8 Bit	LED register */
-enum {
-/* Bit  7.. 2:	reserved */
-	LED_STAT_ON	= 1<<1,	/* Status LED on	*/
-	LED_STAT_OFF	= 1,	/* Status LED off	*/
-};
-
 /*	B0_POWER_CTRL	 8 Bit	Power Control reg (YUKON only) */
 enum {
 	PC_VAUX_ENA	= 1<<7,	/* Switch VAUX Enable  */

  parent reply	other threads:[~2009-08-31 17:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-29 13:10 [PATCH] sky2: Don't try to turn led off in sky2_down() Mike McCormack
2009-08-29 13:17 ` Mike McCormack
2009-08-29 17:57 ` Stephen Hemminger
2009-08-30  0:37   ` Mike McCormack
2009-08-31  9:48 ` Rene Mayrhofer
2009-08-31  9:58 ` Rene Mayrhofer
2009-09-03 16:16   ` [PATCH] sky2: only enable Vaux if capable of wakeup Stephen Hemminger
2009-09-04  3:10     ` David Miller
2009-09-04 11:55     ` Rene Mayrhofer
2009-08-31 17:31 ` Stephen Hemminger [this message]
2009-09-02  0:44   ` [PATCH] sky2: fix management of driver LED David Miller
2009-09-02  4:33     ` Stephen Hemminger
2009-09-02  7:28       ` Rene Mayrhofer
2009-09-02  7:33       ` David Miller

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=20090831103141.77598705@nehalam \
    --to=shemminger@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=leitner@esys.at \
    --cc=mikem@ring3k.org \
    --cc=netdev@vger.kernel.org \
    --cc=rene.mayrhofer@gibraltar.at \
    /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).