linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SCSI: Replace semaphore with completion
@ 2004-10-20 19:31 Thomas Gleixner
  2004-10-21 11:11 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Gleixner @ 2004-10-20 19:31 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ingo Molnar, SCSI, LKML, James Bottomley


Use completion instead of semaphore

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
---

 2.6.9-bk-041020-thomas/drivers/scsi/sym53c8xx_2/sym_glue.c |    8
++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN drivers/scsi/sym53c8xx_2/sym_glue.c~sym53c8xx
drivers/scsi/sym53c8xx_2/sym_glue.c
---
2.6.9-bk-041020/drivers/scsi/sym53c8xx_2/sym_glue.c~sym53c8xx	2004-10-20
16:04:34.000000000 +0200
+++
2.6.9-bk-041020-thomas/drivers/scsi/sym53c8xx_2/sym_glue.c	2004-10-20
16:04:50.000000000 +0200
@@ -135,7 +135,7 @@ m_addr_t __vtobus(m_pool_ident_t dev_dma
  *  It is allocated on the eh thread stack.
  */
 struct sym_eh_wait {
-	struct semaphore sem;
+	struct completion done;
 	struct timer_list timer;
 	void (*old_done)(struct scsi_cmnd *);
 	int to_do;
@@ -798,7 +798,7 @@ static void __sym_eh_done(struct scsi_cm
 
 	/* Wake up the eh thread if it wants to sleep */
 	if (ep->to_do == SYM_EH_DO_WAIT)
-		up(&ep->sem);
+		complete(&ep->done);
 }
 
 /*
@@ -858,7 +858,7 @@ prepare:
 	case SYM_EH_DO_IGNORE:
 		break;
 	case SYM_EH_DO_WAIT:
-		init_MUTEX_LOCKED(&ep->sem);
+		init_completion(&ep->done);
 		/* fall through */
 	case SYM_EH_DO_COMPLETE:
 		ep->old_done = cmd->scsi_done;
@@ -909,7 +909,7 @@ prepare:
 		ep->timed_out = 1;	/* Be pessimistic for once :) */
 		add_timer(&ep->timer);
 		spin_unlock_irq(np->s.host->host_lock);
-		down(&ep->sem);
+		wait_for_completion(&ep->done);
 		spin_lock_irq(np->s.host->host_lock);
 		if (ep->timed_out)
 			sts = -2;
_



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] SCSI: Replace semaphore with completion
  2004-10-20 19:31 [PATCH] SCSI: Replace semaphore with completion Thomas Gleixner
@ 2004-10-21 11:11 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2004-10-21 11:11 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Andrew Morton, Ingo Molnar, SCSI, LKML, James Bottomley

On Wed, Oct 20, 2004 at 09:31:39PM +0200, Thomas Gleixner wrote:
> 
> Use completion instead of semaphore

OK, I've taken this into my tree.  It'll be part of the 2.1.18m release.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-21 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-20 19:31 [PATCH] SCSI: Replace semaphore with completion Thomas Gleixner
2004-10-21 11:11 ` Matthew Wilcox

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).