netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org, matthew@wil.cx, rusty@rustcorp.com.au,
	mingo@elte.hu, linux-kernel@vger.kernel.org, arjan@infradead.org,
	mokuno@sm.sony.co.jp, geoffrey.levand@am.sony.com
Subject: [PATCH 3/3] ps3: gelic: updown_lock semaphore to mutex
Date: Thu, 22 May 2008 00:00:03 -0700	[thread overview]
Message-ID: <20080522195406.642307415@mvista.com> (raw)
In-Reply-To: 20080522195404.061391772@mvista.com

[-- Attachment #1: ps3-gelic-net-updown_lock-semaphore-to-mutex.patch --]
[-- Type: text/plain, Size: 2197 bytes --]

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 drivers/net/ps3_gelic_net.c |   10 +++++-----
 drivers/net/ps3_gelic_net.h |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

Index: linux-2.6.25/drivers/net/ps3_gelic_net.c
===================================================================
--- linux-2.6.25.orig/drivers/net/ps3_gelic_net.c
+++ linux-2.6.25/drivers/net/ps3_gelic_net.c
@@ -110,7 +110,7 @@ static void gelic_card_get_ether_port_st
 void gelic_card_up(struct gelic_card *card)
 {
 	pr_debug("%s: called\n", __func__);
-	down(&card->updown_lock);
+	mutex_lock(&card->updown_lock);
 	if (atomic_inc_return(&card->users) == 1) {
 		pr_debug("%s: real do\n", __func__);
 		/* enable irq */
@@ -120,7 +120,7 @@ void gelic_card_up(struct gelic_card *ca
 
 		napi_enable(&card->napi);
 	}
-	up(&card->updown_lock);
+	mutex_unlock(&card->updown_lock);
 	pr_debug("%s: done\n", __func__);
 }
 
@@ -128,7 +128,7 @@ void gelic_card_down(struct gelic_card *
 {
 	u64 mask;
 	pr_debug("%s: called\n", __func__);
-	down(&card->updown_lock);
+	mutex_lock(&card->updown_lock);
 	if (atomic_dec_if_positive(&card->users) == 0) {
 		pr_debug("%s: real do\n", __func__);
 		napi_disable(&card->napi);
@@ -146,7 +146,7 @@ void gelic_card_down(struct gelic_card *
 		/* stop tx */
 		gelic_card_disable_txdmac(card);
 	}
-	up(&card->updown_lock);
+	mutex_unlock(&card->updown_lock);
 	pr_debug("%s: done\n", __func__);
 }
 
@@ -1534,7 +1534,7 @@ static struct gelic_card *gelic_alloc_ca
 	INIT_WORK(&card->tx_timeout_task, gelic_net_tx_timeout_task);
 	init_waitqueue_head(&card->waitq);
 	atomic_set(&card->tx_timeout_task_counter, 0);
-	init_MUTEX(&card->updown_lock);
+	mutex_init(&card->updown_lock);
 	atomic_set(&card->users, 0);
 
 	return card;
Index: linux-2.6.25/drivers/net/ps3_gelic_net.h
===================================================================
--- linux-2.6.25.orig/drivers/net/ps3_gelic_net.h
+++ linux-2.6.25/drivers/net/ps3_gelic_net.h
@@ -298,7 +298,7 @@ struct gelic_card {
 	wait_queue_head_t waitq;
 
 	/* only first user should up the card */
-	struct semaphore updown_lock;
+	struct mutex updown_lock;
 	atomic_t users;
 
 	u64 ether_port_status;

-- 

  parent reply	other threads:[~2008-05-22 20:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22  7:00 [PATCH 1/3] ps3: gelic: scan_lock semaphore to mutex Daniel Walker
2008-05-22  7:00 ` [PATCH 2/3] ps3: gelic: assoc_stat_lock " Daniel Walker
2008-05-22  7:00 ` Daniel Walker [this message]
2008-05-31  2:20   ` [PATCH 3/3] ps3: gelic: updown_lock " Jeff Garzik
     [not found] ` <20080522195404.061391772-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
2008-05-27  7:24   ` [PATCH 1/3] ps3: gelic: scan_lock " Masakazu Mokuno

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=20080522195406.642307415@mvista.com \
    --to=dwalker@mvista.com \
    --cc=arjan@infradead.org \
    --cc=geoffrey.levand@am.sony.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=mingo@elte.hu \
    --cc=mokuno@sm.sony.co.jp \
    --cc=netdev@vger.kernel.org \
    --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).