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

* Re: [PATCH] forcedeth boot delay fix
  2007-11-20  9:08 ` Andrew Morton
@ 2007-11-19 18:13   ` Ayaz Abdulla
  0 siblings, 0 replies; 3+ messages in thread
From: Ayaz Abdulla @ 2007-11-19 18:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jeff Garzik, Manfred Spraul, nedev, stable

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

Missed that "break". Here is the corrected patch.

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



Andrew Morton wrote:
> On Sun, 18 Nov 2007 14:13:41 -0500 Ayaz Abdulla <aabdulla@nvidia.com> wrote:
> 
> 
>>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>
>>
>>
>>
>>[patch-forcedeth-sema-fix  text/plain (1.3KB)]
>>--- 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;
>> 			}
>> 		}
>> 	}
> 
> 
> drivers/net/forcedeth.c: In function 'nv_probe':
> drivers/net/forcedeth.c:5307: error: break statement not within loop or switch  

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

--- old/drivers/net/forcedeth.c	2007-11-08 17:33:00.000000000 -0500
+++ new/drivers/net/forcedeth.c	2007-11-19 13:09:03.000000000 -0500
@@ -5286,19 +5286,15 @@
 		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 */
 				}
 			}
 		}

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

* Re: [PATCH] forcedeth boot delay fix
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-11-20  9:08 UTC (permalink / raw)
  To: Ayaz Abdulla; +Cc: Jeff Garzik, Manfred Spraul, nedev, stable

On Sun, 18 Nov 2007 14:13:41 -0500 Ayaz Abdulla <aabdulla@nvidia.com> wrote:

> 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>
> 
> 
> 
> [patch-forcedeth-sema-fix  text/plain (1.3KB)]
> --- 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;
>  			}
>  		}
>  	}

drivers/net/forcedeth.c: In function 'nv_probe':
drivers/net/forcedeth.c:5307: error: break statement not within loop or switch  

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