* Re: [PATCH] atm: ambassador: vcc_sf semaphore to mutex
2008-04-28 18:14 [PATCH] atm: ambassador: vcc_sf semaphore to mutex Daniel Walker
@ 2008-04-28 5:35 ` Arjan van de Ven
2008-04-29 10:39 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2008-04-28 5:35 UTC (permalink / raw)
To: Daniel Walker; +Cc: akpm, gprocida, mingo, matthew, chas, linux-kernel
On Mon, 28 Apr 2008 11:14:45 -0700
Daniel Walker <dwalker@mvista.com> wrote:
> Signed-off-by: Daniel Walker <dwalker@mvista.com>
>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] atm: ambassador: vcc_sf semaphore to mutex
@ 2008-04-28 18:14 Daniel Walker
2008-04-28 5:35 ` Arjan van de Ven
2008-04-29 10:39 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Walker @ 2008-04-28 18:14 UTC (permalink / raw)
To: akpm; +Cc: gprocida, mingo, matthew, chas, linux-kernel
Signed-off-by: Daniel Walker <dwalker@mvista.com>
---
drivers/atm/ambassador.c | 19 ++++++++++---------
drivers/atm/ambassador.h | 2 +-
2 files changed, 11 insertions(+), 10 deletions(-)
Index: linux-2.6.23/drivers/atm/ambassador.c
===================================================================
--- linux-2.6.23.orig/drivers/atm/ambassador.c
+++ linux-2.6.23/drivers/atm/ambassador.c
@@ -33,6 +33,7 @@
#include <linux/interrupt.h>
#include <linux/poison.h>
#include <linux/bitrev.h>
+#include <linux/mutex.h>
#include <asm/atomic.h>
#include <asm/io.h>
@@ -1177,7 +1178,7 @@ static int amb_open (struct atm_vcc * at
vcc->tx_frame_bits = tx_frame_bits;
- down (&dev->vcc_sf);
+ mutex_lock(&dev->vcc_sf);
if (dev->rxer[vci]) {
// RXer on the channel already, just modify rate...
cmd.request = cpu_to_be32 (SRB_MODIFY_VC_RATE);
@@ -1203,7 +1204,7 @@ static int amb_open (struct atm_vcc * at
schedule();
}
dev->txer[vci].tx_present = 1;
- up (&dev->vcc_sf);
+ mutex_unlock(&dev->vcc_sf);
}
if (rxtp->traffic_class != ATM_NONE) {
@@ -1211,7 +1212,7 @@ static int amb_open (struct atm_vcc * at
vcc->rx_info.pool = pool;
- down (&dev->vcc_sf);
+ mutex_lock(&dev->vcc_sf);
/* grow RX buffer pool */
if (!dev->rxq[pool].buffers_wanted)
dev->rxq[pool].buffers_wanted = rx_lats;
@@ -1237,7 +1238,7 @@ static int amb_open (struct atm_vcc * at
schedule();
// this link allows RX frames through
dev->rxer[vci] = atm_vcc;
- up (&dev->vcc_sf);
+ mutex_unlock(&dev->vcc_sf);
}
// indicate readiness
@@ -1262,7 +1263,7 @@ static void amb_close (struct atm_vcc *
if (atm_vcc->qos.txtp.traffic_class != ATM_NONE) {
command cmd;
- down (&dev->vcc_sf);
+ mutex_lock(&dev->vcc_sf);
if (dev->rxer[vci]) {
// RXer still on the channel, just modify rate... XXX not really needed
cmd.request = cpu_to_be32 (SRB_MODIFY_VC_RATE);
@@ -1277,7 +1278,7 @@ static void amb_close (struct atm_vcc *
dev->txer[vci].tx_present = 0;
while (command_do (dev, &cmd))
schedule();
- up (&dev->vcc_sf);
+ mutex_unlock(&dev->vcc_sf);
}
// disable RXing
@@ -1287,7 +1288,7 @@ static void amb_close (struct atm_vcc *
// this is (the?) one reason why we need the amb_vcc struct
unsigned char pool = vcc->rx_info.pool;
- down (&dev->vcc_sf);
+ mutex_lock(&dev->vcc_sf);
if (dev->txer[vci].tx_present) {
// TXer still on the channel, just go to pool zero XXX not really needed
cmd.request = cpu_to_be32 (SRB_MODIFY_VC_FLAGS);
@@ -1314,7 +1315,7 @@ static void amb_close (struct atm_vcc *
dev->rxq[pool].buffers_wanted = 0;
drain_rx_pool (dev, pool);
}
- up (&dev->vcc_sf);
+ mutex_unlock(&dev->vcc_sf);
}
// free our structure
@@ -2189,7 +2190,7 @@ static void setup_dev(amb_dev *dev, stru
// semaphore for txer/rxer modifications - we cannot use a
// spinlock as the critical region needs to switch processes
- init_MUTEX (&dev->vcc_sf);
+ mutex_init(&dev->vcc_sf);
// queue manipulation spinlocks; we want atomic reads and
// writes to the queue descriptors (handles IRQ and SMP)
// consider replacing "int pending" -> "atomic_t available"
Index: linux-2.6.23/drivers/atm/ambassador.h
===================================================================
--- linux-2.6.23.orig/drivers/atm/ambassador.h
+++ linux-2.6.23/drivers/atm/ambassador.h
@@ -638,7 +638,7 @@ struct amb_dev {
amb_txq txq;
amb_rxq rxq[NUM_RX_POOLS];
- struct semaphore vcc_sf;
+ struct mutex vcc_sf;
amb_tx_info txer[NUM_VCS];
struct atm_vcc * rxer[NUM_VCS];
unsigned int tx_avail;
--
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] atm: ambassador: vcc_sf semaphore to mutex
2008-04-28 18:14 [PATCH] atm: ambassador: vcc_sf semaphore to mutex Daniel Walker
2008-04-28 5:35 ` Arjan van de Ven
@ 2008-04-29 10:39 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2008-04-29 10:39 UTC (permalink / raw)
To: dwalker; +Cc: akpm, gprocida, mingo, matthew, chas, linux-kernel
From: Daniel Walker <dwalker@mvista.com>
Date: Mon, 28 Apr 2008 11:14:45 -0700
> Signed-off-by: Daniel Walker <dwalker@mvista.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-29 13:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-28 18:14 [PATCH] atm: ambassador: vcc_sf semaphore to mutex Daniel Walker
2008-04-28 5:35 ` Arjan van de Ven
2008-04-29 10:39 ` David Miller
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®