Commit 5a550acd authored by Kenn Humborg's avatar Kenn Humborg Committed by James Bottomley

[PATCH] NCR5380 delayed work fix and locking fix

Changes to the NCR5380 driver between 2.6.9 and 2.6.10 replaced the
driver's home-grown delayed work implementation with a call to
schedule_delayed_work().  However, the delay argument was not passed
correctly, so the work was usually scheduled for _way_ too far in
the future.  This patch fixes this.

NCR5380_print_status() is called from NCR5380_abort() and from
NCR5380_bus_reset().  In at least the abort() case, the host lock
has already been acquired by scsi_error.c:scsi_try_to_abort_command().
NCR5380_print_status() calls NCR5380_proc_info() which also acquires
and releases the host lock.  This patch removes the call to
NCR5380_proc_info() from NCR5380_print_status.

Cosmetic: Remove duplicated lines of code from NCR5380_abort().
Signed-off-by: default avatarKenn Humborg <kenn@linux.ie>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 868f613b
......@@ -533,7 +533,7 @@ static int should_disconnect(unsigned char cmd)
static void NCR5380_set_timer(struct NCR5380_hostdata *hostdata, unsigned long timeout)
{
hostdata->time_expires = jiffies + timeout;
schedule_delayed_work(&hostdata->coroutine, hostdata->time_expires);
schedule_delayed_work(&hostdata->coroutine, timeout);
}
......@@ -671,16 +671,8 @@ static void __init NCR5380_print_options(struct Scsi_Host *instance)
static void NCR5380_print_status(struct Scsi_Host *instance)
{
static char pr_bfr[512];
char *start;
int len;
NCR5380_dprint(NDEBUG_ANY, instance);
NCR5380_dprint_phase(NDEBUG_ANY, instance);
len = NCR5380_proc_info(instance, pr_bfr, &start, 0, sizeof(pr_bfr), 0);
pr_bfr[len] = 0;
printk("\n%s\n", pr_bfr);
}
/******************************************/
......@@ -2689,11 +2681,6 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
NCR5380_print_status(instance);
printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no);
print_Scsi_Cmnd(cmd);
NCR5380_print_status(instance);
NCR5380_setup(instance);
dprintk(NDEBUG_ABORT, ("scsi%d : abort called\n", instance->host_no));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment