[PATCH] : Fix tg3_set_power_state()

Linux Kernel Mailing List <[email protected]> Tue, 24 May 2005 12:42:59 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1540, 2005/05/24 09:42:59-03:00, [email protected]

	[PATCH] : Fix tg3_set_power_state()
	
	[TG3]: Fix tg3_set_power_state()
	
	Fix tg3_set_power_state to drive GPIOs properly based on the
	TG3_FLAG_EEPROM_WRITE_PROTECT flag. Some delays are also added after D0
	and D3 power state changes.
	
	Signed-off-by: Michael Chan <[email protected]>
	Signed-off-by: David S. Miller <[email protected]>



 tg3.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)


diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c	2005-05-24 14:05:47 -07:00
+++ b/drivers/net/tg3.c	2005-05-24 14:05:47 -07:00
@@ -989,8 +989,13 @@
 		pci_write_config_word(tp->pdev,
 				      pm + PCI_PM_CTRL,
 				      power_control);
-		tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
-		udelay(100);
+		udelay(100);	/* Delay after power state change */
+
+		/* Switch out of Vaux if it is not a LOM */
+		if (!(tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT)) {
+			tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
+			udelay(100);
+		}
 
 		return 0;
 
@@ -1135,6 +1140,7 @@
 
 	/* Finally, set the new power state. */
 	pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
+	udelay(100);	/* Delay after power state change */
 
 	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);