From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: Ben Collins <bcollins@ubuntu.com>,
"Serge E. Hallyn" <serue@us.ibm.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Christoph Hellwig <hch@infradead.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.17-rc6-mm2 6/6] ieee1394: convert nodemgr_serialize semaphore to mutex
Date: Sun, 18 Jun 2006 19:05:50 +0200 (CEST) [thread overview]
Message-ID: <tkrat.13f1e5efe9b17b13@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.d002fde02fba70c0@s5r6.in-berlin.de>
Another trivial sem2mutex conversion.
Side note: nodemgr_serialize's purpose, when introduced in linux1394's
revision 529 in July 2002, was to protect several data structures which
are now largely handled by or together with Linux' driver core and are
now protected by the LDM's own mechanisms. It may very well be possible
to get rid of this mutex entirely now. But fully parallelized node
scanning is on our long-term TODO list anyway.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
Index: linux/drivers/ieee1394/nodemgr.c
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.c 2006-06-18 16:34:45.000000000 +0200
+++ linux/drivers/ieee1394/nodemgr.c 2006-06-18 17:28:48.000000000 +0200
@@ -157,7 +157,7 @@ static struct csr1212_bus_ops nodemgr_cs
* but now we are much simpler because of the LDM.
*/
-static DECLARE_MUTEX(nodemgr_serialize);
+static DEFINE_MUTEX(nodemgr_serialize);
struct host_info {
struct hpsb_host *host;
@@ -1615,7 +1615,7 @@ static int nodemgr_host_thread(void *__h
if (kthread_should_stop())
goto exit;
- if (down_interruptible(&nodemgr_serialize)) {
+ if (mutex_lock_interruptible(&nodemgr_serialize)) {
if (try_to_freeze())
continue;
goto exit;
@@ -1644,7 +1644,7 @@ static int nodemgr_host_thread(void *__h
if (!nodemgr_check_irm_capability(host, reset_cycles) ||
!nodemgr_do_irm_duties(host, reset_cycles)) {
reset_cycles++;
- up(&nodemgr_serialize);
+ mutex_unlock(&nodemgr_serialize);
continue;
}
reset_cycles = 0;
@@ -1662,10 +1662,10 @@ static int nodemgr_host_thread(void *__h
/* Update some of our sysfs symlinks */
nodemgr_update_host_dev_links(host);
- up(&nodemgr_serialize);
+ mutex_unlock(&nodemgr_serialize);
}
unlock_exit:
- up(&nodemgr_serialize);
+ mutex_unlock(&nodemgr_serialize);
exit:
HPSB_VERBOSE("NodeMgr: Exiting thread");
return 0;
next prev parent reply other threads:[~2006-06-18 17:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-10 14:31 [PATCH] kthread conversion: convert ieee1394 from kernel_thread Serge E. Hallyn
2006-06-10 14:42 ` Christoph Hellwig
2006-06-10 15:11 ` Stefan Richter
2006-06-10 15:42 ` Christoph Hellwig
2006-06-10 16:34 ` Ben Collins
2006-06-10 16:38 ` Christoph Hellwig
2006-06-10 18:08 ` Ben Collins
2006-06-10 18:37 ` Christoph Hellwig
2006-06-17 18:44 ` Stefan Richter
2006-06-18 10:29 ` Stefan Richter
2006-06-18 16:57 ` [PATCH 2.6.17-rc6-mm2 0/6] ieee1394: nodemgr: misc API conversions Stefan Richter
2006-06-18 16:57 ` [PATCH 2.6.17-rc6-mm2 1/6] ieee1394: nodemgr: remove unnecessary includes Stefan Richter
2006-06-18 16:59 ` [PATCH 2.6.17-rc6-mm2 2/6] ieee1394: do not spawn a kernel_thread for user-initiated bus rescan Stefan Richter
2006-06-18 17:00 ` [PATCH 2.6.17-rc6-mm2 3/6] ieee1394: make module parameter ignore_drivers writable Stefan Richter
2006-06-18 17:02 ` [PATCH 2.6.17-rc6-mm2 4/6] ieee1394: nodemgr: switch to kthread API Stefan Richter
2006-06-18 17:03 ` [PATCH 2.6.17-rc6-mm2 5/6] ieee1394: nodemgr: replace reset semaphore Stefan Richter
2006-06-18 17:05 ` Stefan Richter [this message]
2006-06-10 18:12 ` [PATCH] kthread conversion: convert ieee1394 from kernel_thread Stefan Richter
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=tkrat.13f1e5efe9b17b13@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=bcollins@ubuntu.com \
--cc=ebiederm@xmission.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=serue@us.ibm.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
all inboxes | Powered by JetHome®