* [PATCH] pluto: use wait_for_completion_timeout
@ 2007-05-13 15:49 Christoph Hellwig
2007-05-23 21:57 ` David Miller
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christoph Hellwig @ 2007-05-13 15:49 UTC (permalink / raw)
To: sparclinux
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/drivers/scsi/pluto.c
=================================--- linux-2.6.orig/drivers/scsi/pluto.c 2007-05-13 16:43:25.000000000 +0200
+++ linux-2.6/drivers/scsi/pluto.c 2007-05-13 16:46:31.000000000 +0200
@@ -4,6 +4,7 @@
*
*/
+#include <linux/completion.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/types.h>
@@ -50,16 +51,10 @@ static struct ctrl_inquiry {
} *fcs __initdata;
static int fcscount __initdata = 0;
static atomic_t fcss __initdata = ATOMIC_INIT(0);
-DECLARE_MUTEX_LOCKED(fc_sem);
+static DECLARE_COMPLETION(fc_detect_complete);
static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd);
-static void __init pluto_detect_timeout(unsigned long data)
-{
- PLND(("Timeout\n"))
- up(&fc_sem);
-}
-
static void __init pluto_detect_done(Scsi_Cmnd *SCpnt)
{
/* Do nothing */
@@ -69,7 +64,7 @@ static void __init pluto_detect_scsi_don
{
PLND(("Detect done %08lx\n", (long)SCpnt))
if (atomic_dec_and_test (&fcss))
- up(&fc_sem);
+ complete(&fc_detect_complete);
}
int pluto_slave_configure(struct scsi_device *device)
@@ -96,7 +91,6 @@ int __init pluto_detect(struct scsi_host
int i, retry, nplutos;
fc_channel *fc;
struct scsi_device dev;
- DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0);
tpnt->proc_name = "pluto";
fcscount = 0;
@@ -187,15 +181,11 @@ int __init pluto_detect(struct scsi_host
}
}
- fc_timer.expires = jiffies + 10 * HZ;
- add_timer(&fc_timer);
-
- down(&fc_sem);
+ wait_for_completion_timeout(&fc_detect_complete, 10 * HZ);
PLND(("Woken up\n"))
if (!atomic_read(&fcss))
break; /* All fc channels have answered us */
}
- del_timer_sync(&fc_timer);
PLND(("Finished search\n"))
for (i = 0, nplutos = 0; i < fcscount; i++) {
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] pluto: use wait_for_completion_timeout
2007-05-13 15:49 [PATCH] pluto: use wait_for_completion_timeout Christoph Hellwig
@ 2007-05-23 21:57 ` David Miller
2007-07-14 17:42 ` Christoph Hellwig
2007-07-14 17:43 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2007-05-23 21:57 UTC (permalink / raw)
To: sparclinux
From: Christoph Hellwig <hch@lst.de>
Date: Sun, 13 May 2007 17:49:02 +0200
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Applied, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pluto: use wait_for_completion_timeout
2007-05-13 15:49 [PATCH] pluto: use wait_for_completion_timeout Christoph Hellwig
2007-05-23 21:57 ` David Miller
@ 2007-07-14 17:42 ` Christoph Hellwig
2007-07-14 17:43 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2007-07-14 17:42 UTC (permalink / raw)
To: sparclinux
ping?
On Sun, May 13, 2007 at 05:49:01PM +0200, Christoph Hellwig wrote:
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: linux-2.6/drivers/scsi/pluto.c
> =================================> --- linux-2.6.orig/drivers/scsi/pluto.c 2007-05-13 16:43:25.000000000 +0200
> +++ linux-2.6/drivers/scsi/pluto.c 2007-05-13 16:46:31.000000000 +0200
> @@ -4,6 +4,7 @@
> *
> */
>
> +#include <linux/completion.h>
> #include <linux/kernel.h>
> #include <linux/delay.h>
> #include <linux/types.h>
> @@ -50,16 +51,10 @@ static struct ctrl_inquiry {
> } *fcs __initdata;
> static int fcscount __initdata = 0;
> static atomic_t fcss __initdata = ATOMIC_INIT(0);
> -DECLARE_MUTEX_LOCKED(fc_sem);
> +static DECLARE_COMPLETION(fc_detect_complete);
>
> static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd);
>
> -static void __init pluto_detect_timeout(unsigned long data)
> -{
> - PLND(("Timeout\n"))
> - up(&fc_sem);
> -}
> -
> static void __init pluto_detect_done(Scsi_Cmnd *SCpnt)
> {
> /* Do nothing */
> @@ -69,7 +64,7 @@ static void __init pluto_detect_scsi_don
> {
> PLND(("Detect done %08lx\n", (long)SCpnt))
> if (atomic_dec_and_test (&fcss))
> - up(&fc_sem);
> + complete(&fc_detect_complete);
> }
>
> int pluto_slave_configure(struct scsi_device *device)
> @@ -96,7 +91,6 @@ int __init pluto_detect(struct scsi_host
> int i, retry, nplutos;
> fc_channel *fc;
> struct scsi_device dev;
> - DEFINE_TIMER(fc_timer, pluto_detect_timeout, 0, 0);
>
> tpnt->proc_name = "pluto";
> fcscount = 0;
> @@ -187,15 +181,11 @@ int __init pluto_detect(struct scsi_host
> }
> }
>
> - fc_timer.expires = jiffies + 10 * HZ;
> - add_timer(&fc_timer);
> -
> - down(&fc_sem);
> + wait_for_completion_timeout(&fc_detect_complete, 10 * HZ);
> PLND(("Woken up\n"))
> if (!atomic_read(&fcss))
> break; /* All fc channels have answered us */
> }
> - del_timer_sync(&fc_timer);
>
> PLND(("Finished search\n"))
> for (i = 0, nplutos = 0; i < fcscount; i++) {
---end quoted text---
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] pluto: use wait_for_completion_timeout
2007-05-13 15:49 [PATCH] pluto: use wait_for_completion_timeout Christoph Hellwig
2007-05-23 21:57 ` David Miller
2007-07-14 17:42 ` Christoph Hellwig
@ 2007-07-14 17:43 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2007-07-14 17:43 UTC (permalink / raw)
To: sparclinux
On Sat, Jul 14, 2007 at 07:42:39PM +0200, Christoph Hellwig wrote:
> ping?
Sorry for the noise, it's actually in. I looked at the wrong tree.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-07-14 17:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-13 15:49 [PATCH] pluto: use wait_for_completion_timeout Christoph Hellwig
2007-05-23 21:57 ` David Miller
2007-07-14 17:42 ` Christoph Hellwig
2007-07-14 17:43 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.