Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2019-04-02 18:01:27 -07:00
6 changed files with 44 additions and 22 deletions

View File

@@ -826,7 +826,8 @@ static void sqa_free_session_done(struct scst_session *scst_sess)
struct fc_port *fcport =
(struct fc_port*)scst_sess_get_tgt_priv(scst_sess);
fcport->se_sess->sess_tearing_down = 0;
if (fcport->unreg_done)
complete(fcport->unreg_done);
}
static void sqa_qla2xxx_free_session(struct fc_port *fcport)
@@ -836,7 +837,6 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport)
struct scst_session *scst_sess =
(struct scst_session *)se_sess->fabric_sess_ptr;
struct qla_tgt_mgmt_cmd *mcmd;
bool traced = false;
TRACE_ENTRY();
@@ -844,9 +844,6 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport)
vha->host_no, vha->vp_idx, fcport->port_name,
fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa);
/* look for sqa_free_session_done to clear this flag. */
se_sess->sess_tearing_down = 1;
mcmd = kzalloc(sizeof(*mcmd), GFP_ATOMIC);
if (mcmd) {
DECLARE_COMPLETION_ONSTACK(c);
@@ -868,14 +865,10 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport)
scst_unregister_session(scst_sess, 1, sqa_free_session_done);
while (se_sess->sess_tearing_down) {
if (!traced) {
TRACE_MGMT_DBG("sqatgt(%ld/%d): waiting for scst_sess "
"unregistration %8phC\n", vha->host_no, vha->vp_idx,
fcport->port_name);
traced = true;
}
msleep(100);
{
DECLARE_COMPLETION_ONSTACK(c);
fcport->unreg_done = &c;
wait_for_completion(&c);
}
TRACE_MGMT_DBG("sqatgt(%ld/%d): Unregister completed %8phC done \n",
@@ -1702,7 +1695,6 @@ static int sqa_xmit_response(struct scst_cmd *scst_cmd)
cmd->offset = scst_cmd_get_ppl_offset(scst_cmd);
cmd->scsi_status = scst_cmd_get_status(scst_cmd);
cmd->cdb = (unsigned char *) scst_cmd_get_cdb(scst_cmd);
cmd->se_cmd.t_task_cdb = (unsigned char *) scst_cmd_get_cdb(scst_cmd);
cmd->lba = scst_cmd_get_lba(scst_cmd);
cmd->trc_flags |= TRC_XMIT_STATUS;
@@ -1787,7 +1779,6 @@ static int sqa_rdy_to_xfer(struct scst_cmd *scst_cmd)
scst_to_tgt_dma_dir(scst_cmd_get_data_direction(scst_cmd));
cmd->cdb = (unsigned char *) scst_cmd_get_cdb(scst_cmd);
cmd->se_cmd.t_task_cdb = (unsigned char *) scst_cmd_get_cdb(scst_cmd);
cmd->sg = scst_cmd_get_sg(scst_cmd);
cmd->sg_cnt = scst_cmd_get_sg_cnt(scst_cmd);
cmd->scsi_status = scst_cmd_get_status(scst_cmd);

View File

@@ -2398,6 +2398,7 @@ typedef struct fc_port {
struct work_struct reg_work;
uint64_t jiffies_at_registration;
struct qlt_plogi_ack_t *plogi_link[QLT_PLOGI_LINK_MAX];
struct completion *unreg_done;
uint16_t tgt_id;
uint16_t old_tgt_id;

View File

@@ -3461,7 +3461,7 @@ static int
qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
{
int i, ret;
struct qla_msix_entry *qentry;
struct qla_msix_entry *qentry = NULL;
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
int min_vecs = QLA_BASE_VECTORS;
@@ -3763,8 +3763,6 @@ qla2x00_free_irqs(scsi_qla_host_t *vha)
{
struct qla_hw_data *ha = vha->hw;
struct rsp_que *rsp;
struct qla_msix_entry *qentry;
int i;
/*
* We need to check that ha->rsp_q_map is valid in case we are called
@@ -3775,6 +3773,9 @@ qla2x00_free_irqs(scsi_qla_host_t *vha)
rsp = ha->rsp_q_map[0];
if (ha->flags.msix_enabled) {
struct qla_msix_entry *qentry;
int i;
for (i = 0; i < ha->msix_count; i++) {
qentry = &ha->msix_entries[i];
if (qentry->have_irq) {

View File

@@ -7273,7 +7273,12 @@ static void qla_pci_reset_notify(struct pci_dev *dev, bool prepare)
}
#endif
static const struct pci_error_handlers qla2xxx_err_handler = {
static
/* See also commit 494530284f16 ("PCI: Make pci_error_handlers const") # v3.7 */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0) || defined(RHEL_MAJOR)
const
#endif
struct pci_error_handlers qla2xxx_err_handler = {
.error_detected = qla2xxx_pci_error_detected,
.mmio_enabled = qla2xxx_pci_mmio_enabled,
.slot_reset = qla2xxx_pci_slot_reset,

View File

@@ -2834,15 +2834,15 @@ static int qlt_pre_xmit_response(struct qla_tgt_cmd *cmd,
ql_dbg_qp(ql_dbg_io + ql_dbg_verbose, qpair, 0x305c,
"Residual underflow: %d (tag %lld, op %x, bufflen %d, rq_result %x)\n",
prm->residual, se_cmd_tag(se_cmd),
se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0,
cmd->cdb ? cmd->cdb[0] : 0,
cmd->bufflen, prm->rq_result);
prm->rq_result |= SS_RESIDUAL_UNDER;
} else if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) {
prm->residual = se_cmd->residual_count;
ql_dbg_qp(ql_dbg_io, qpair, 0x305d,
"Residual overflow: %d (tag %lld, op %x, bufflen %d, rq_result %x)\n",
prm->residual, se_cmd_tag(se_cmd), se_cmd->t_task_cdb ?
se_cmd->t_task_cdb[0] : 0, cmd->bufflen, prm->rq_result);
prm->residual, se_cmd_tag(se_cmd), cmd->cdb ?
cmd->cdb[0] : 0, cmd->bufflen, prm->rq_result);
prm->rq_result |= SS_RESIDUAL_OVER;
}

View File

@@ -941,6 +941,30 @@ struct nvmefc_fcp_req {
} __aligned(sizeof(u64)); /* alignment for other things alloc'd with */
#endif
/* <linux/pci.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) && !defined(RHEL_MAJOR)
/*
* See also commit 8c0d3a02c130 ("PCI: Add accessors for PCI Express
* Capability") # v3.7.
*/
static inline int pcie_capability_read_word(struct pci_dev *dev, int pos,
u16 *val)
{
WARN_ON_ONCE(true);
*val = 0;
return -ENOTSUPP;
}
static inline int pcie_capability_read_dword(struct pci_dev *dev, int pos,
u32 *val)
{
WARN_ON_ONCE(true);
*val = 0;
return -ENOTSUPP;
}
#endif
/* <linux/preempt.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)