Skip to content

Commit

Permalink
[PATCH] qla2xxx: remove internal queuing...
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Unknown authored and James Bottomley committed Apr 18, 2005
1 parent c46f2ff commit f4f051e
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 2,305 deletions.
22 changes: 0 additions & 22 deletions drivers/scsi/qla2xxx/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -2175,27 +2175,6 @@ typedef struct scsi_qla_host {
uint32_t current_outstanding_cmd;
srb_t *status_srb; /* Status continuation entry. */

/*
* Need to hold the list_lock with irq's disabled in order to access
* the following list.
*
* This list_lock is of lower priority than the host_lock.
*/
spinlock_t list_lock ____cacheline_aligned;
/* lock to guard lists which
* hold srb_t's */
struct list_head retry_queue; /* watchdog queue */
struct list_head done_queue; /* job on done queue */
struct list_head failover_queue; /* failover list link. */
struct list_head scsi_retry_queue; /* SCSI retry queue */
struct list_head pending_queue; /* SCSI command pending queue */

unsigned long done_q_cnt;
unsigned long pending_in_q;
uint32_t retry_q_cnt;
uint32_t scsi_retry_q_cnt;
uint32_t failover_cnt;

unsigned long last_irq_cpu; /* cpu where we got our last irq */

uint16_t revision;
Expand Down Expand Up @@ -2479,7 +2458,6 @@ struct _qla2x00stats {
#include "qla_gbl.h"
#include "qla_dbg.h"
#include "qla_inline.h"
#include "qla_listops.h"

/*
* String arrays
Expand Down
6 changes: 1 addition & 5 deletions drivers/scsi/qla2xxx/qla_gbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ extern int ql2xsuspendcount;
#if defined(MODULE)
extern char *ql2xopts;
#endif
extern void qla2x00_sp_compl(scsi_qla_host_t *, srb_t *);

extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);

Expand All @@ -82,17 +83,12 @@ extern void qla2x00_cmd_timeout(srb_t *);
extern int __qla2x00_suspend_lun(scsi_qla_host_t *, os_lun_t *, int, int, int);

extern void qla2x00_done(scsi_qla_host_t *);
extern void qla2x00_next(scsi_qla_host_t *);
extern void qla2x00_flush_failover_q(scsi_qla_host_t *, os_lun_t *);
extern void qla2x00_reset_lun_fo_counts(scsi_qla_host_t *, os_lun_t *);

extern void qla2x00_extend_timeout(struct scsi_cmnd *, int);

extern void qla2x00_mark_device_lost(scsi_qla_host_t *, fc_port_t *, int);
extern void qla2x00_mark_all_devices_lost(scsi_qla_host_t *);

extern void qla2x00_abort_queues(scsi_qla_host_t *, uint8_t);

extern void qla2x00_blink_led(scsi_qla_host_t *);

extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
Expand Down
106 changes: 2 additions & 104 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3146,7 +3146,6 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
wait_time &&
(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
}
qla2x00_restart_queues(ha, 1);
}

if (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) {
Expand All @@ -3160,87 +3159,6 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
return (rval);
}

/*
* qla2x00_restart_queues
* Restart device queues.
*
* Input:
* ha = adapter block pointer.
*
* Context:
* Kernel/Interrupt context.
*/
void
qla2x00_restart_queues(scsi_qla_host_t *ha, uint8_t flush)
{
srb_t *sp;
int retry_q_cnt = 0;
int pending_q_cnt = 0;
struct list_head *list, *temp;
unsigned long flags = 0;

clear_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags);

/* start pending queue */
pending_q_cnt = ha->qthreads;
if (flush) {
spin_lock_irqsave(&ha->list_lock,flags);
list_for_each_safe(list, temp, &ha->pending_queue) {
sp = list_entry(list, srb_t, list);

if ((sp->flags & SRB_TAPE))
continue;

/*
* When time expire return request back to OS as BUSY
*/
__del_from_pending_queue(ha, sp);
sp->cmd->result = DID_BUS_BUSY << 16;
sp->cmd->host_scribble = (unsigned char *)NULL;
__add_to_done_queue(ha, sp);
}
spin_unlock_irqrestore(&ha->list_lock, flags);
} else {
if (!list_empty(&ha->pending_queue))
qla2x00_next(ha);
}

/*
* Clear out our retry queue
*/
if (flush) {
spin_lock_irqsave(&ha->list_lock, flags);
retry_q_cnt = ha->retry_q_cnt;
list_for_each_safe(list, temp, &ha->retry_queue) {
sp = list_entry(list, srb_t, list);
/* when time expire return request back to OS as BUSY */
__del_from_retry_queue(ha, sp);
sp->cmd->result = DID_BUS_BUSY << 16;
sp->cmd->host_scribble = (unsigned char *)NULL;
__add_to_done_queue(ha, sp);
}
spin_unlock_irqrestore(&ha->list_lock, flags);

DEBUG2(printk("%s(%ld): callback %d commands.\n",
__func__,
ha->host_no,
retry_q_cnt);)
}

DEBUG2(printk("%s(%ld): active=%ld, retry=%d, pending=%d, "
"done=%ld, scsi retry=%d commands.\n",
__func__,
ha->host_no,
ha->actthreads,
ha->retry_q_cnt,
pending_q_cnt,
ha->done_q_cnt,
ha->scsi_retry_q_cnt);)

if (!list_empty(&ha->done_queue))
qla2x00_done(ha);
}

void
qla2x00_rescan_fcports(scsi_qla_host_t *ha)
{
Expand Down Expand Up @@ -3699,24 +3617,10 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
ha->actthreads--;
sp->lun_queue->out_cnt--;

/*
* Set the cmd host_byte status depending on
* whether the scsi_error_handler is
* active or not.
*/
if (sp->flags & SRB_TAPE) {
sp->cmd->result = DID_NO_CONNECT << 16;
} else {
if (ha->host->eh_active != EH_ACTIVE)
sp->cmd->result =
DID_BUS_BUSY << 16;
else
sp->cmd->result =
DID_RESET << 16;
}
sp->flags = 0;
sp->cmd->result = DID_RESET << 16;
sp->cmd->host_scribble = (unsigned char *)NULL;
add_to_done_queue(ha, sp);
qla2x00_sp_compl(ha, sp);
}
}
spin_unlock_irqrestore(&ha->hardware_lock, flags);
Expand All @@ -3739,11 +3643,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
/* Enable ISP interrupts. */
qla2x00_enable_intrs(ha);

