Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"23 fixes in 5 drivers (qla2xxx, ufs, scsi_debug, fcoe, zfcp). The bulk
of the changes are in qla2xxx and ufs and all are mostly small and
definitely don't impact the core"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (23 commits)
Revert "scsi: qla2xxx: Disable T10-DIF feature with FC-NVMe during probe"
Revert "scsi: qla2xxx: Fix crash on qla2x00_mailbox_command"
scsi: qla2xxx: Fix null pointer access during disconnect from subsystem
scsi: qla2xxx: Check if FW supports MQ before enabling
scsi: qla2xxx: Fix WARN_ON in qla_nvme_register_hba
scsi: qla2xxx: Allow ql2xextended_error_logging special value 1 to be set anytime
scsi: qla2xxx: Reduce noisy debug message
scsi: qla2xxx: Fix login timeout
scsi: qla2xxx: Indicate correct supported speeds for Mezz card
scsi: qla2xxx: Flush I/O on zone disable
scsi: qla2xxx: Flush all sessions on zone disable
scsi: qla2xxx: Use MBX_TOV_SECONDS for mailbox command timeout values
scsi: scsi_debug: Fix scp is NULL errors
scsi: zfcp: Fix use-after-free in request timeout handlers
scsi: ufs: No need to send Abort Task if the task in DB was cleared
scsi: ufs: Clean up completed request without interrupt notification
scsi: ufs: Improve interrupt handling for shared interrupts
scsi: ufs: Fix interrupt error message for shared interrupts
scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL
scsi: ufs-mediatek: Fix incorrect time to wait link status
...

