All of lore.kernel.org
 help / color / mirror / Atom feed
* sym2 error handler sleeps with irqs off
@ 2003-07-11  6:20 Anton Blanchard
  2003-07-13 13:35 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2003-07-11  6:20 UTC (permalink / raw)
  To: linux-scsi


Hi,

The scsi error handler calls driver error handlers with the host_lock
taken. We need to drop it before calling down() in the sym2 driver.

Anton

===== drivers/scsi/sym53c8xx_2/sym_glue.c 1.13 vs edited =====
--- 1.13/drivers/scsi/sym53c8xx_2/sym_glue.c	Fri Feb  7 19:20:34 2003
+++ edited/drivers/scsi/sym53c8xx_2/sym_glue.c	Thu Feb 13 00:00:21 2003
@@ -1112,6 +1112,7 @@
 	int sts = -1;
 	struct sym_eh_wait eh, *ep = &eh;
 	char devname[20];
+	unsigned long flags;
 
 	sprintf(devname, "%s:%d:%d", sym_name(np), cmd->device->id, cmd->device->lun);
 
@@ -1203,7 +1204,11 @@
 		ep->timer.data = (u_long)cmd;
 		ep->timed_out = 1;	/* Be pessimistic for once :) */
 		add_timer(&ep->timer);
+		local_save_flags(flags);
+		spin_unlock_irq(cmd->device->host->host_lock);
 		down(&ep->sem);
+		local_irq_restore(flags);
+		spin_lock(cmd->device->host->host_lock);
 		if (ep->timed_out)
 			sts = -2;
 	}

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

* Re: sym2 error handler sleeps with irqs off
  2003-07-11  6:20 sym2 error handler sleeps with irqs off Anton Blanchard
@ 2003-07-13 13:35 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2003-07-13 13:35 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: linux-scsi

On Fri, Jul 11, 2003 at 04:20:46PM +1000, Anton Blanchard wrote:
> +		local_save_flags(flags);

I don't think you need to save the flags.

> +		spin_unlock_irq(cmd->device->host->host_lock);
>  		down(&ep->sem);
> +		local_irq_restore(flags);
> +		spin_lock(cmd->device->host->host_lock);

When we drop it we should probably drop it as long as it's safe.


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

end of thread, other threads:[~2003-07-13 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-11  6:20 sym2 error handler sleeps with irqs off Anton Blanchard
2003-07-13 13:35 ` 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.