/* v2.19.5b6 Return all commands */
qla2x00_abort_queues(ha, 1);

/* Restart queues that may have been stopped. */
qla2x00_restart_queues(ha, 1);
ha->isp_abort_cnt = 0;
clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
} else { /* failed the ISP abort */
Expand All @@ -3758,7 +3657,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
* completely.
*/
qla2x00_reset_adapter(ha);
qla2x00_abort_queues(ha, 0);
ha->flags.online = 0;
clear_bit(ISP_ABORT_RETRY,
&ha->dpc_flags);
Expand Down
13 changes: 0 additions & 13 deletions drivers/scsi/qla2xxx/qla_iocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ qla2x00_start_scsi(srb_t *sp)
uint32_t index;
uint32_t handle;
cmd_entry_t *cmd_pkt;
uint32_t timeout;
struct scatterlist *sg;
uint16_t cnt;
uint16_t req_cnt;
Expand Down Expand Up @@ -433,18 +432,6 @@ qla2x00_start_scsi(srb_t *sp)
}
}

/*
* Allocate at least 5 (+ QLA_CMD_TIMER_DELTA) seconds for RISC timeout.
*/
timeout = (uint32_t)(cmd->timeout_per_command / HZ);
if (timeout > 65535)
cmd_pkt->timeout = __constant_cpu_to_le16(0);
else if (timeout > 25)
cmd_pkt->timeout = cpu_to_le16((uint16_t)timeout -
(5 + QLA_CMD_TIMER_DELTA));
else
cmd_pkt->timeout = cpu_to_le16((uint16_t)timeout);

/* Load SCSI command packet. */
memcpy(cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len);
cmd_pkt->byte_count = cpu_to_le32((uint32_t)cmd->request_bufflen);
Expand Down
Loading

0 comments on commit f4f051e

Please sign in to comment.