Re: sleeping in scsi EH

Christoph Hellwig
2005-05-27T07:09:58Z

On Thu, May 26, 2005 at 10:26:40PM -0400, Jeff Garzik wrote:
>
> What are the rules for sleeping (msleep, etc.) in the normal EH hooks?
>
> int (* eh_abort_handler)(struct scsi_cmnd *);
> int (* eh_device_reset_handler)(struct scsi_cmnd *);
> int (* eh_bus_reset_handler)(struct scsi_cmnd *);
> int (* eh_host_reset_handler)(struct scsi_cmnd *);
>
> If I could sleep in these functions, then I could eliminate libata's use
> of ->eh_strategy_handler().

You can sleep in them. You must however release the host lock and enable
irqs first and reverse that before returning. The error handlers don't
need the host lock, but we're stuck with the unfortunate calling convention
for now.