Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204293
b: refs/heads/master
c: 4d78c97
h: refs/heads/master
i:
  204291: 627c5b3
v: v3
  • Loading branch information
Giridhar Malavali authored and James Bottomley committed Jul 28, 2010
1 parent d99c926 commit 3e9be07
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 41 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: 3711333dfbeec1905c2d3521d1ed2ddcdbdbac04
refs/heads/master: 4d78c973ef2d21e90ff55f97489d663a0959a93f
10 changes: 8 additions & 2 deletions trunk/drivers/scsi/qla2xxx/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -2981,9 +2981,15 @@ typedef struct scsi_qla_host {

#define QLA_DSDS_PER_IOCB 37

#define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr)

enum nexus_wait_type {
WAIT_HOST = 0,
WAIT_TARGET,
WAIT_LUN,
};

#include "qla_gbl.h"
#include "qla_dbg.h"
#include "qla_inline.h"

#define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr)
#endif
5 changes: 3 additions & 2 deletions trunk/drivers/scsi/qla2xxx/qla_gbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ extern int
qla24xx_abort_target(struct fc_port *, unsigned int, int);
extern int
qla24xx_lun_reset(struct fc_port *, unsigned int, int);

extern int
qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *, unsigned int,
unsigned int, enum nexus_wait_type);
extern int
qla2x00_system_error(scsi_qla_host_t *);

Expand Down Expand Up @@ -569,7 +571,6 @@ extern int qla82xx_mbx_intr_enable(scsi_qla_host_t *);
extern int qla82xx_mbx_intr_disable(scsi_qla_host_t *);
extern void qla82xx_start_iocbs(srb_t *);
extern int qla82xx_fcoe_ctx_reset(scsi_qla_host_t *);
extern void qla82xx_wait_for_pending_commands(scsi_qla_host_t *);

/* BSG related functions */
extern int qla24xx_bsg_request(struct fc_bsg_job *);
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3833,8 +3833,13 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
}

/* Make sure for ISP 82XX IO DMA is complete */
if (IS_QLA82XX(ha))
qla82xx_wait_for_pending_commands(vha);
if (IS_QLA82XX(ha)) {
if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
WAIT_HOST) == QLA_SUCCESS) {
DEBUG2(qla_printk(KERN_INFO, ha,
"Done wait for pending commands\n"));
}
}

/* Requeue all commands in outstanding command list. */
qla2x00_abort_all_cmds(vha, DID_RESET << 16);
Expand Down
41 changes: 7 additions & 34 deletions trunk/drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,24 +903,17 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
return ret;
}

enum nexus_wait_type {
WAIT_HOST = 0,
WAIT_TARGET,
WAIT_LUN,
};

static int
int
qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t,
unsigned int l, srb_t *sp, enum nexus_wait_type type)
unsigned int l, enum nexus_wait_type type)
{
int cnt, match, status;
unsigned long flags;
struct qla_hw_data *ha = vha->hw;
struct req_que *req;
srb_t *sp;

status = QLA_SUCCESS;
if (!sp)
return status;

spin_lock_irqsave(&ha->hardware_lock, flags);
req = vha->req;
Expand Down Expand Up @@ -958,24 +951,6 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t,
return status;
}

void qla82xx_wait_for_pending_commands(scsi_qla_host_t *vha)
{
int cnt;
srb_t *sp;
struct req_que *req = vha->req;

DEBUG2(qla_printk(KERN_INFO, vha->hw,
"Waiting for pending commands\n"));
for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
sp = req->outstanding_cmds[cnt];
if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
sp, WAIT_HOST) == QLA_SUCCESS) {
DEBUG2(qla_printk(KERN_INFO, vha->hw,
"Done wait for pending commands\n"));
}
}
}

static char *reset_errors[] = {
"HBA not online",
"HBA not ready",
Expand Down Expand Up @@ -1011,15 +986,15 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type,
goto eh_reset_failed;
err = 3;
if (qla2x00_eh_wait_for_pending_commands(vha, cmd->device->id,
cmd->device->lun, (srb_t *) CMD_SP(cmd), type) != QLA_SUCCESS)
cmd->device->lun, type) != QLA_SUCCESS)
goto eh_reset_failed;

qla_printk(KERN_INFO, vha->hw, "scsi(%ld:%d:%d): %s RESET SUCCEEDED.\n",
vha->host_no, cmd->device->id, cmd->device->lun, name);

return SUCCESS;

eh_reset_failed:
eh_reset_failed:
qla_printk(KERN_INFO, vha->hw, "scsi(%ld:%d:%d): %s RESET FAILED: %s.\n"
, vha->host_no, cmd->device->id, cmd->device->lun, name,
reset_errors[err]);
Expand Down Expand Up @@ -1069,7 +1044,6 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
int ret = FAILED;
unsigned int id, lun;
unsigned long serial;
srb_t *sp = (srb_t *) CMD_SP(cmd);

fc_block_scsi_eh(cmd);

Expand All @@ -1096,7 +1070,7 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
goto eh_bus_reset_done;

/* Flush outstanding commands. */
if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, sp, WAIT_HOST) !=
if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) !=
QLA_SUCCESS)
ret = FAILED;

Expand Down Expand Up @@ -1131,7 +1105,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
int ret = FAILED;
unsigned int id, lun;
unsigned long serial;
srb_t *sp = (srb_t *) CMD_SP(cmd);
scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);

fc_block_scsi_eh(cmd);
Expand Down Expand Up @@ -1186,7 +1159,7 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
}

/* Waiting for command to be returned to OS.*/
if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, sp, WAIT_HOST) ==
if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, WAIT_HOST) ==
QLA_SUCCESS)
ret = SUCCESS;

Expand Down

0 comments on commit 3e9be07

Please sign in to comment.