From: Larry Finger <Larry.Finger@lwfinger.net>
To: Erik Mouw <erik@harddisk-recovery.com>
Cc: dbtsai@gmail.com, John Linville <linville@tuxdriver.com>,
netdev@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: Bcm43xx softMac Driver in 2.6.18
Date: Fri, 22 Sep 2006 09:31:09 -0500 [thread overview]
Message-ID: <4513F3AD.9070603@lwfinger.net> (raw)
In-Reply-To: <20060922135352.GD4122@harddisk-recovery.com>
[-- Attachment #1: Type: text/plain, Size: 934 bytes --]
Erik Mouw wrote:
> On Fri, Sep 22, 2006 at 08:20:08AM -0500, Larry Finger wrote:
>> This patch, which was originally sent to John Linville on 9/14/06,
>> has been taken against 2.6.18. It changes more lines
>> than would be absolutely necessary to affect the fix; however, it
>> ends up with this section looking exactly like the current code (with
>> pending patches) that is in wireless-2.6.
>
> Sorry, but your patch doesn't apply cleanly against 2.6.18:
>
> erik@arthur:~/git/linux-2.6 > patch -p1 --dry-run < ../bcm43xx-2.6.18.diff
> patching file drivers/net/wireless/bcm43xx/bcm43xx_main.c
> Hunk #1 FAILED at 3182.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/net/wireless/bcm43xx/bcm43xx_main.c.rej
Arrrgh! My mailer messed up the white space and put spaces instead of tabs. The correct patch is
attached here so it doesn't happen again. This one has been tested against a clean download of 2.6.18.
Larry
[-- Attachment #2: patch_preempt --]
[-- Type: text/plain, Size: 2009 bytes --]
Index: linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- linux-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -3182,39 +3182,37 @@ static void bcm43xx_periodic_work_handle
/* Periodic work will take a long time, so we want it to
* be preemtible.
*/
- bcm43xx_lock_irqonly(bcm, flags);
- netif_stop_queue(bcm->net_dev);
+ mutex_lock(&bcm->mutex);
+ netif_tx_disable(bcm->net_dev);
+ spin_lock_irqsave(&bcm->irq_lock, flags);
+ bcm43xx_mac_suspend(bcm);
if (bcm43xx_using_pio(bcm))
bcm43xx_pio_freeze_txqueues(bcm);
savedirqs = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL);
- bcm43xx_unlock_irqonly(bcm, flags);
- bcm43xx_lock_noirq(bcm);
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
bcm43xx_synchronize_irq(bcm);
} else {
/* Periodic work should take short time, so we want low
* locking overhead.
*/
- bcm43xx_lock_irqsafe(bcm, flags);
+ mutex_lock(&bcm->mutex);
+ spin_lock_irqsave(&bcm->irq_lock, flags);
}
do_periodic_work(bcm);
if (badness > BADNESS_LIMIT) {
- bcm43xx_lock_irqonly(bcm, flags);
- if (likely(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED)) {
- tasklet_enable(&bcm->isr_tasklet);
- bcm43xx_interrupt_enable(bcm, savedirqs);
- if (bcm43xx_using_pio(bcm))
- bcm43xx_pio_thaw_txqueues(bcm);
- }
+ spin_lock_irqsave(&bcm->irq_lock, flags);
+ tasklet_enable(&bcm->isr_tasklet);
+ bcm43xx_interrupt_enable(bcm, savedirqs);
+ if (bcm43xx_using_pio(bcm))
+ bcm43xx_pio_thaw_txqueues(bcm);
+ bcm43xx_mac_enable(bcm);
netif_wake_queue(bcm->net_dev);
- mmiowb();
- bcm43xx_unlock_irqonly(bcm, flags);
- bcm43xx_unlock_noirq(bcm);
- } else {
- mmiowb();
- bcm43xx_unlock_irqsafe(bcm, flags);
}
+ mmiowb();
+ spin_unlock_irqrestore(&bcm->irq_lock, flags);
+ mutex_unlock(&bcm->mutex);
}
static void bcm43xx_periodic_tasks_delete(struct bcm43xx_private *bcm)
next prev parent reply other threads:[~2006-09-22 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-22 13:20 Bcm43xx softMac Driver in 2.6.18 Larry Finger
2006-09-22 13:53 ` Erik Mouw
2006-09-22 14:31 ` Larry Finger [this message]
2006-09-23 6:03 ` Ray Lee
2006-09-23 9:41 ` Rafael J. Wysocki
2006-09-23 16:51 ` Ray Lee
[not found] ` <45156612.2080906-0Cg02Ec9UG4BXFe83j6qeQ@public.gmane.org>
2006-09-23 18:00 ` Larry Finger
2006-09-23 20:21 ` Larry Finger
2006-09-29 21:23 ` Ray Lee
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=4513F3AD.9070603@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=dbtsai@gmail.com \
--cc=erik@harddisk-recovery.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
--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 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).