From: Michael Buesch <mb@bu3sch.de>
To: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH 1/5] Use mutex instead of semaphore in the Host AP driver
Date: Mon, 30 Jul 2007 00:06:41 +0200 [thread overview]
Message-ID: <200707300006.42397.mb@bu3sch.de> (raw)
In-Reply-To: <20070729213434.GD3432@traven>
On Sunday 29 July 2007 23:34, Matthias Kaehlcke wrote:
> The Host AP driver uses a semaphore as mutex. Use the mutex API
> instead of the (binary) semaphore.
>
> Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
>
> --
>
> - res = down_interruptible(&local->rid_bap_sem);
> + res = mutex_lock_interruptible(&local->rid_bap_mtx);
> if (res)
> return res;
>
> @@ -902,7 +902,7 @@ static int hfa384x_set_rid(struct net_device *dev, u16 rid, void *buf, int len)
> /* RID len in words and +1 for rec.rid */
> rec.len = cpu_to_le16(len / 2 + len % 2 + 1);
>
> - res = down_interruptible(&local->rid_bap_sem);
> + res = mutex_lock_interruptible(&local->rid_bap_mtx);
> if (res)
> return res;
>
Is res returned to userspace? If yes, that's not right.
On a interrupted mutex allocation you should return
-ERESTARTSYS to userspace.
next prev parent reply other threads:[~2007-07-29 22:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070729212909.GC3432@traven>
2007-07-29 21:34 ` [PATCH 1/5] Use mutex instead of semaphore in the Host AP driver Matthias Kaehlcke
2007-07-29 22:06 ` Michael Buesch [this message]
2007-07-30 3:18 ` Satyam Sharma
2007-07-30 3:47 ` Satyam Sharma
2007-07-30 5:40 ` Matthias Kaehlcke
2007-07-30 7:20 ` Satyam Sharma
2007-07-30 14:50 ` John W. Linville
2007-07-30 20:14 ` Satyam Sharma
2007-07-30 20:13 ` Randy Dunlap
2007-07-30 17:09 ` Michael Buesch
2007-07-30 19:23 ` Andrew Morton
2007-07-30 20:11 ` Satyam Sharma
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=200707300006.42397.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=matthias.kaehlcke@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;
as well as URLs for NNTP newsgroup(s).