diff options
Diffstat (limited to 'drivers/scsi/aic7xxx/aic7xxx_osm.c')
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index fd389e9f9460..051970efba68 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -375,7 +375,7 @@ static void ahc_linux_queue_cmd_complete(struct ahc_softc *ahc, | |||
375 | struct scsi_cmnd *cmd); | 375 | struct scsi_cmnd *cmd); |
376 | static void ahc_linux_sem_timeout(u_long arg); | 376 | static void ahc_linux_sem_timeout(u_long arg); |
377 | static void ahc_linux_freeze_simq(struct ahc_softc *ahc); | 377 | static void ahc_linux_freeze_simq(struct ahc_softc *ahc); |
378 | static void ahc_linux_release_simq(u_long arg); | 378 | static void ahc_linux_release_simq(struct ahc_softc *ahc); |
379 | static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag); | 379 | static int ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag); |
380 | static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc); | 380 | static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc); |
381 | static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc, | 381 | static u_int ahc_linux_user_tagdepth(struct ahc_softc *ahc, |
@@ -1073,7 +1073,6 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa | |||
1073 | return (ENOMEM); | 1073 | return (ENOMEM); |
1074 | 1074 | ||
1075 | *((struct ahc_softc **)host->hostdata) = ahc; | 1075 | *((struct ahc_softc **)host->hostdata) = ahc; |
1076 | ahc_lock(ahc, &s); | ||
1077 | ahc->platform_data->host = host; | 1076 | ahc->platform_data->host = host; |
1078 | host->can_queue = AHC_MAX_QUEUE; | 1077 | host->can_queue = AHC_MAX_QUEUE; |
1079 | host->cmd_per_lun = 2; | 1078 | host->cmd_per_lun = 2; |
@@ -1084,7 +1083,9 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa | |||
1084 | host->max_lun = AHC_NUM_LUNS; | 1083 | host->max_lun = AHC_NUM_LUNS; |
1085 | host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0; | 1084 | host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0; |
1086 | host->sg_tablesize = AHC_NSEG; | 1085 | host->sg_tablesize = AHC_NSEG; |
1086 | ahc_lock(ahc, &s); | ||
1087 | ahc_set_unit(ahc, ahc_linux_unit++); | 1087 | ahc_set_unit(ahc, ahc_linux_unit++); |
1088 | ahc_unlock(ahc, &s); | ||
1088 | sprintf(buf, "scsi%d", host->host_no); | 1089 | sprintf(buf, "scsi%d", host->host_no); |
1089 | new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); | 1090 | new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT); |
1090 | if (new_name != NULL) { | 1091 | if (new_name != NULL) { |
@@ -1094,7 +1095,6 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa | |||
1094 | host->unique_id = ahc->unit; | 1095 | host->unique_id = ahc->unit; |
1095 | ahc_linux_initialize_scsi_bus(ahc); | 1096 | ahc_linux_initialize_scsi_bus(ahc); |
1096 | ahc_intr_enable(ahc, TRUE); | 1097 | ahc_intr_enable(ahc, TRUE); |
1097 | ahc_unlock(ahc, &s); | ||
1098 | 1098 | ||
1099 | host->transportt = ahc_linux_transport_template; | 1099 | host->transportt = ahc_linux_transport_template; |
1100 | 1100 | ||
@@ -1120,10 +1120,13 @@ ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc) | |||
1120 | { | 1120 | { |
1121 | int i; | 1121 | int i; |
1122 | int numtarg; | 1122 | int numtarg; |
1123 | unsigned long s; | ||
1123 | 1124 | ||
1124 | i = 0; | 1125 | i = 0; |
1125 | numtarg = 0; | 1126 | numtarg = 0; |
1126 | 1127 | ||
1128 | ahc_lock(ahc, &s); | ||
1129 | |||
1127 | if (aic7xxx_no_reset != 0) | 1130 | if (aic7xxx_no_reset != 0) |
1128 | ahc->flags &= ~(AHC_RESET_BUS_A|AHC_RESET_BUS_B); | 1131 | ahc->flags &= ~(AHC_RESET_BUS_A|AHC_RESET_BUS_B); |
1129 | 1132 | ||
@@ -1170,16 +1173,12 @@ ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc) | |||
1170 | ahc_update_neg_request(ahc, &devinfo, tstate, | 1173 | ahc_update_neg_request(ahc, &devinfo, tstate, |
1171 | tinfo, AHC_NEG_ALWAYS); | 1174 | tinfo, AHC_NEG_ALWAYS); |
1172 | } | 1175 | } |
1176 | ahc_unlock(ahc, &s); | ||
1173 | /* Give the bus some time to recover */ | 1177 | /* Give the bus some time to recover */ |
1174 | if ((ahc->flags & (AHC_RESET_BUS_A|AHC_RESET_BUS_B)) != 0) { | 1178 | if ((ahc->flags & (AHC_RESET_BUS_A|AHC_RESET_BUS_B)) != 0) { |
1175 | ahc_linux_freeze_simq(ahc); | 1179 | ahc_linux_freeze_simq(ahc); |
1176 | init_timer(&ahc->platform_data->reset_timer); | 1180 | msleep(AIC7XXX_RESET_DELAY); |
1177 | ahc->platform_data->reset_timer.data = (u_long)ahc; | 1181 | ahc_linux_release_simq(ahc); |
1178 | ahc->platform_data->reset_timer.expires = | ||
1179 | jiffies + (AIC7XXX_RESET_DELAY * HZ)/1000; | ||
1180 | ahc->platform_data->reset_timer.function = | ||
1181 | ahc_linux_release_simq; | ||
1182 | add_timer(&ahc->platform_data->reset_timer); | ||
1183 | } | 1182 | } |
1184 | } | 1183 | } |
1185 | 1184 | ||
@@ -2059,6 +2058,9 @@ ahc_linux_sem_timeout(u_long arg) | |||
2059 | static void | 2058 | static void |
2060 | ahc_linux_freeze_simq(struct ahc_softc *ahc) | 2059 | ahc_linux_freeze_simq(struct ahc_softc *ahc) |
2061 | { | 2060 | { |
2061 | unsigned long s; | ||
2062 | |||
2063 | ahc_lock(ahc, &s); | ||
2062 | ahc->platform_data->qfrozen++; | 2064 | ahc->platform_data->qfrozen++; |
2063 | if (ahc->platform_data->qfrozen == 1) { | 2065 | if (ahc->platform_data->qfrozen == 1) { |
2064 | scsi_block_requests(ahc->platform_data->host); | 2066 | scsi_block_requests(ahc->platform_data->host); |
@@ -2068,17 +2070,15 @@ ahc_linux_freeze_simq(struct ahc_softc *ahc) | |||
2068 | CAM_LUN_WILDCARD, SCB_LIST_NULL, | 2070 | CAM_LUN_WILDCARD, SCB_LIST_NULL, |
2069 | ROLE_INITIATOR, CAM_REQUEUE_REQ); | 2071 | ROLE_INITIATOR, CAM_REQUEUE_REQ); |
2070 | } | 2072 | } |
2073 | ahc_unlock(ahc, &s); | ||
2071 | } | 2074 | } |
2072 | 2075 | ||
2073 | static void | 2076 | static void |
2074 | ahc_linux_release_simq(u_long arg) | 2077 | ahc_linux_release_simq(struct ahc_softc *ahc) |
2075 | { | 2078 | { |
2076 | struct ahc_softc *ahc; | ||
2077 | u_long s; | 2079 | u_long s; |
2078 | int unblock_reqs; | 2080 | int unblock_reqs; |
2079 | 2081 | ||
2080 | ahc = (struct ahc_softc *)arg; | ||
2081 | |||
2082 | unblock_reqs = 0; | 2082 | unblock_reqs = 0; |
2083 | ahc_lock(ahc, &s); | 2083 | ahc_lock(ahc, &s); |
2084 | if (ahc->platform_data->qfrozen > 0) | 2084 | if (ahc->platform_data->qfrozen > 0) |