diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
commit | 86464aed71025541805e7b1515541aee89879e33 (patch) | |
tree | e01a457a4912a8553bc65524aa3125d51f29f810 /drivers/scsi/scsi.c | |
parent | 88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff) |
Merge with Linux 2.2.1.
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r-- | drivers/scsi/scsi.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 20fd1a58c..84638f786 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -30,6 +30,8 @@ * Leonard N. Zubkoff <lnz@dandelion.com> * * Converted cli() code to spinlocks, Ingo Molnar + * + * Jiffies wrap fixes (host->resetting), 3 Dec 1998 Andrea Arcangeli */ #include <linux/config.h> @@ -277,6 +279,9 @@ static struct dev_info device_list[] = {"MATSHITA","PD","*", BLIST_FORCELUN | BLIST_SINGLELUN}, {"YAMAHA","CDR100","1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ {"YAMAHA","CDR102","1.00", BLIST_NOLUN}, /* Locks up if polled for lun != 0 */ +{"iomega","jaz 1GB","J.86", BLIST_NOTQ | BLIST_NOLUN}, +{"IBM","DPES-","*", BLIST_NOTQ | BLIST_NOLUN}, +{"WDIGTL","WDE","*", BLIST_NOTQ | BLIST_NOLUN}, /* * Must be at end of list... */ @@ -525,9 +530,18 @@ static void scan_scsis (struct Scsi_Host *shpnt, } else { + /* Actual LUN. PC ordering is 0->n IBM/spec ordering is n->0 */ + int order_dev; + for (channel = 0; channel <= shpnt->max_channel; channel++) { for (dev = 0; dev < shpnt->max_id; ++dev) { - if (shpnt->this_id != dev) { + if( shpnt->reverse_ordering) + /* Shift to scanning 15,14,13... or 7,6,5,4, */ + order_dev = shpnt->max_id-dev-1; + else + order_dev = dev; + + if (shpnt->this_id != order_dev) { /* * We need the for so our continue, etc. work fine. We put this in @@ -538,7 +552,7 @@ static void scan_scsis (struct Scsi_Host *shpnt, max_scsi_luns : shpnt->max_lun); sparse_lun = 0; for (lun = 0; lun < max_dev_lun; ++lun) { - if (!scan_scsis_single (channel, dev, lun, &max_dev_lun, + if (!scan_scsis_single (channel, order_dev, lun, &max_dev_lun, &sparse_lun, &SDpnt, SCpnt, shpnt, scsi_result) && !sparse_lun) @@ -1301,7 +1315,7 @@ inline int internal_cmnd (Scsi_Cmnd * SCpnt) */ timeout = host->last_reset + MIN_RESET_DELAY; - if (jiffies < timeout) { + if (host->resetting && time_before(jiffies, timeout)) { int ticks_remaining = timeout - jiffies; /* * NOTE: This may be executed from within an interrupt @@ -1314,7 +1328,7 @@ inline int internal_cmnd (Scsi_Cmnd * SCpnt) */ spin_unlock_irq(&io_request_lock); while (--ticks_remaining >= 0) mdelay(1+999/HZ); - host->last_reset = jiffies - MIN_RESET_DELAY; + host->resetting = 0; spin_lock_irq(&io_request_lock); } @@ -1371,7 +1385,7 @@ inline int internal_cmnd (Scsi_Cmnd * SCpnt) #ifdef DEBUG_DELAY clock = jiffies + 4 * HZ; spin_unlock_irq(&io_request_lock); - while (jiffies < clock) barrier(); + while (time_before(jiffies, clock)) barrier(); spin_lock_irq(&io_request_lock); printk("done(host = %d, result = %04x) : routine at %p\n", host->host_no, temp, host->hostt->command); @@ -1739,7 +1753,7 @@ scsi_finish_command(Scsi_Cmnd * SCpnt) host_active = NULL; /* For block devices "wake_up" is done in end_scsi_request */ - if (!SCSI_BLK_MAJOR(SCpnt->request.rq_dev)) { + if (!SCSI_BLK_MAJOR(MAJOR(SCpnt->request.rq_dev))) { struct Scsi_Host * next; for (next = host->block; next != host; next = next->block) @@ -2747,7 +2761,7 @@ static void scsi_unregister_host(Scsi_Host_Template * tpnt) { if(SDpnt->host->hostt == tpnt && SDpnt->host->hostt->module - && SDpnt->host->hostt->module->usecount) return; + && GET_USE_COUNT(SDpnt->host->hostt->module)) return; /* * FIXME(eric) - We need to find a way to notify the * low level driver that we are shutting down - via the @@ -3036,7 +3050,7 @@ static int scsi_unregister_device(struct Scsi_Device_Template * tpnt) /* * If we are busy, this is not going to fly. */ - if(tpnt->module->usecount != 0) return 0; + if(GET_USE_COUNT(tpnt->module) != 0) return 0; /* * Next, detach the devices from the driver. |