netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] forcedeth boot delay fix
@ 2007-11-18 19:13 Ayaz Abdulla
  2007-11-20  9:08 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Ayaz Abdulla @ 2007-11-18 19:13 UTC (permalink / raw)
  To: Jeff Garzik, Manfred Spraul, Andrew Morton, nedev, stable

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

This patch fixes a long boot delay in the forcedeth driver. During 
initialization, the timeout for the handshake between mgmt unit and 
driver can be very long. The patch reduces the timeout by eliminating a 
extra loop around the timeout logic.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>


[-- Attachment #2: patch-forcedeth-sema-fix --]
[-- Type: text/plain, Size: 1361 bytes --]

--- old/drivers/net/forcedeth.c	2007-11-08 17:33:00.000000000 -0500
+++ new/drivers/net/forcedeth.c	2007-11-08 17:34:25.000000000 -0500
@@ -5286,20 +5286,17 @@
 		if (readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_PHY_INIT) {
 			np->mac_in_use = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_ST;
 			dprintk(KERN_INFO "%s: mgmt unit is running. mac in use %x.\n", pci_name(pci_dev), np->mac_in_use);
-			for (i = 0; i < 5000; i++) {
-				msleep(1);
-				if (nv_mgmt_acquire_sema(dev)) {
-					/* management unit setup the phy already? */
-					if ((readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK) ==
-					    NVREG_XMITCTL_SYNC_PHY_INIT) {
-						/* phy is inited by mgmt unit */
-						phyinitialized = 1;
-						dprintk(KERN_INFO "%s: Phy already initialized by mgmt unit.\n", pci_name(pci_dev));
-					} else {
-						/* we need to init the phy */
-					}
-					break;
+			if (nv_mgmt_acquire_sema(dev)) {
+				/* management unit setup the phy already? */
+				if ((readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK) ==
+				    NVREG_XMITCTL_SYNC_PHY_INIT) {
+					/* phy is inited by mgmt unit */
+					phyinitialized = 1;
+					dprintk(KERN_INFO "%s: Phy already initialized by mgmt unit.\n", pci_name(pci_dev));
+				} else {
+					/* we need to init the phy */
 				}
+				break;
 			}
 		}
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-20 19:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-18 19:13 [PATCH] forcedeth boot delay fix Ayaz Abdulla
2007-11-20  9:08 ` Andrew Morton
2007-11-19 18:13   ` Ayaz Abdulla

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).