aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx/aic7xxx_osm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c')
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 1861407422e4..7fc6454068e4 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -476,26 +476,20 @@ ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
476{ 476{
477 struct ahc_softc *ahc; 477 struct ahc_softc *ahc;
478 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device); 478 struct ahc_linux_device *dev = scsi_transport_device_data(cmd->device);
479 int rtn = SCSI_MLQUEUE_HOST_BUSY;
480 unsigned long flags;
479 481
480 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 482 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
481 483
482 /* 484 ahc_lock(ahc, &flags);
483 * Save the callback on completion function. 485 if (ahc->platform_data->qfrozen == 0) {
484 */ 486 cmd->scsi_done = scsi_done;
485 cmd->scsi_done = scsi_done; 487 cmd->result = CAM_REQ_INPROG << 16;
486 488 rtn = ahc_linux_run_command(ahc, dev, cmd);
487 /* 489 }
488 * Close the race of a command that was in the process of 490 ahc_unlock(ahc, &flags);
489 * being queued to us just as our simq was frozen. Let
490 * DV commands through so long as we are only frozen to
491 * perform DV.
492 */
493 if (ahc->platform_data->qfrozen != 0)
494 return SCSI_MLQUEUE_HOST_BUSY;
495
496 cmd->result = CAM_REQ_INPROG << 16;
497 491
498 return ahc_linux_run_command(ahc, dev, cmd); 492 return rtn;
499} 493}
500 494
501static inline struct scsi_target ** 495static inline struct scsi_target **
@@ -1079,7 +1073,6 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa
1079 1073
1080 *((struct ahc_softc **)host->hostdata) = ahc; 1074 *((struct ahc_softc **)host->hostdata) = ahc;
1081 ahc_lock(ahc, &s); 1075 ahc_lock(ahc, &s);
1082 scsi_assign_lock(host, &ahc->platform_data->spin_lock);
1083 ahc->platform_data->host = host; 1076 ahc->platform_data->host = host;
1084 host->can_queue = AHC_MAX_QUEUE; 1077 host->can_queue = AHC_MAX_QUEUE;
1085 host->cmd_per_lun = 2; 1078 host->cmd_per_lun = 2;
@@ -2111,6 +2104,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2111 int paused; 2104 int paused;
2112 int wait; 2105 int wait;
2113 int disconnected; 2106 int disconnected;
2107 unsigned long flags;
2114 2108
2115 pending_scb = NULL; 2109 pending_scb = NULL;
2116 paused = FALSE; 2110 paused = FALSE;
@@ -2125,7 +2119,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2125 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2119 printf(" 0x%x", cmd->cmnd[cdb_byte]);
2126 printf("\n"); 2120 printf("\n");
2127 2121
2128 spin_lock_irq(&ahc->platform_data->spin_lock); 2122 ahc_lock(ahc, &flags);
2129 2123
2130 /* 2124 /*
2131 * First determine if we currently own this command. 2125 * First determine if we currently own this command.
@@ -2357,7 +2351,8 @@ done:
2357 int ret; 2351 int ret;
2358 2352
2359 ahc->platform_data->flags |= AHC_UP_EH_SEMAPHORE; 2353 ahc->platform_data->flags |= AHC_UP_EH_SEMAPHORE;
2360 spin_unlock_irq(&ahc->platform_data->spin_lock); 2354 ahc_unlock(ahc, &flags);
2355
2361 init_timer(&timer); 2356 init_timer(&timer);
2362 timer.data = (u_long)ahc; 2357 timer.data = (u_long)ahc;
2363 timer.expires = jiffies + (5 * HZ); 2358 timer.expires = jiffies + (5 * HZ);
@@ -2371,10 +2366,8 @@ done:
2371 printf("Timer Expired\n"); 2366 printf("Timer Expired\n");
2372 retval = FAILED; 2367 retval = FAILED;
2373 } 2368 }
2374 spin_lock_irq(&ahc->platform_data->spin_lock); 2369 } else
2375 } 2370 ahc_unlock(ahc, &flags);
2376
2377 spin_unlock_irq(&ahc->platform_data->spin_lock);
2378 return (retval); 2371 return (retval);
2379} 2372}
2380 2373