+119 -52
+1 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
··· 193 193 } 194 194 195 195 /* alloc the udl from per cpu ddp pool */ 196 - ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_KERNEL, &ddp->udp); 196 + ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_ATOMIC, &ddp->udp); 197 197 if (!ddp->udl) { 198 198 e_err(drv, "failed allocated ddp context\n"); 199 199 goto out_noddp_unmap;
+2 -2
drivers/s390/scsi/zfcp_fsf.c
··· 434 434 return; 435 435 } 436 436 437 - del_timer(&req->timer); 437 + del_timer_sync(&req->timer); 438 438 zfcp_fsf_protstatus_eval(req); 439 439 zfcp_fsf_fsfstatus_eval(req); 440 440 req->handler(req); ··· 867 867 req->qdio_req.qdio_outb_usage = atomic_read(&qdio->req_q_free); 868 868 req->issued = get_tod_clock(); 869 869 if (zfcp_qdio_send(qdio, &req->qdio_req)) { 870 - del_timer(&req->timer); 870 + del_timer_sync(&req->timer); 871 871 /* lookup request again, list might have changed */ 872 872 zfcp_reqlist_find_rm(adapter->req_list, req_id); 873 873 zfcp_erp_adapter_reopen(adapter, 0, "fsrs__1");
+3
drivers/scsi/qla2xxx/qla_dbg.h
··· 380 380 static inline int 381 381 ql_mask_match(uint level) 382 382 { 383 + if (ql2xextended_error_logging == 1) 384 + ql2xextended_error_logging = QL_DBG_DEFAULT1_MASK; 385 + 383 386 return (level & ql2xextended_error_logging) == level; 384 387 }
+1
drivers/scsi/qla2xxx/qla_def.h
··· 3880 3880 uint32_t scm_supported_f:1; 3881 3881 /* Enabled in Driver */ 3882 3882 uint32_t scm_enabled:1; 3883 + uint32_t max_req_queue_warned:1; 3883 3884 } flags; 3884 3885 3885 3886 uint16_t max_exchg;
+39 -9
drivers/scsi/qla2xxx/qla_gs.c
··· 1505 1505 static uint 1506 1506 qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha) 1507 1507 { 1508 + uint speeds = 0; 1509 + 1508 1510 if (IS_CNA_CAPABLE(ha)) 1509 1511 return FDMI_PORT_SPEED_10GB; 1510 1512 if (IS_QLA28XX(ha) || IS_QLA27XX(ha)) { 1511 - uint speeds = 0; 1512 - 1513 1513 if (ha->max_supported_speed == 2) { 1514 1514 if (ha->min_supported_speed <= 6) 1515 1515 speeds |= FDMI_PORT_SPEED_64GB; ··· 1536 1536 } 1537 1537 return speeds; 1538 1538 } 1539 - if (IS_QLA2031(ha)) 1540 - return FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB| 1541 - FDMI_PORT_SPEED_4GB; 1539 + if (IS_QLA2031(ha)) { 1540 + if ((ha->pdev->subsystem_vendor == 0x103C) && 1541 + (ha->pdev->subsystem_device == 0x8002)) { 1542 + speeds = FDMI_PORT_SPEED_16GB; 1543 + } else { 1544 + speeds = FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB| 1545 + FDMI_PORT_SPEED_4GB; 1546 + } 1547 + return speeds; 1548 + } 1542 1549 if (IS_QLA25XX(ha)) 1543 1550 return FDMI_PORT_SPEED_8GB|FDMI_PORT_SPEED_4GB| 1544 1551 FDMI_PORT_SPEED_2GB|FDMI_PORT_SPEED_1GB; ··· 3443 3436 list_for_each_entry(fcport, &vha->vp_fcports, list) { 3444 3437 if ((fcport->flags & FCF_FABRIC_DEVICE) != 0) { 3445 3438 fcport->scan_state = QLA_FCPORT_SCAN; 3446 - fcport->logout_on_delete = 0; 3447 3439 } 3448 3440 } 3449 3441 goto login_logout; ··· 3538 3532 } 3539 3533 3540 3534 if (fcport->scan_state != QLA_FCPORT_FOUND) { 3535 + bool do_delete = false; 3536 + 3537 + if (fcport->scan_needed && 3538 + fcport->disc_state == DSC_LOGIN_PEND) { 3539 + /* Cable got disconnected after we sent 3540 + * a login. Do delete to prevent timeout. 3541 + */ 3542 + fcport->logout_on_delete = 1; 3543 + do_delete = true; 3544 + } 3545 + 3541 3546 fcport->scan_needed = 0; 3542 - if ((qla_dual_mode_enabled(vha) || 3543 - qla_ini_mode_enabled(vha)) && 3544 - atomic_read(&fcport->state) == FCS_ONLINE) { 3547 + if (((qla_dual_mode_enabled(vha) || 3548 + qla_ini_mode_enabled(vha)) && 3549 + atomic_read(&fcport->state) == FCS_ONLINE) || 3550 + do_delete) { 3545 3551 if (fcport->loop_id != FC_NO_LOOP_ID) { 3546 3552 if (fcport->flags & FCF_FCP2_DEVICE) 3547 3553 fcport->logout_on_delete = 0; ··· 3753 3735 if (res) { 3754 3736 unsigned long flags; 3755 3737 const char *name = sp->name; 3738 + 3739 + if (res == QLA_OS_TIMER_EXPIRED) { 3740 + /* switch is ignoring all commands. 3741 + * This might be a zone disable behavior. 3742 + * This means we hit 64s timeout. 3743 + * 22s GPNFT + 44s Abort = 64s 3744 + */ 3745 + ql_dbg(ql_dbg_disc, vha, 0xffff, 3746 + "%s: Switch Zone check please .\n", 3747 + name); 3748 + qla2x00_mark_all_devices_lost(vha); 3749 + } 3756 3750 3757 3751 /* 3758 3752 * We are in an Interrupt context, queue up this
+2 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 2024 2024 res = DID_ERROR << 16; 2025 2025 } 2026 2026 } 2027 - ql_dbg(ql_dbg_user, vha, 0x503f, 2028 - "ELS IOCB Done -%s error hdl=%x comp_status=0x%x error subcode 1=0x%x error subcode 2=0x%x total_byte=0x%x\n", 2027 + ql_dbg(ql_dbg_disc, vha, 0x503f, 2028 + "ELS IOCB Done -%s hdl=%x comp_status=0x%x error subcode 1=0x%x error subcode 2=0x%x total_byte=0x%x\n", 2029 2029 type, sp->handle, comp_status, fw_status[1], fw_status[2], 2030 2030 le32_to_cpu(ese->total_byte_count)); 2031 2031 goto els_ct_done;
+7 -15
drivers/scsi/qla2xxx/qla_mbx.c
··· 334 334 if (time_after(jiffies, wait_time)) 335 335 break; 336 336 337 - /* 338 - * Check if it's UNLOADING, cause we cannot poll in 339 - * this case, or else a NULL pointer dereference 340 - * is triggered. 341 - */ 342 - if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags))) 343 - return QLA_FUNCTION_TIMEOUT; 344 - 345 337 /* Check for pending interrupts. */ 346 338 qla2x00_poll(ha->rsp_q_map[0]); 347 339 ··· 5232 5240 mcp->mb[8] = MSW(risc_addr); 5233 5241 mcp->out_mb = MBX_8|MBX_1|MBX_0; 5234 5242 mcp->in_mb = MBX_3|MBX_2|MBX_0; 5235 - mcp->tov = 30; 5243 + mcp->tov = MBX_TOV_SECONDS; 5236 5244 mcp->flags = 0; 5237 5245 rval = qla2x00_mailbox_command(vha, mcp); 5238 5246 if (rval != QLA_SUCCESS) { ··· 5420 5428 mcp->mb[8] = MSW(risc_addr); 5421 5429 mcp->out_mb = MBX_8|MBX_3|MBX_2|MBX_1|MBX_0; 5422 5430 mcp->in_mb = MBX_1|MBX_0; 5423 - mcp->tov = 30; 5431 + mcp->tov = MBX_TOV_SECONDS; 5424 5432 mcp->flags = 0; 5425 5433 rval = qla2x00_mailbox_command(vha, mcp); 5426 5434 if (rval != QLA_SUCCESS) { ··· 5692 5700 mcp->mb[9] = vha->vp_idx; 5693 5701 mcp->out_mb = MBX_9|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; 5694 5702 mcp->in_mb = MBX_4|MBX_3|MBX_1|MBX_0; 5695 - mcp->tov = 30; 5703 + mcp->tov = MBX_TOV_SECONDS; 5696 5704 mcp->flags = 0; 5697 5705 rval = qla2x00_mailbox_command(vha, mcp); 5698 5706 if (mb != NULL) { ··· 5779 5787 5780 5788 mcp->out_mb = MBX_1|MBX_0; 5781 5789 mcp->in_mb = MBX_0; 5782 - mcp->tov = 30; 5790 + mcp->tov = MBX_TOV_SECONDS; 5783 5791 mcp->flags = 0; 5784 5792 5785 5793 rval = qla2x00_mailbox_command(vha, mcp); ··· 5814 5822 5815 5823 mcp->out_mb = MBX_1|MBX_0; 5816 5824 mcp->in_mb = MBX_0; 5817 - mcp->tov = 30; 5825 + mcp->tov = MBX_TOV_SECONDS; 5818 5826 mcp->flags = 0; 5819 5827 5820 5828 rval = qla2x00_mailbox_command(vha, mcp); ··· 6006 6014 if (IS_QLA8031(ha)) 6007 6015 mcp->out_mb |= MBX_6|MBX_5|MBX_4|MBX_3; 6008 6016 mcp->in_mb = MBX_0; 6009 - mcp->tov = 30; 6017 + mcp->tov = MBX_TOV_SECONDS; 6010 6018 mcp->flags = 0; 6011 6019 6012 6020 rval = qla2x00_mailbox_command(vha, mcp); ··· 6042 6050 mcp->in_mb = MBX_2|MBX_1|MBX_0; 6043 6051 if (IS_QLA8031(ha)) 6044 6052 mcp->in_mb |= MBX_6|MBX_5|MBX_4|MBX_3; 6045 - mcp->tov = 30; 6053 + mcp->tov = MBX_TOV_SECONDS; 6046 6054 mcp->flags = 0; 6047 6055 6048 6056 rval = qla2x00_mailbox_command(vha, mcp);
+14 -1
drivers/scsi/qla2xxx/qla_nvme.c
··· 536 536 struct nvme_private *priv = fd->private; 537 537 struct qla_nvme_rport *qla_rport = rport->private; 538 538 539 + if (!priv) { 540 + /* nvme association has been torn down */ 541 + return rval; 542 + } 543 + 539 544 fcport = qla_rport->fcport; 540 545 541 546 if (!qpair || !fcport || (qpair && !qpair->fw_started) || ··· 692 687 tmpl = &qla_nvme_fc_transport; 693 688 694 689 WARN_ON(vha->nvme_local_port); 695 - WARN_ON(ha->max_req_queues < 3); 690 + 691 + if (ha->max_req_queues < 3) { 692 + if (!ha->flags.max_req_queue_warned) 693 + ql_log(ql_log_info, vha, 0x2120, 694 + "%s: Disabling FC-NVME due to lack of free queue pairs (%d).\n", 695 + __func__, ha->max_req_queues); 696 + ha->flags.max_req_queue_warned = 1; 697 + return ret; 698 + } 696 699 697 700 qla_nvme_fc_transport.max_hw_queues = 698 701 min((uint8_t)(qla_nvme_fc_transport.max_hw_queues),
+5 -4
drivers/scsi/qla2xxx/qla_os.c
··· 2017 2017 /* Determine queue resources */ 2018 2018 ha->max_req_queues = ha->max_rsp_queues = 1; 2019 2019 ha->msix_count = QLA_BASE_VECTORS; 2020 + 2021 + /* Check if FW supports MQ or not */ 2022 + if (!(ha->fw_attributes & BIT_6)) 2023 + goto mqiobase_exit; 2024 + 2020 2025 if (!ql2xmqsupport || !ql2xnvmeenable || 2021 2026 (!IS_QLA25XX(ha) && !IS_QLA81XX(ha))) 2022 2027 goto mqiobase_exit; ··· 2833 2828 2834 2829 /* This may fail but that's ok */ 2835 2830 pci_enable_pcie_error_reporting(pdev); 2836 - 2837 - /* Turn off T10-DIF when FC-NVMe is enabled */ 2838 - if (ql2xnvmeenable) 2839 - ql2xenabledif = 0; 2840 2831 2841 2832 ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL); 2842 2833 if (!ha) {
+1 -1
drivers/scsi/qla2xxx/qla_target.c
··· 1270 1270 1271 1271 qla24xx_chk_fcp_state(sess); 1272 1272 1273 - ql_dbg(ql_dbg_tgt, sess->vha, 0xe001, 1273 + ql_dbg(ql_dbg_disc, sess->vha, 0xe001, 1274 1274 "Scheduling sess %p for deletion %8phC\n", 1275 1275 sess, sess->port_name); 1276 1276
+2
drivers/scsi/scsi_debug.c
··· 5490 5490 u64 d = ktime_get_boottime_ns() - ns_from_boot; 5491 5491 5492 5492 if (kt <= d) { /* elapsed duration >= kt */ 5493 + spin_lock_irqsave(&sqp->qc_lock, iflags); 5493 5494 sqcp->a_cmnd = NULL; 5494 5495 atomic_dec(&devip->num_in_q); 5495 5496 clear_bit(k, sqp->in_use_bm); 5497 + spin_unlock_irqrestore(&sqp->qc_lock, iflags); 5496 5498 if (new_sd_dp) 5497 5499 kfree(sd_dp); 5498 5500 /* call scsi_done() from this thread */
+1
drivers/scsi/ufs/ti-j721e-ufs.c
··· 38 38 /* Select MPHY refclk frequency */ 39 39 clk = devm_clk_get(dev, NULL); 40 40 if (IS_ERR(clk)) { 41 + ret = PTR_ERR(clk); 41 42 dev_err(dev, "Cannot claim MPHY clock.\n"); 42 43 goto clk_err; 43 44 }
+1 -1
drivers/scsi/ufs/ufs-mediatek.c
··· 212 212 ktime_t timeout, time_checked; 213 213 u32 val; 214 214 215 - timeout = ktime_add_us(ktime_get(), ms_to_ktime(max_wait_ms)); 215 + timeout = ktime_add_ms(ktime_get(), max_wait_ms); 216 216 do { 217 217 time_checked = ktime_get(); 218 218 ufshcd_writel(hba, 0x20, REG_UFS_DEBUG_SEL);
+14 -2
drivers/scsi/ufs/ufshcd-pci.c
··· 44 44 return err; 45 45 } 46 46 47 + static int ufs_intel_ehl_init(struct ufs_hba *hba) 48 + { 49 + hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8; 50 + return 0; 51 + } 52 + 47 53 static struct ufs_hba_variant_ops ufs_intel_cnl_hba_vops = { 48 54 .name = "intel-pci", 55 + .link_startup_notify = ufs_intel_link_startup_notify, 56 + }; 57 + 58 + static struct ufs_hba_variant_ops ufs_intel_ehl_hba_vops = { 59 + .name = "intel-pci", 60 + .init = ufs_intel_ehl_init, 49 61 .link_startup_notify = ufs_intel_link_startup_notify, 50 62 }; 51 63 ··· 189 177 static const struct pci_device_id ufshcd_pci_tbl[] = { 190 178 { PCI_VENDOR_ID_SAMSUNG, 0xC00C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 191 179 { PCI_VDEVICE(INTEL, 0x9DFA), (kernel_ulong_t)&ufs_intel_cnl_hba_vops }, 192 - { PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_cnl_hba_vops }, 193 - { PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_cnl_hba_vops }, 180 + { PCI_VDEVICE(INTEL, 0x4B41), (kernel_ulong_t)&ufs_intel_ehl_hba_vops }, 181 + { PCI_VDEVICE(INTEL, 0x4B43), (kernel_ulong_t)&ufs_intel_ehl_hba_vops }, 194 182 { } /* terminate list */ 195 183 }; 196 184
+18 -13
drivers/scsi/ufs/ufshcd.c
··· 1561 1561 int ufshcd_hold(struct ufs_hba *hba, bool async) 1562 1562 { 1563 1563 int rc = 0; 1564 + bool flush_result; 1564 1565 unsigned long flags; 1565 1566 1566 1567 if (!ufshcd_is_clkgating_allowed(hba)) ··· 1593 1592 break; 1594 1593 } 1595 1594 spin_unlock_irqrestore(hba->host->host_lock, flags); 1596 - flush_work(&hba->clk_gating.ungate_work); 1595 + flush_result = flush_work(&hba->clk_gating.ungate_work); 1596 + if (hba->clk_gating.is_suspended && !flush_result) 1597 + goto out; 1597 1598 spin_lock_irqsave(hba->host->host_lock, flags); 1598 1599 goto start; 1599 1600 } ··· 5944 5941 */ 5945 5942 static irqreturn_t ufshcd_intr(int irq, void *__hba) 5946 5943 { 5947 - u32 intr_status, enabled_intr_status; 5944 + u32 intr_status, enabled_intr_status = 0; 5948 5945 irqreturn_t retval = IRQ_NONE; 5949 5946 struct ufs_hba *hba = __hba; 5950 5947 int retries = hba->nutrs; ··· 5958 5955 * read, make sure we handle them by checking the interrupt status 5959 5956 * again in a loop until we process all of the reqs before returning. 5960 5957 */ 5961 - do { 5958 + while (intr_status && retries--) { 5962 5959 enabled_intr_status = 5963 5960 intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE); 5964 5961 if (intr_status) ··· 5967 5964 retval |= ufshcd_sl_intr(hba, enabled_intr_status); 5968 5965 5969 5966 intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS); 5970 - } while (intr_status && --retries); 5967 + } 5971 5968 5972 - if (retval == IRQ_NONE) { 5969 + if (enabled_intr_status && retval == IRQ_NONE) { 5973 5970 dev_err(hba->dev, "%s: Unhandled interrupt 0x%08x\n", 5974 5971 __func__, intr_status); 5975 5972 ufshcd_dump_regs(hba, 0, UFSHCI_REG_SPACE_SIZE, "host_regs: "); ··· 6437 6434 goto out; 6438 6435 } 6439 6436 6440 - if (!(reg & (1 << tag))) { 6441 - dev_err(hba->dev, 6442 - "%s: cmd was completed, but without a notifying intr, tag = %d", 6443 - __func__, tag); 6444 - } 6445 - 6446 6437 /* Print Transfer Request of aborted task */ 6447 - dev_err(hba->dev, "%s: Device abort task at tag %d\n", __func__, tag); 6438 + dev_info(hba->dev, "%s: Device abort task at tag %d\n", __func__, tag); 6448 6439 6449 6440 /* 6450 6441 * Print detailed info about aborted request. ··· 6458 6461 ufshcd_print_trs(hba, 1 << tag, false); 6459 6462 } 6460 6463 hba->req_abort_count++; 6464 + 6465 + if (!(reg & (1 << tag))) { 6466 + dev_err(hba->dev, 6467 + "%s: cmd was completed, but without a notifying intr, tag = %d", 6468 + __func__, tag); 6469 + goto cleanup; 6470 + } 6461 6471 6462 6472 /* Skip task abort in case previous aborts failed and report failure */ 6463 6473 if (lrbp->req_abort_skip) { ··· 6496 6492 /* command completed already */ 6497 6493 dev_err(hba->dev, "%s: cmd at tag %d successfully cleared from DB.\n", 6498 6494 __func__, tag); 6499 - goto out; 6495 + goto cleanup; 6500 6496 } else { 6501 6497 dev_err(hba->dev, 6502 6498 "%s: no response from device. tag = %d, err %d\n", ··· 6530 6526 goto out; 6531 6527 } 6532 6528 6529 + cleanup: 6533 6530 scsi_dma_unmap(cmd); 6534 6531 6535 6532 spin_lock_irqsave(host->host_lock, flags);
+8 -1
drivers/scsi/ufs/ufshcd.h
··· 520 520 * OCS FATAL ERROR with device error through sense data 521 521 */ 522 522 UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR = 1 << 10, 523 + 524 + /* 525 + * This quirk needs to be enabled if the host controller has 526 + * auto-hibernate capability but it doesn't work. 527 + */ 528 + UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8 = 1 << 11, 523 529 }; 524 530 525 531 enum ufshcd_caps { ··· 809 803 810 804 static inline bool ufshcd_is_auto_hibern8_supported(struct ufs_hba *hba) 811 805 { 812 - return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT); 806 + return (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) && 807 + !(hba->quirks & UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8); 813 808 } 814 809 815 810 static inline bool ufshcd_is_auto_hibern8_enabled(struct ufs_hba *hba)