Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148031
b: refs/heads/master
c: fd65e5e
h: refs/heads/master
i:
  148029: 9f419cc
  148027: b3574f1
  148023: 62ffd68
  148015: 2a02dea
  147999: 69879e5
  147967: eb257d8
v: v3
  • Loading branch information
Michael Reed authored and James Bottomley committed May 20, 2009
1 parent 7bba129 commit fb6db9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 90 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14faf12f7df8404c3e8e54baad8d178c327a2f87
refs/heads/master: fd65e5e93cbd9d2f34bbb0f0b2f46a30a1d20915
99 changes: 10 additions & 89 deletions trunk/drivers/scsi/qla1280.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ static int qla1280_mailbox_command(struct scsi_qla_host *,
uint8_t, uint16_t *);
static int qla1280_bus_reset(struct scsi_qla_host *, int);
static int qla1280_device_reset(struct scsi_qla_host *, int, int);
static int qla1280_abort_device(struct scsi_qla_host *, int, int, int);
static int qla1280_abort_command(struct scsi_qla_host *, struct srb *, int);
static int qla1280_abort_isp(struct scsi_qla_host *);
#ifdef QLA_64BIT_PTR
Expand Down Expand Up @@ -698,7 +697,7 @@ qla1280_info(struct Scsi_Host *host)
}

/**************************************************************************
* qla1200_queuecommand
* qla1280_queuecommand
* Queue a command to the controller.
*
* Note:
Expand All @@ -713,7 +712,7 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
{
struct Scsi_Host *host = cmd->device->host;
struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
struct srb *sp = (struct srb *)&cmd->SCp;
struct srb *sp = (struct srb *)CMD_SP(cmd);
int status;

cmd->scsi_done = fn;
Expand All @@ -738,11 +737,9 @@ qla1280_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))

enum action {
ABORT_COMMAND,
ABORT_DEVICE,
DEVICE_RESET,
BUS_RESET,
ADAPTER_RESET,
FAIL
};

/* timer action for error action processor */
Expand All @@ -768,7 +765,7 @@ static void qla1280_mailbox_timeout(unsigned long __data)
}

