From: Jeff Garzik <jeff@garzik.org>
To: akpm@osdl.org
Cc: netdev@vger.kernel.org, mingo@elte.hu, arjan@linux.intel.com,
bcrl@kvack.org
Subject: Re: [patch 7/8] lock validator: fix ns83820.c irq-flags bug
Date: Sun, 11 Jun 2006 13:01:46 -0400 [thread overview]
Message-ID: <448C4C7A.7020301@garzik.org> (raw)
In-Reply-To: <200606090519.k595JmDG032032@shell0.pdx.osdl.net>
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
akpm@osdl.org wrote:
> diff -puN drivers/net/ns83820.c~lock-validator-fix-ns83820c-irq-flags-bug drivers/net/ns83820.c
> --- devel/drivers/net/ns83820.c~lock-validator-fix-ns83820c-irq-flags-bug 2006-06-08 22:18:34.000000000 -0700
> +++ devel-akpm/drivers/net/ns83820.c 2006-06-08 22:18:48.000000000 -0700
> @@ -804,7 +804,7 @@ static int ns83820_setup_rx(struct net_d
>
> writel(dev->IMR_cache, dev->base + IMR);
> writel(1, dev->base + IER);
> - spin_unlock_irq(&dev->misc_lock);
> + spin_unlock(&dev->misc_lock);
>
> kick_rx(ndev);
>
The above code snippet removes the nested unlock-irq, but now the code
is unbalanced, so IMO this patch _adds_ confusion.
I think the conservative patch for 2.6.17 is the one I have attached.
Unless there are objections, that is what I will forward...
Jeff
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1156 bytes --]
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 706aed7..cee0e74 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -776,9 +776,11 @@ static int ns83820_setup_rx(struct net_d
ret = rx_refill(ndev, GFP_KERNEL);
if (!ret) {
+ unsigned long flags;
+
dprintk("starting receiver\n");
/* prevent the interrupt handler from stomping on us */
- spin_lock_irq(&dev->rx_info.lock);
+ spin_lock_irqsave(&dev->rx_info.lock, flags);
writel(0x0001, dev->base + CCSR);
writel(0, dev->base + RFCR);
@@ -790,7 +792,7 @@ static int ns83820_setup_rx(struct net_d
phy_intr(ndev);
/* Okay, let it rip */
- spin_lock_irq(&dev->misc_lock);
+ spin_lock(&dev->misc_lock);
dev->IMR_cache |= ISR_PHY;
dev->IMR_cache |= ISR_RXRCMP;
//dev->IMR_cache |= ISR_RXERR;
@@ -804,11 +806,11 @@ static int ns83820_setup_rx(struct net_d
writel(dev->IMR_cache, dev->base + IMR);
writel(1, dev->base + IER);
- spin_unlock_irq(&dev->misc_lock);
+ spin_unlock(&dev->misc_lock);
kick_rx(ndev);
- spin_unlock_irq(&dev->rx_info.lock);
+ spin_unlock_irqrestore(&dev->rx_info.lock, flags);
}
return ret;
}
next prev parent reply other threads:[~2006-06-11 17:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200606090519.k595JmDG032032@shell0.pdx.osdl.net>
2006-06-11 14:55 ` [patch 7/8] lock validator: fix ns83820.c irq-flags bug Jeff Garzik
2006-06-11 15:00 ` Arjan van de Ven
2006-06-11 16:09 ` Jeff Garzik
2006-06-11 16:12 ` Arjan van de Ven
2006-06-11 17:01 ` Jeff Garzik [this message]
2006-06-11 17:02 ` Arjan van de Ven
2006-06-11 20:28 ` Benjamin LaHaise
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=448C4C7A.7020301@garzik.org \
--to=jeff@garzik.org \
--cc=akpm@osdl.org \
--cc=arjan@linux.intel.com \
--cc=bcrl@kvack.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.