From: Ayaz Abdulla <aabdulla@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeff Garzik <jgarzik@pobox.com>,
Manfred Spraul <manfred@colorfullife.com>,
nedev <netdev@vger.kernel.org>,
stable@kernel.org
Subject: Re: [PATCH] forcedeth boot delay fix
Date: Mon, 19 Nov 2007 13:13:12 -0500 [thread overview]
Message-ID: <4741D238.4050005@nvidia.com> (raw)
In-Reply-To: <20071120010858.4d098194.akpm@linux-foundation.org>
[-- 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 */
}
}
}
prev parent reply other threads:[~2007-11-20 19:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=4741D238.4050005@nvidia.com \
--to=aabdulla@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=jgarzik@pobox.com \
--cc=manfred@colorfullife.com \
--cc=netdev@vger.kernel.org \
--cc=stable@kernel.org \
/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).