public inbox for b43-dev@lists.infradead.org
 help / color / mirror / Atom feed
From: "Michael Büsch" <mb@bu3sch.de>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org
Subject: [PATCH 2/4] b43: N-PHY: implement radio 2056 init steps
Date: Tue, 21 Dec 2010 23:25:54 +0100	[thread overview]
Message-ID: <1292970354.27806.10.camel@maggie> (raw)
In-Reply-To: <AANLkTi=--XSasFtDpiq-uXDrMWjQzrK-cnGZVyqFsSif@mail.gmail.com> (sfid-20101221_072059_167761_B6991268)

On Tue, 2010-12-21 at 13:20 +0100, Rafa? Mi?ecki wrote: 
> W dniu 21 grudnia 2010 12:34 u?ytkownik Michael B?sch <mb@bu3sch.de> napisa?:
> > On Tue, 2010-12-21 at 11:50 +0100, Rafa? Mi?ecki wrote:
> >> +static void b43_radio_init2056_post(struct b43_wldev *dev)
> >> +{
> >> +     b43_radio_set(dev, B2056_SYN_COM_CTRL, 0xB);
> >> +     b43_radio_set(dev, B2056_SYN_COM_PU, 0x2);
> >> +     b43_radio_set(dev, B2056_SYN_COM_RESET, 0x2);
> >> +     mdelay(1);
> >
> > Please don't use mdelay() ever. The driver is fully preemptible.
> > Use msleep() instead.
> 
> So, using "msleep" allows kernel to switch context, while using
> "mdelay" does not?

Yeah well. msleep() does switch context (at least to the idle task,
if there's nothing else to do). Whereas mdelay() busy-waits in a tight
loop. So on a non-preemptible kernel you will lock up the CPU (and if
there's only one CPU, the whole system) for a millisecond by using
mdelay(). On a preemptible kernel it's somewhat mitigated, but I think
explicit sleep is still better there. Also for advanced speedstep and
powersaving considerations.
In the past we did significant efforts to make the whole driver (Except
the very tiny hardirq handler) preemptible. This improved things a
lot. In the old days, bringing the interface up came along with 
about one-second system lockup (on UP, nonpreempt) and the periodic work
frequently caused things like audio to break. Today that's not an issue
anymore due to removal of huge mdelay() calls and preemptible locking.
Always remember that a millisecond really is a _huge_ amount of time
on a modern CPU.

> If so, should be convert our longer udelay calls (like 300us) to usleep?

Well, in my opinion, yes. I'm pretty sure opinions on that will diverge
from developer to developer, but I think at least in stuff like
periodically happening tasks we should avoid those delays and
use msleep(1) instead.

-- 
Greetings Michael.

  reply	other threads:[~2010-12-21 22:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21 10:50 [PATCH 1/4] b43: use correct firmware for newer cores Rafał Miłecki
2010-12-21 10:50 ` [PATCH 2/4] b43: N-PHY: implement radio 2056 init steps Rafał Miłecki
2010-12-21 11:34   ` Michael Büsch
2010-12-21 12:20     ` Rafał Miłecki
2010-12-21 22:25       ` Michael Büsch [this message]
2010-12-21 22:33         ` Rafał Miłecki
2010-12-21 10:50 ` [PATCH 3/4] b43: N-PHY: add init tables for 2056 radio Rafał Miłecki
2010-12-21 10:50 ` [PATCH 4/4] b43: N-PHY: avoid PHY hangs for rev 3 and 4 Rafał Miłecki
     [not found] ` <1292948026-472-1-git-send-email-zajec5@gmail.com>
2010-12-21 16:13   ` [PATCH 2/4 V2] b43: N-PHY: implement radio 2056 init steps Rafał Miłecki

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=1292970354.27806.10.camel@maggie \
    --to=mb@bu3sch.de \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=zajec5@gmail.com \
    /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