From: Dan Williams <dcbw@redhat.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Daniel Walker <dwalker@mvista.com>,
linville@tuxdriver.com, rusty@rustcorp.com.au, mingo@elte.hu,
linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
arjan@infradead.org
Subject: Re: [PATCH] net: wireless: airo semaphore to mutex
Date: Tue, 27 May 2008 09:48:28 -0400 [thread overview]
Message-ID: <1211896108.1746.3.camel@localhost.localdomain> (raw)
In-Reply-To: <20080527131325.GJ30894@parisc-linux.org>
On Tue, 2008-05-27 at 07:13 -0600, Matthew Wilcox wrote:
> On Thu, May 22, 2008 at 04:21:03PM -0700, Daniel Walker wrote:
> > Signed-off-by: Daniel Walker <dwalker@mvista.com>
>
> Reviewing the driver, this really doesn't feel like a classical lock.
> It feels very much ad-hoc, with most references to ->sem being
> unbalanced.
It should be a classical lock actually. There shouldn't be any case
where semaphore behavior is used or needed.
> The driver has a thread (airo_thread) and it seems to be trying to
> synchronise against both the interrupt handler, and other threads
> (calling eg ->get_stats).
Right, though it's important to note that anything coming from WEXT will
already be under the rtnl lock and should already be serialized, so we
don't need to protect any of the WEXT handlers _from themselves_, just
from the main thread and the interrupt handler.
> I think it really wants to be using spin_lock_irqsave() instead of a
> mutex. I'd want to study the driver in a lot more detail before making
> that kind of change though.
Yeah, that might be the right way to go. If you want to jump into the
driver, feel quite free, but I don't think you need to go into too much
detail with it. Your overall behavior analysis is right on the mark
already.
Dan
next prev parent reply other threads:[~2008-05-27 13:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-22 23:21 [PATCH] net: wireless: airo semaphore to mutex Daniel Walker
2008-05-26 17:29 ` Michal Schmidt
2008-05-26 17:59 ` Daniel Walker
2008-05-27 1:17 ` Rusty Russell
2008-05-27 2:15 ` Matthew Wilcox
2008-05-27 4:34 ` Daniel Walker
2008-05-27 11:24 ` Matthew Wilcox
2008-05-27 4:37 ` Rusty Russell
2008-05-27 13:13 ` Matthew Wilcox
2008-05-27 13:48 ` Dan Williams [this message]
2008-05-27 15:08 ` Daniel Walker
2008-05-27 15:34 ` Matthew Wilcox
2008-05-27 16:01 ` Daniel Walker
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=1211896108.1746.3.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=arjan@infradead.org \
--cc=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=matthew@wil.cx \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
/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).