diff options
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 37 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 39 |
2 files changed, 30 insertions, 46 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 | ||
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 | ||
501 | static inline struct scsi_target ** | 495 | static 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 | ||