From: Linus Torvalds Date: Fri, 28 Dec 2018 22:48:06 +0000 (-0800) Subject: Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=938edb8a31b976c9a92eb0cd4ff481e93f76c1f1;p=openwrt%2Fstaging%2Fblogic.git Merge tag 'scsi-misc' of git://git./linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This is mostly update of the usual drivers: smarpqi, lpfc, qedi, megaraid_sas, libsas, zfcp, mpt3sas, hisi_sas. Additionally, we have a pile of annotation, unused variable and minor updates. The big API change is the updates for Christoph's DMA rework which include removing the DISABLE_CLUSTERING flag. And finally there are a couple of target tree updates" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (259 commits) scsi: isci: request: mark expected switch fall-through scsi: isci: remote_node_context: mark expected switch fall-throughs scsi: isci: remote_device: Mark expected switch fall-throughs scsi: isci: phy: Mark expected switch fall-through scsi: iscsi: Capture iscsi debug messages using tracepoints scsi: myrb: Mark expected switch fall-throughs scsi: megaraid: fix out-of-bound array accesses scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through scsi: fcoe: remove set but not used variable 'port' scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() scsi: smartpqi: fix build warnings scsi: smartpqi: update driver version scsi: smartpqi: add ofa support scsi: smartpqi: increase fw status register read timeout scsi: smartpqi: bump driver version scsi: smartpqi: add smp_utils support scsi: smartpqi: correct lun reset issues scsi: smartpqi: correct volume status scsi: smartpqi: do not offline disks for transient did no connect conditions scsi: smartpqi: allow for larger raid maps ... --- 938edb8a31b976c9a92eb0cd4ff481e93f76c1f1 diff --cc drivers/scsi/qla2xxx/qla_os.c index f92196ec5489,90f1742cff58..ea69dafc9774 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@@ -1742,6 -1745,41 +1741,49 @@@ qla2x00_loop_reset(scsi_qla_host_t *vha return QLA_SUCCESS; } + static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res, + unsigned long *flags) + __releases(qp->qp_lock_ptr) + __acquires(qp->qp_lock_ptr) + { + scsi_qla_host_t *vha = qp->vha; + struct qla_hw_data *ha = vha->hw; + + if (sp->type == SRB_NVME_CMD || sp->type == SRB_NVME_LS) { + if (!sp_get(sp)) { + /* got sp */ + spin_unlock_irqrestore(qp->qp_lock_ptr, *flags); + qla_nvme_abort(ha, sp, res); + spin_lock_irqsave(qp->qp_lock_ptr, *flags); + } + } else if (GET_CMD_SP(sp) && !ha->flags.eeh_busy && + !test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) && + !qla2x00_isp_reg_stat(ha) && sp->type == SRB_SCSI_CMD) { + /* + * Don't abort commands in adapter during EEH recovery as it's + * not accessible/responding. + * + * Get a reference to the sp and drop the lock. The reference + * ensures this sp->done() call and not the call in + * qla2xxx_eh_abort() ends the SCSI cmd (with result 'res'). + */ + if (!sp_get(sp)) { ++ int status; ++ + spin_unlock_irqrestore(qp->qp_lock_ptr, *flags); - qla2xxx_eh_abort(GET_CMD_SP(sp)); ++ status = qla2xxx_eh_abort(GET_CMD_SP(sp)); + spin_lock_irqsave(qp->qp_lock_ptr, *flags); ++ /* ++ * Get rid of extra reference caused ++ * by early exit from qla2xxx_eh_abort ++ */ ++ if (status == FAST_IO_FAIL) ++ atomic_dec(&sp->ref_count); + } + } + sp->done(sp, res); + } + static void __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res) { diff --cc drivers/target/target_core_transport.c index 2cfd61d62e97,dccf2c58c7ec..ef9e75b359d4 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@@ -1790,10 -1831,13 +1831,13 @@@ void transport_generic_request_failure( transport_complete_task_attr(cmd); if (cmd->transport_complete_callback) - cmd->transport_complete_callback(cmd, false, NULL); + cmd->transport_complete_callback(cmd, false, &post_ret); - if (transport_check_aborted_status(cmd, 1)) + if (cmd->transport_state & CMD_T_ABORTED) { + INIT_WORK(&cmd->work, target_abort_work); + queue_work(target_completion_wq, &cmd->work); return; + } switch (sense_reason) { case TCM_NON_EXISTENT_LUN: diff --cc include/linux/blkdev.h index 45552e6eae1e,653ae90eec0b..338604dff7d0 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@@ -653,16 -775,15 +652,11 @@@ static inline bool blk_account_rq(struc #define rq_data_dir(rq) (op_is_write(req_op(rq)) ? WRITE : READ) -/* - * Driver can handle struct request, if it either has an old style - * request_fn defined, or is blk-mq based. - */ -static inline bool queue_is_rq_based(struct request_queue *q) +static inline bool queue_is_mq(struct request_queue *q) { - return q->request_fn || q->mq_ops; + return q->mq_ops; } - static inline unsigned int blk_queue_cluster(struct request_queue *q) - { - return q->limits.cluster; - } - static inline enum blk_zoned_model blk_queue_zoned_model(struct request_queue *q) {