|
From: Kenn H. <ke...@us...> - 2004-08-08 23:32:43
|
Update of /cvsroot/linux-vax/kernel-2.5/drivers/scsi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11555/drivers/scsi Modified Files: NCR5380.c Log Message: Temporary fix for some locking problems in the 5380 core driver. I've asked on linux-scsi about this, so hopefully I'll get a definitive solution soon. Index: NCR5380.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/scsi/NCR5380.c,v retrieving revision 1.1.1.19 retrieving revision 1.2 diff -u -d -r1.1.1.19 -r1.2 --- NCR5380.c 24 Mar 2004 22:45:21 -0000 1.1.1.19 +++ NCR5380.c 8 Aug 2004 23:32:34 -0000 1.2 @@ -28,6 +28,11 @@ /* * $Log$ + * Revision 1.2 2004/08/08 23:32:34 kenn + * Temporary fix for some locking problems in the 5380 core driver. I've + * asked on linux-scsi about this, so hopefully I'll get a definitive + * solution soon. + * * Revision 1.1.1.19 2004/03/24 22:45:21 kenn * Import of pristine Linus 2.6.4 tree * @@ -1622,6 +1627,10 @@ hostdata->select_time = 0; /* we count the clock ticks at which we polled */ hostdata->selecting = cmd; + /* We always expect the lock to be released at part2: */ + if(instance->irq != SCSI_IRQ_NONE) + spin_unlock_irq(instance->host_lock); + part2: /* RvC: here we enter after a sleeping period, or immediately after execution of part 1 @@ -1630,6 +1639,8 @@ if (!value && (hostdata->select_time < HZ/4)) { /* RvC: we still must wait for a device response */ + if(instance->irq != SCSI_IRQ_NONE) + spin_lock_irq(instance->host_lock); hostdata->select_time++; /* after 25 ticks the device has failed */ hostdata->time_expires = jiffies + 1; NCR5380_set_timer(instance); @@ -1660,6 +1671,8 @@ if (!(NCR5380_read(STATUS_REG) & SR_BSY)) { NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); + if(instance->irq != SCSI_IRQ_NONE) + spin_lock_irq(instance->host_lock); if (hostdata->targets_present & (1 << cmd->device->id)) { printk(KERN_DEBUG "scsi%d : weirdness\n", instance->host_no); if (hostdata->restart_select) @@ -1668,8 +1681,6 @@ NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); return -1; } - if(instance->irq != SCSI_IRQ_NONE) - spin_lock_irq(instance->host_lock); cmd->result = DID_BAD_TARGET << 16; collect_stats(hostdata, cmd); cmd->scsi_done(cmd); |