Commit 72b81768 authored by Martin K. Petersen's avatar Martin K. Petersen

Merge patch series: "qla2xxx driver bug fixes"

Nilesh Javali <njavali@marvell.com> says:

Martin,

Please apply the qla2xxx driver bug fixes to the scsi tree at your
earliest convenience.

Link: https://lore.kernel.org/r/20230714070104.40052-1-njavali@marvell.comSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents d417a6ff a31a596a
...@@ -466,6 +466,7 @@ static inline be_id_t port_id_to_be_id(port_id_t port_id) ...@@ -466,6 +466,7 @@ static inline be_id_t port_id_to_be_id(port_id_t port_id)
} }
struct tmf_arg { struct tmf_arg {
struct list_head tmf_elem;
struct qla_qpair *qpair; struct qla_qpair *qpair;
struct fc_port *fcport; struct fc_port *fcport;
struct scsi_qla_host *vha; struct scsi_qla_host *vha;
...@@ -2541,7 +2542,6 @@ enum rscn_addr_format { ...@@ -2541,7 +2542,6 @@ enum rscn_addr_format {
typedef struct fc_port { typedef struct fc_port {
struct list_head list; struct list_head list;
struct scsi_qla_host *vha; struct scsi_qla_host *vha;
struct list_head tmf_pending;
unsigned int conf_compl_supported:1; unsigned int conf_compl_supported:1;
unsigned int deleted:2; unsigned int deleted:2;
...@@ -2562,9 +2562,6 @@ typedef struct fc_port { ...@@ -2562,9 +2562,6 @@ typedef struct fc_port {
unsigned int do_prli_nvme:1; unsigned int do_prli_nvme:1;
uint8_t nvme_flag; uint8_t nvme_flag;
uint8_t active_tmf;
#define MAX_ACTIVE_TMF 8
uint8_t node_name[WWN_SIZE]; uint8_t node_name[WWN_SIZE];
uint8_t port_name[WWN_SIZE]; uint8_t port_name[WWN_SIZE];
port_id_t d_id; port_id_t d_id;
...@@ -4657,6 +4654,8 @@ struct qla_hw_data { ...@@ -4657,6 +4654,8 @@ struct qla_hw_data {
uint32_t flt_region_aux_img_status_sec; uint32_t flt_region_aux_img_status_sec;
}; };
uint8_t active_image; uint8_t active_image;
uint8_t active_tmf;
#define MAX_ACTIVE_TMF 8
/* Needed for BEACON */ /* Needed for BEACON */
uint16_t beacon_blink_led; uint16_t beacon_blink_led;
...@@ -4671,6 +4670,8 @@ struct qla_hw_data { ...@@ -4671,6 +4670,8 @@ struct qla_hw_data {
struct qla_msix_entry *msix_entries; struct qla_msix_entry *msix_entries;
struct list_head tmf_pending;
struct list_head tmf_active;
struct list_head vp_list; /* list of VP */ struct list_head vp_list; /* list of VP */
unsigned long vp_idx_map[(MAX_MULTI_ID_FABRIC / 8) / unsigned long vp_idx_map[(MAX_MULTI_ID_FABRIC / 8) /
sizeof(unsigned long)]; sizeof(unsigned long)];
......
...@@ -143,6 +143,7 @@ void qla_edif_sess_down(struct scsi_qla_host *vha, struct fc_port *sess); ...@@ -143,6 +143,7 @@ void qla_edif_sess_down(struct scsi_qla_host *vha, struct fc_port *sess);
void qla_edif_clear_appdata(struct scsi_qla_host *vha, void qla_edif_clear_appdata(struct scsi_qla_host *vha,
struct fc_port *fcport); struct fc_port *fcport);
const char *sc_to_str(uint16_t cmd); const char *sc_to_str(uint16_t cmd);
void qla_adjust_iocb_limit(scsi_qla_host_t *vha);
/* /*
* Global Data in qla_os.c source file. * Global Data in qla_os.c source file.
......
This diff is collapsed.
...@@ -3881,6 +3881,7 @@ qla_marker_iocb(srb_t *sp, struct mrk_entry_24xx *mrk) ...@@ -3881,6 +3881,7 @@ qla_marker_iocb(srb_t *sp, struct mrk_entry_24xx *mrk)
{ {
mrk->entry_type = MARKER_TYPE; mrk->entry_type = MARKER_TYPE;
mrk->modifier = sp->u.iocb_cmd.u.tmf.modifier; mrk->modifier = sp->u.iocb_cmd.u.tmf.modifier;
mrk->handle = make_handle(sp->qpair->req->id, sp->handle);
if (sp->u.iocb_cmd.u.tmf.modifier != MK_SYNC_ALL) { if (sp->u.iocb_cmd.u.tmf.modifier != MK_SYNC_ALL) {
mrk->nport_handle = cpu_to_le16(sp->u.iocb_cmd.u.tmf.loop_id); mrk->nport_handle = cpu_to_le16(sp->u.iocb_cmd.u.tmf.loop_id);
int_to_scsilun(sp->u.iocb_cmd.u.tmf.lun, (struct scsi_lun *)&mrk->lun); int_to_scsilun(sp->u.iocb_cmd.u.tmf.lun, (struct scsi_lun *)&mrk->lun);
......
...@@ -1121,8 +1121,12 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -1121,8 +1121,12 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
unsigned long flags; unsigned long flags;
fc_port_t *fcport = NULL; fc_port_t *fcport = NULL;
if (!vha->hw->flags.fw_started) if (!vha->hw->flags.fw_started) {
ql_log(ql_log_warn, vha, 0x50ff,
"Dropping AEN - %04x %04x %04x %04x.\n",
mb[0], mb[1], mb[2], mb[3]);
return; return;
}
/* Setup to process RIO completion. */ /* Setup to process RIO completion. */
handle_cnt = 0; handle_cnt = 0;
...@@ -2539,7 +2543,6 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk) ...@@ -2539,7 +2543,6 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)
case CS_PORT_BUSY: case CS_PORT_BUSY:
case CS_INCOMPLETE: case CS_INCOMPLETE:
case CS_PORT_UNAVAILABLE: case CS_PORT_UNAVAILABLE:
case CS_TIMEOUT:
case CS_RESET: case CS_RESET:
if (atomic_read(&fcport->state) == FCS_ONLINE) { if (atomic_read(&fcport->state) == FCS_ONLINE) {
ql_dbg(ql_dbg_disc, fcport->vha, 0x3021, ql_dbg(ql_dbg_disc, fcport->vha, 0x3021,
......
...@@ -2213,6 +2213,9 @@ qla2x00_get_firmware_state(scsi_qla_host_t *vha, uint16_t *states) ...@@ -2213,6 +2213,9 @@ qla2x00_get_firmware_state(scsi_qla_host_t *vha, uint16_t *states)
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1054, ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1054,
"Entered %s.\n", __func__); "Entered %s.\n", __func__);
if (!ha->flags.fw_started)
return QLA_FUNCTION_FAILED;
mcp->mb[0] = MBC_GET_FIRMWARE_STATE; mcp->mb[0] = MBC_GET_FIRMWARE_STATE;
mcp->out_mb = MBX_0; mcp->out_mb = MBX_0;
if (IS_FWI2_CAPABLE(vha->hw)) if (IS_FWI2_CAPABLE(vha->hw))
......
...@@ -132,6 +132,7 @@ static int qla_nvme_alloc_queue(struct nvme_fc_local_port *lport, ...@@ -132,6 +132,7 @@ static int qla_nvme_alloc_queue(struct nvme_fc_local_port *lport,
"Failed to allocate qpair\n"); "Failed to allocate qpair\n");
return -EINVAL; return -EINVAL;
} }
qla_adjust_iocb_limit(vha);
} }
*handle = qpair; *handle = qpair;
...@@ -667,7 +668,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, ...@@ -667,7 +668,7 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
rval = qla2x00_start_nvme_mq(sp); rval = qla2x00_start_nvme_mq(sp);
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x212d, ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x212d,
"qla2x00_start_nvme_mq failed = %d\n", rval); "qla2x00_start_nvme_mq failed = %d\n", rval);
sp->priv = NULL; sp->priv = NULL;
priv->sp = NULL; priv->sp = NULL;
......
...@@ -1488,8 +1488,9 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd) ...@@ -1488,8 +1488,9 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
goto eh_reset_failed; goto eh_reset_failed;
} }
err = 3; err = 3;
if (qla2x00_eh_wait_for_pending_commands(vha, sdev->id, if (qla2x00_eh_wait_for_pending_commands(vha, fcport->d_id.b24,
sdev->lun, WAIT_LUN) != QLA_SUCCESS) { cmd->device->lun,
WAIT_LUN) != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x800d, ql_log(ql_log_warn, vha, 0x800d,
"wait for pending cmds failed for cmd=%p.\n", cmd); "wait for pending cmds failed for cmd=%p.\n", cmd);
goto eh_reset_failed; goto eh_reset_failed;
...@@ -1555,8 +1556,8 @@ qla2xxx_eh_target_reset(struct scsi_cmnd *cmd) ...@@ -1555,8 +1556,8 @@ qla2xxx_eh_target_reset(struct scsi_cmnd *cmd)
goto eh_reset_failed; goto eh_reset_failed;
} }
err = 3; err = 3;
if (qla2x00_eh_wait_for_pending_commands(vha, sdev->id, if (qla2x00_eh_wait_for_pending_commands(vha, fcport->d_id.b24, 0,
0, WAIT_TARGET) != QLA_SUCCESS) { WAIT_TARGET) != QLA_SUCCESS) {
ql_log(ql_log_warn, vha, 0x800d, ql_log(ql_log_warn, vha, 0x800d,
"wait for pending cmds failed for cmd=%p.\n", cmd); "wait for pending cmds failed for cmd=%p.\n", cmd);
goto eh_reset_failed; goto eh_reset_failed;
...@@ -3009,6 +3010,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -3009,6 +3010,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
atomic_set(&ha->num_pend_mbx_stage3, 0); atomic_set(&ha->num_pend_mbx_stage3, 0);
atomic_set(&ha->zio_threshold, DEFAULT_ZIO_THRESHOLD); atomic_set(&ha->zio_threshold, DEFAULT_ZIO_THRESHOLD);
ha->last_zio_threshold = DEFAULT_ZIO_THRESHOLD; ha->last_zio_threshold = DEFAULT_ZIO_THRESHOLD;
INIT_LIST_HEAD(&ha->tmf_pending);
INIT_LIST_HEAD(&ha->tmf_active);
/* Assign ISP specific operations. */ /* Assign ISP specific operations. */
if (IS_QLA2100(ha)) { if (IS_QLA2100(ha)) {
......
...@@ -1068,10 +1068,6 @@ void qlt_free_session_done(struct work_struct *work) ...@@ -1068,10 +1068,6 @@ void qlt_free_session_done(struct work_struct *work)
(struct imm_ntfy_from_isp *)sess->iocb, SRB_NACK_LOGO); (struct imm_ntfy_from_isp *)sess->iocb, SRB_NACK_LOGO);
} }
spin_lock_irqsave(&vha->work_lock, flags);
sess->flags &= ~FCF_ASYNC_SENT;
spin_unlock_irqrestore(&vha->work_lock, flags);
spin_lock_irqsave(&ha->tgt.sess_lock, flags); spin_lock_irqsave(&ha->tgt.sess_lock, flags);
if (sess->se_sess) { if (sess->se_sess) {
sess->se_sess = NULL; sess->se_sess = NULL;
...@@ -1081,7 +1077,6 @@ void qlt_free_session_done(struct work_struct *work) ...@@ -1081,7 +1077,6 @@ void qlt_free_session_done(struct work_struct *work)
qla2x00_set_fcport_disc_state(sess, DSC_DELETED); qla2x00_set_fcport_disc_state(sess, DSC_DELETED);
sess->fw_login_state = DSC_LS_PORT_UNAVAIL; sess->fw_login_state = DSC_LS_PORT_UNAVAIL;
sess->deleted = QLA_SESS_DELETED;
if (sess->login_succ && !IS_SW_RESV_ADDR(sess->d_id)) { if (sess->login_succ && !IS_SW_RESV_ADDR(sess->d_id)) {
vha->fcport_count--; vha->fcport_count--;
...@@ -1133,10 +1128,15 @@ void qlt_free_session_done(struct work_struct *work) ...@@ -1133,10 +1128,15 @@ void qlt_free_session_done(struct work_struct *work)
sess->explicit_logout = 0; sess->explicit_logout = 0;
spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
sess->free_pending = 0;
qla2x00_dfs_remove_rport(vha, sess); qla2x00_dfs_remove_rport(vha, sess);
spin_lock_irqsave(&vha->work_lock, flags);
sess->flags &= ~FCF_ASYNC_SENT;
sess->deleted = QLA_SESS_DELETED;
sess->free_pending = 0;
spin_unlock_irqrestore(&vha->work_lock, flags);
ql_dbg(ql_dbg_disc, vha, 0xf001, ql_dbg(ql_dbg_disc, vha, 0xf001,
"Unregistration of sess %p %8phC finished fcp_cnt %d\n", "Unregistration of sess %p %8phC finished fcp_cnt %d\n",
sess, sess->port_name, vha->fcport_count); sess, sess->port_name, vha->fcport_count);
...@@ -1185,12 +1185,12 @@ void qlt_unreg_sess(struct fc_port *sess) ...@@ -1185,12 +1185,12 @@ void qlt_unreg_sess(struct fc_port *sess)
* management from being sent. * management from being sent.
*/ */
sess->flags |= FCF_ASYNC_SENT; sess->flags |= FCF_ASYNC_SENT;
sess->deleted = QLA_SESS_DELETION_IN_PROGRESS;
spin_unlock_irqrestore(&sess->vha->work_lock, flags); spin_unlock_irqrestore(&sess->vha->work_lock, flags);
if (sess->se_sess) if (sess->se_sess)
vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess); vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map(sess);
sess->deleted = QLA_SESS_DELETION_IN_PROGRESS;
qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND); qla2x00_set_fcport_disc_state(sess, DSC_DELETE_PEND);
sess->last_rscn_gen = sess->rscn_gen; sess->last_rscn_gen = sess->rscn_gen;
sess->last_login_gen = sess->login_gen; sess->last_login_gen = sess->login_gen;
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
/* /*
* Driver version * Driver version
*/ */
#define QLA2XXX_VERSION "10.02.08.400-k" #define QLA2XXX_VERSION "10.02.08.500-k"
#define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MAJOR_VER 10
#define QLA_DRIVER_MINOR_VER 2 #define QLA_DRIVER_MINOR_VER 2
#define QLA_DRIVER_PATCH_VER 8 #define QLA_DRIVER_PATCH_VER 8
#define QLA_DRIVER_BETA_VER 400 #define QLA_DRIVER_BETA_VER 500
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment