netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Michael Buesch <mb@bu3sch.de>
Cc: Martin Langer <martin-langer@gmx.de>,
	bcm43xx-dev@lists.berlios.de, netdev@vger.kernel.org,
	John Linville <linville@tuxdriver.com>
Subject: Re: [PATCH] ucode debug status via sysfs for wireless-2.6
Date: Thu, 07 Sep 2006 16:05:22 -0500	[thread overview]
Message-ID: <45008992.2080601@lwfinger.net> (raw)
In-Reply-To: <200609072248.39588.mb@bu3sch.de>

Michael Buesch wrote:
> 
> In general, no.
> But, for some sysfs attrs it is sufficient to only take
> the mutex, because:
> * We don't access hardware.
> * We don't modify this data in a spinlock-only critical section.
> 
> Yes, I know that having two locks does not really fit the
> "lock data, not code" model. But it's well defined in bcm43xx,
> so I think we can live with it. (and we must live with it,
> if we want to have preemptible periodic work. And we _want_).
> It's defined by the following rules:
> 
> 1) Always take both, mutex and lock.
> 2) There are only two places where we can't take the
>    mutex, but only the spinlock. IRQ and TX paths.
> 
> (Yes, I know that there are still exceptions to 2.
> At least in dscape. The softmac port should be OK.
> These are bugs, I am aware of them and will fix it)
> 
> So these two rules lead to the following rule:
> 
> * Code where we only take the mutex can race against the
> TX and IRQ paths.
> Now we come back to the sysfs problem above. If the data, we
> access in this sysfs code, is not touched in either TX or IRQ path
> we don't need to take the spinlock. Yes, it's a little bit black
> magic. So if you aren't sure, always take both locks.

Thanks for the clarification.

Larry

  reply	other threads:[~2006-09-07 21:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060904205340.GB3726@tuba>
     [not found] ` <200609042256.54629.mb@bu3sch.de>
     [not found]   ` <20060905181232.GA4733@tuba>
2006-09-07  1:34     ` [PATCH] ucode debug status via sysfs for wireless-2.6 Larry Finger
     [not found]       ` <44FF772A.5000301-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
2006-09-07  8:33         ` Michael Buesch
     [not found]           ` <200609071033.52258.mb-fseUSCV1ubazQB+pC5nmwQ@public.gmane.org>
2006-09-07 13:21             ` Larry Finger
     [not found]               ` <45001CCA.1000304-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
2006-09-07 20:48                 ` Michael Buesch
2006-09-07 21:05                   ` Larry Finger [this message]
2006-09-07 15:12     ` [PATCH] Try 2: " Larry Finger

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=45008992.2080601@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=bcm43xx-dev@lists.berlios.de \
    --cc=linville@tuxdriver.com \
    --cc=martin-langer@gmx.de \
    --cc=mb@bu3sch.de \
    --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).