/**************************************************************************
* qla1200_error_action
* qla1280_error_action
* The function will attempt to perform a specified error action and
* wait for the results (or time out).
*
Expand Down Expand Up @@ -798,6 +795,8 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
DECLARE_COMPLETION_ONSTACK(wait);
struct timer_list timer;

ENTER("qla1280_error_action");

ha = (struct scsi_qla_host *)(CMD_HOST(cmd)->hostdata);

dprintk(4, "error_action %i, istatus 0x%04x\n", action,
Expand All @@ -807,20 +806,11 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
RD_REG_WORD(&ha->iobase->host_cmd),
RD_REG_WORD(&ha->iobase->ictrl), jiffies);

ENTER("qla1280_error_action");
if (qla1280_verbose)
printk(KERN_INFO "scsi(%li): Resetting Cmnd=0x%p, "
"Handle=0x%p, action=0x%x\n",
ha->host_no, cmd, CMD_HANDLE(cmd), action);

if (cmd == NULL) {
printk(KERN_WARNING "(scsi?:?:?:?) Reset called with NULL "
"si_Cmnd pointer, failing.\n");
LEAVE("qla1280_error_action");
return FAILED;
}

ha = (struct scsi_qla_host *)cmd->device->host->hostdata;
sp = (struct srb *)CMD_SP(cmd);
handle = CMD_HANDLE(cmd);

Expand Down Expand Up @@ -857,9 +847,6 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
* mean the actual success or fail of the action */
result = FAILED;
switch (action) {
case FAIL:
break;

case ABORT_COMMAND:
if ((sp->flags & SRB_ABORT_PENDING)) {
printk(KERN_WARNING
Expand Down Expand Up @@ -893,15 +880,6 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
}
break;

case ABORT_DEVICE:
if (qla1280_verbose)
printk(KERN_INFO
"scsi(%ld:%d:%d:%d): Queueing abort device "
"command.\n", ha->host_no, bus, target, lun);
if (qla1280_abort_device(ha, bus, target, lun) == 0)
result = SUCCESS;
break;

case DEVICE_RESET:
if (qla1280_verbose)
printk(KERN_INFO
Expand Down Expand Up @@ -1285,8 +1263,6 @@ qla1280_done(struct scsi_qla_host *ha)
case DID_ABORT:
sp->flags &= ~SRB_ABORT_PENDING;
sp->flags |= SRB_ABORTED;
if (sp->flags & SRB_TIMEOUT)
CMD_RESULT(sp->cmd) = DID_TIME_OUT << 16;
break;
default:
break;
Expand Down Expand Up @@ -2417,9 +2393,6 @@ static int
qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb)
{
struct device_reg __iomem *reg = ha->iobase;
#if 0
LIST_HEAD(done_q);
#endif
int status = 0;
int cnt;
uint16_t *optr, *iptr;
Expand Down Expand Up @@ -2493,19 +2466,9 @@ qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb)
mr = MAILBOX_REGISTER_COUNT;
memcpy(optr, iptr, MAILBOX_REGISTER_COUNT * sizeof(uint16_t));

#if 0
/* Go check for any response interrupts pending. */
qla1280_isr(ha, &done_q);
#endif

if (ha->flags.reset_marker)
qla1280_rst_aen(ha);

#if 0
if (!list_empty(&done_q))
qla1280_done(ha, &done_q);
#endif

if (status)
dprintk(2, "qla1280_mailbox_command: **** FAILED, mailbox0 = "
"0x%x ****\n", mb[0]);
Expand Down Expand Up @@ -2640,41 +2603,6 @@ qla1280_device_reset(struct scsi_qla_host *ha, int bus, int target)
return status;
}

/*
* qla1280_abort_device
* Issue an abort message to the device
*
* Input:
* ha = adapter block pointer.
* bus = SCSI BUS.
* target = SCSI ID.
* lun = SCSI LUN.
*
* Returns:
* 0 = success
*/
static int
qla1280_abort_device(struct scsi_qla_host *ha, int bus, int target, int lun)
{
uint16_t mb[MAILBOX_REGISTER_COUNT];
int status;

ENTER("qla1280_abort_device");

mb[0] = MBC_ABORT_DEVICE;
mb[1] = (bus ? target | BIT_7 : target) << 8 | lun;
status = qla1280_mailbox_command(ha, BIT_1 | BIT_0, &mb[0]);

/* Issue marker command. */
qla1280_marker(ha, bus, target, lun, MK_SYNC_ID_LUN);

if (status)
dprintk(2, "qla1280_abort_device: **** FAILED ****\n");

LEAVE("qla1280_abort_device");
return status;
}

/*
* qla1280_abort_command
* Abort command aborts a specified IOCB.
Expand Down Expand Up @@ -2833,7 +2761,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)

/* If room for request in request ring. */
if ((req_cnt + 2) >= ha->req_q_cnt) {
status = 1;
status = SCSI_MLQUEUE_HOST_BUSY;
dprintk(2, "qla1280_start_scsi: in-ptr=0x%x req_q_cnt="
"0x%xreq_cnt=0x%x", ha->req_ring_index, ha->req_q_cnt,
req_cnt);
Expand All @@ -2845,7 +2773,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
ha->outstanding_cmds[cnt] != NULL; cnt++);

if (cnt >= MAX_OUTSTANDING_COMMANDS) {
status = 1;
status = SCSI_MLQUEUE_HOST_BUSY;
dprintk(2, "qla1280_start_scsi: NO ROOM IN "
"OUTSTANDING ARRAY, req_q_cnt=0x%x", ha->req_q_cnt);
goto out;
Expand Down Expand Up @@ -3108,7 +3036,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
ha->req_q_cnt, seg_cnt);
/* If room for request in request ring. */
if ((req_cnt + 2) >= ha->req_q_cnt) {
status = 1;
status = SCSI_MLQUEUE_HOST_BUSY;
dprintk(2, "qla1280_32bit_start_scsi: in-ptr=0x%x, "
"req_q_cnt=0x%x, req_cnt=0x%x", ha->req_ring_index,
ha->req_q_cnt, req_cnt);
Expand All @@ -3120,7 +3048,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
(ha->outstanding_cmds[cnt] != 0); cnt++) ;

if (cnt >= MAX_OUTSTANDING_COMMANDS) {
status = 1;
status = SCSI_MLQUEUE_HOST_BUSY;
dprintk(2, "qla1280_32bit_start_scsi: NO ROOM IN OUTSTANDING "
"ARRAY, req_q_cnt=0x%x\n", ha->req_q_cnt);
goto out;
Expand Down Expand Up @@ -3495,7 +3423,7 @@ qla1280_isr(struct scsi_qla_host *ha, struct list_head *done_q)
* If we get here we have a real problem!
*/
printk(KERN_WARNING
"qla1280: ISP invalid handle");
"qla1280: ISP invalid handle\n");
}
}
break;
Expand Down Expand Up @@ -3955,13 +3883,6 @@ qla1280_check_for_dead_scsi_bus(struct scsi_qla_host *ha, unsigned int bus)

if (scsi_control == SCSI_PHASE_INVALID) {
ha->bus_settings[bus].scsi_bus_dead = 1;
#if 0
CMD_RESULT(cp) = DID_NO_CONNECT << 16;
CMD_HANDLE(cp) = INVALID_HANDLE;
/* ha->actthreads--; */

(*(cp)->scsi_done)(cp);
#endif
return 1; /* bus is dead */
} else {
ha->bus_settings[bus].scsi_bus_dead = 0;
Expand Down

0 comments on commit fb6db9f

Please sign in to comment.