aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
author <andrew.vasquez@qlogic.com>2005-04-17 16:02:26 -0400
committerJames Bottomley <jejb@titanic>2005-04-18 14:46:53 -0400
commitf4f051ebb40e74ad0ba02d2cb3a6c16b0393472b (patch)
treecc5b5267465d833d36037bd717cef9368f6c9472 /drivers/scsi/qla2xxx/qla_init.c
parentc46f2ffb9e7fce7208c2639790e1ade42e00b146 (diff)
[PATCH] qla2xxx: remove internal queuing...
Remove internal command queuing from the driver. As is, this driver cannot tolerate cable-pulls as I/Os will begin to fail by the upper layers. o Should be used in conjuction with the 11-fc_rport_adds_2.diff patch. o Removes qla_listops.h file -- no longer needed. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c106
1 files changed, 2 insertions, 104 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 1ab5d92c3868..00bfbd42bdb6 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3146,7 +3146,6 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
3146 wait_time && 3146 wait_time &&
3147 (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags))); 3147 (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
3148 } 3148 }
3149 qla2x00_restart_queues(ha, 1);
3150 } 3149 }
3151 3150
3152 if (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) { 3151 if (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) {
@@ -3160,87 +3159,6 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
3160 return (rval); 3159 return (rval);
3161} 3160}
3162 3161
3163/*
3164 * qla2x00_restart_queues
3165 * Restart device queues.
3166 *
3167 * Input:
3168 * ha = adapter block pointer.
3169 *
3170 * Context:
3171 * Kernel/Interrupt context.
3172 */
3173void
3174qla2x00_restart_queues(scsi_qla_host_t *ha, uint8_t flush)
3175{
3176 srb_t *sp;
3177 int retry_q_cnt = 0;
3178 int pending_q_cnt = 0;
3179 struct list_head *list, *temp;
3180 unsigned long flags = 0;
3181
3182 clear_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags);
3183
3184 /* start pending queue */
3185 pending_q_cnt = ha->qthreads;
3186 if (flush) {
3187 spin_lock_irqsave(&ha->list_lock,flags);
3188 list_for_each_safe(list, temp, &ha->pending_queue) {
3189 sp = list_entry(list, srb_t, list);
3190
3191 if ((sp->flags & SRB_TAPE))
3192 continue;
3193
3194 /*
3195 * When time expire return request back to OS as BUSY
3196 */
3197 __del_from_pending_queue(ha, sp);
3198 sp->cmd->result = DID_BUS_BUSY << 16;
3199 sp->cmd->host_scribble = (unsigned char *)NULL;
3200 __add_to_done_queue(ha, sp);
3201 }
3202 spin_unlock_irqrestore(&ha->list_lock, flags);
3203 } else {
3204 if (!list_empty(&ha->pending_queue))
3205 qla2x00_next(ha);
3206 }
3207
3208 /*
3209 * Clear out our retry queue
3210 */
3211 if (flush) {
3212 spin_lock_irqsave(&ha->list_lock, flags);
3213 retry_q_cnt = ha->retry_q_cnt;
3214 list_for_each_safe(list, temp, &ha->retry_queue) {
3215 sp = list_entry(list, srb_t, list);
3216 /* when time expire return request back to OS as BUSY */
3217 __del_from_retry_queue(ha, sp);
3218 sp->cmd->result = DID_BUS_BUSY << 16;
3219 sp->cmd->host_scribble = (unsigned char *)NULL;
3220 __add_to_done_queue(ha, sp);
3221 }
3222 spin_unlock_irqrestore(&ha->list_lock, flags);
3223
3224 DEBUG2(printk("%s(%ld): callback %d commands.\n",
3225 __func__,
3226 ha->host_no,
3227 retry_q_cnt);)
3228 }
3229
3230 DEBUG2(printk("%s(%ld): active=%ld, retry=%d, pending=%d, "
3231 "done=%ld, scsi retry=%d commands.\n",
3232 __func__,
3233 ha->host_no,
3234 ha->actthreads,
3235 ha->retry_q_cnt,
3236 pending_q_cnt,
3237 ha->done_q_cnt,
3238 ha->scsi_retry_q_cnt);)
3239
3240 if (!list_empty(&ha->done_queue))
3241 qla2x00_done(ha);
3242}
3243
3244void 3162void
3245qla2x00_rescan_fcports(scsi_qla_host_t *ha) 3163qla2x00_rescan_fcports(scsi_qla_host_t *ha)
3246{ 3164{
@@ -3699,24 +3617,10 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
3699 ha->actthreads--; 3617 ha->actthreads--;
3700 sp->lun_queue->out_cnt--; 3618 sp->lun_queue->out_cnt--;
3701 3619
3702 /*
3703 * Set the cmd host_byte status depending on
3704 * whether the scsi_error_handler is
3705 * active or not.
3706 */
3707 if (sp->flags & SRB_TAPE) {
3708 sp->cmd->result = DID_NO_CONNECT << 16;
3709 } else {
3710 if (ha->host->eh_active != EH_ACTIVE)
3711 sp->cmd->result =
3712 DID_BUS_BUSY << 16;
3713 else
3714 sp->cmd->result =
3715 DID_RESET << 16;
3716 }
3717 sp->flags = 0; 3620 sp->flags = 0;
3621 sp->cmd->result = DID_RESET << 16;
3718 sp->cmd->host_scribble = (unsigned char *)NULL; 3622 sp->cmd->host_scribble = (unsigned char *)NULL;
3719 add_to_done_queue(ha, sp); 3623 qla2x00_sp_compl(ha, sp);
3720 } 3624 }
3721 } 3625 }
3722 spin_unlock_irqrestore(&ha->hardware_lock, flags); 3626 spin_unlock_irqrestore(&ha->hardware_lock, flags);
@@ -3739,11 +3643,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
3739 /* Enable ISP interrupts. */ 3643 /* Enable ISP interrupts. */
3740 qla2x00_enable_intrs(ha); 3644 qla2x00_enable_intrs(ha);
3741 3645
3742 /* v2.19.5b6 Return all commands */
3743 qla2x00_abort_queues(ha, 1);
3744
3745 /* Restart queues that may have been stopped. */
3746 qla2x00_restart_queues(ha, 1);
3747 ha->isp_abort_cnt = 0; 3646 ha->isp_abort_cnt = 0;
3748 clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags); 3647 clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
3749 } else { /* failed the ISP abort */ 3648 } else { /* failed the ISP abort */
@@ -3758,7 +3657,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
3758 * completely. 3657 * completely.
3759 */ 3658 */
3760 qla2x00_reset_adapter(ha); 3659 qla2x00_reset_adapter(ha);
3761 qla2x00_abort_queues(ha, 0);
3762 ha->flags.online = 0; 3660 ha->flags.online = 0;
3763 clear_bit(ISP_ABORT_RETRY, 3661 clear_bit(ISP_ABORT_RETRY,
3764 &ha->dpc_flags); 3662 &ha->dpc_flags);