diff options
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index cfb46c241b38..31e9f40e79a2 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c | |||
@@ -436,29 +436,20 @@ ahd_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *)) | |||
436 | { | 436 | { |
437 | struct ahd_softc *ahd; | 437 | struct ahd_softc *ahd; |
438 | struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); | 438 | struct ahd_linux_device *dev = scsi_transport_device_data(cmd->device); |
439 | int rtn = SCSI_MLQUEUE_HOST_BUSY; | ||
440 | unsigned long flags; | ||
439 | 441 | ||
440 | ahd = *(struct ahd_softc **)cmd->device->host->hostdata; | 442 | ahd = *(struct ahd_softc **)cmd->device->host->hostdata; |
441 | 443 | ||
442 | /* | 444 | ahd_lock(ahd, &flags); |
443 | * Close the race of a command that was in the process of | 445 | if (ahd->platform_data->qfrozen == 0) { |
444 | * being queued to us just as our simq was frozen. Let | 446 | cmd->scsi_done = scsi_done; |
445 | * DV commands through so long as we are only frozen to | 447 | cmd->result = CAM_REQ_INPROG << 16; |
446 | * perform DV. | 448 | rtn = ahd_linux_run_command(ahd, dev, cmd); |
447 | */ | ||
448 | if (ahd->platform_data->qfrozen != 0) { | ||
449 | printf("%s: queue frozen\n", ahd_name(ahd)); | ||
450 | 449 | ||
451 | return SCSI_MLQUEUE_HOST_BUSY; | ||
452 | } | 450 | } |
453 | 451 | ahd_unlock(ahd, &flags); | |
454 | /* | 452 | return rtn; |
455 | * Save the callback on completion function. | ||
456 | */ | ||
457 | cmd->scsi_done = scsi_done; | ||
458 | |||
459 | cmd->result = CAM_REQ_INPROG << 16; | ||
460 | |||
461 | return ahd_linux_run_command(ahd, dev, cmd); | ||
462 | } | 453 | } |
463 | 454 | ||
464 | static inline struct scsi_target ** | 455 | static inline struct scsi_target ** |
@@ -1081,7 +1072,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa | |||
1081 | 1072 | ||
1082 | *((struct ahd_softc **)host->hostdata) = ahd; | 1073 | *((struct ahd_softc **)host->hostdata) = ahd; |
1083 | ahd_lock(ahd, &s); | 1074 | ahd_lock(ahd, &s); |
1084 | scsi_assign_lock(host, &ahd->platform_data->spin_lock); | ||
1085 | ahd->platform_data->host = host; | 1075 | ahd->platform_data->host = host; |
1086 | host->can_queue = AHD_MAX_QUEUE; | 1076 | host->can_queue = AHD_MAX_QUEUE; |
1087 | host->cmd_per_lun = 2; | 1077 | host->cmd_per_lun = 2; |
@@ -2062,6 +2052,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2062 | int wait; | 2052 | int wait; |
2063 | int disconnected; | 2053 | int disconnected; |
2064 | ahd_mode_state saved_modes; | 2054 | ahd_mode_state saved_modes; |
2055 | unsigned long flags; | ||
2065 | 2056 | ||
2066 | pending_scb = NULL; | 2057 | pending_scb = NULL; |
2067 | paused = FALSE; | 2058 | paused = FALSE; |
@@ -2077,7 +2068,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag) | |||
2077 | printf(" 0x%x", cmd->cmnd[cdb_byte]); | 2068 | printf(" 0x%x", cmd->cmnd[cdb_byte]); |
2078 | printf("\n"); | 2069 | printf("\n"); |
2079 | 2070 | ||
2080 | spin_lock_irq(&ahd->platform_data->spin_lock); | 2071 | ahd_lock(ahd, &flags); |
2081 | 2072 | ||
2082 | /* | 2073 | /* |
2083 | * First determine if we currently own this command. | 2074 | * First determine if we currently own this command. |
@@ -2291,7 +2282,8 @@ done: | |||
2291 | int ret; | 2282 | int ret; |
2292 | 2283 | ||
2293 | ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM; | 2284 | ahd->platform_data->flags |= AHD_SCB_UP_EH_SEM; |
2294 | spin_unlock_irq(&ahd->platform_data->spin_lock); | 2285 | ahd_unlock(ahd, &flags); |
2286 | |||
2295 | init_timer(&timer); | 2287 | init_timer(&timer); |
2296 | timer.data = (u_long)ahd; | 2288 | timer.data = (u_long)ahd; |
2297 | timer.expires = jiffies + (5 * HZ); | 2289 | timer.expires = jiffies + (5 * HZ); |
@@ -2305,9 +2297,8 @@ done: | |||
2305 | printf("Timer Expired\n"); | 2297 | printf("Timer Expired\n"); |
2306 | retval = FAILED; | 2298 | retval = FAILED; |
2307 | } | 2299 | } |
2308 | spin_lock_irq(&ahd->platform_data->spin_lock); | ||
2309 | } | 2300 | } |
2310 | spin_unlock_irq(&ahd->platform_data->spin_lock); | 2301 | ahd_unlock(ahd, &flags); |
2311 | return (retval); | 2302 | return (retval); |
2312 | } | 2303 | } |
2313 | 2304 | ||