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 branch 7.0/scsi-fixes into 7.1/scsi-staging

Pull in fixes to resolve mpi3mr merge conflict.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+170 -80
+1
MAINTAINERS
··· 6213 6213 6214 6214 CISCO SCSI HBA DRIVER 6215 6215 M: Karan Tilak Kumar <kartilak@cisco.com> 6216 + M: Narsimhulu Musini <nmusini@cisco.com> 6216 6217 M: Sesidhar Baddela <sebaddel@cisco.com> 6217 6218 L: linux-scsi@vger.kernel.org 6218 6219 S: Supported
+1 -1
drivers/scsi/hisi_sas/hisi_sas_main.c
··· 2578 2578 shost->transportt = hisi_sas_stt; 2579 2579 shost->max_id = HISI_SAS_MAX_DEVICES; 2580 2580 shost->max_lun = ~0; 2581 - shost->max_channel = 1; 2581 + shost->max_channel = 0; 2582 2582 shost->max_cmd_len = HISI_SAS_MAX_CDB_LEN; 2583 2583 if (hisi_hba->hw->slot_index_alloc) { 2584 2584 shost->can_queue = HISI_SAS_MAX_COMMANDS;
+1 -1
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
··· 4993 4993 shost->transportt = hisi_sas_stt; 4994 4994 shost->max_id = HISI_SAS_MAX_DEVICES; 4995 4995 shost->max_lun = ~0; 4996 - shost->max_channel = 1; 4996 + shost->max_channel = 0; 4997 4997 shost->max_cmd_len = HISI_SAS_MAX_CDB_LEN; 4998 4998 shost->can_queue = HISI_SAS_UNRESERVED_IPTT; 4999 4999 shost->cmd_per_lun = HISI_SAS_UNRESERVED_IPTT;
+2 -1
drivers/scsi/ibmvscsi/ibmvfc.c
··· 4966 4966 switch (mad_status) { 4967 4967 case IBMVFC_MAD_SUCCESS: 4968 4968 ibmvfc_dbg(vhost, "Discover Targets succeeded\n"); 4969 - vhost->num_targets = be32_to_cpu(rsp->num_written); 4969 + vhost->num_targets = min_t(u32, be32_to_cpu(rsp->num_written), 4970 + max_targets); 4970 4971 ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_ALLOC_TGTS); 4971 4972 break; 4972 4973 case IBMVFC_MAD_FAILED:
+2
drivers/scsi/lpfc/lpfc_init.c
··· 12023 12023 iounmap(phba->sli4_hba.conf_regs_memmap_p); 12024 12024 if (phba->sli4_hba.dpp_regs_memmap_p) 12025 12025 iounmap(phba->sli4_hba.dpp_regs_memmap_p); 12026 + if (phba->sli4_hba.dpp_regs_memmap_wc_p) 12027 + iounmap(phba->sli4_hba.dpp_regs_memmap_wc_p); 12026 12028 break; 12027 12029 case LPFC_SLI_INTF_IF_TYPE_1: 12028 12030 break;
+30 -6
drivers/scsi/lpfc/lpfc_sli.c
··· 15970 15970 return NULL; 15971 15971 } 15972 15972 15973 + static __maybe_unused void __iomem * 15974 + lpfc_dpp_wc_map(struct lpfc_hba *phba, uint8_t dpp_barset) 15975 + { 15976 + 15977 + /* DPP region is supposed to cover 64-bit BAR2 */ 15978 + if (dpp_barset != WQ_PCI_BAR_4_AND_5) { 15979 + lpfc_log_msg(phba, KERN_WARNING, LOG_INIT, 15980 + "3273 dpp_barset x%x != WQ_PCI_BAR_4_AND_5\n", 15981 + dpp_barset); 15982 + return NULL; 15983 + } 15984 + 15985 + if (!phba->sli4_hba.dpp_regs_memmap_wc_p) { 15986 + void __iomem *dpp_map; 15987 + 15988 + dpp_map = ioremap_wc(phba->pci_bar2_map, 15989 + pci_resource_len(phba->pcidev, 15990 + PCI_64BIT_BAR4)); 15991 + 15992 + if (dpp_map) 15993 + phba->sli4_hba.dpp_regs_memmap_wc_p = dpp_map; 15994 + } 15995 + 15996 + return phba->sli4_hba.dpp_regs_memmap_wc_p; 15997 + } 15998 + 15973 15999 /** 15974 16000 * lpfc_modify_hba_eq_delay - Modify Delay Multiplier on EQs 15975 16001 * @phba: HBA structure that EQs are on. ··· 16959 16933 uint8_t dpp_barset; 16960 16934 uint32_t dpp_offset; 16961 16935 uint8_t wq_create_version; 16962 - #ifdef CONFIG_X86 16963 - unsigned long pg_addr; 16964 - #endif 16965 16936 16966 16937 /* sanity check on queue memory */ 16967 16938 if (!wq || !cq) ··· 17144 17121 17145 17122 #ifdef CONFIG_X86 17146 17123 /* Enable combined writes for DPP aperture */ 17147 - pg_addr = (unsigned long)(wq->dpp_regaddr) & PAGE_MASK; 17148 - rc = set_memory_wc(pg_addr, 1); 17149 - if (rc) { 17124 + bar_memmap_p = lpfc_dpp_wc_map(phba, dpp_barset); 17125 + if (!bar_memmap_p) { 17150 17126 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 17151 17127 "3272 Cannot setup Combined " 17152 17128 "Write on WQ[%d] - disable DPP\n", 17153 17129 wq->queue_id); 17154 17130 phba->cfg_enable_dpp = 0; 17131 + } else { 17132 + wq->dpp_regaddr = bar_memmap_p + dpp_offset; 17155 17133 } 17156 17134 #else 17157 17135 phba->cfg_enable_dpp = 0;
+3
drivers/scsi/lpfc/lpfc_sli4.h
··· 788 788 void __iomem *dpp_regs_memmap_p; /* Kernel memory mapped address for 789 789 * dpp registers 790 790 */ 791 + void __iomem *dpp_regs_memmap_wc_p;/* Kernel memory mapped address for 792 + * dpp registers with write combining 793 + */ 791 794 union { 792 795 struct { 793 796 /* IF Type 0, BAR 0 PCI cfg space reg mem map */
+29 -15
drivers/scsi/mpi3mr/mpi3mr_fw.c
··· 1619 1619 ioc_info(mrioc, 1620 1620 "successfully transitioned to %s state\n", 1621 1621 mpi3mr_iocstate_name(ioc_state)); 1622 + mpi3mr_clear_reset_history(mrioc); 1622 1623 return 0; 1623 1624 } 1624 1625 ioc_status = readl(&mrioc->sysif_regs->ioc_status); ··· 1638 1637 msleep(100); 1639 1638 elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000; 1640 1639 } while (elapsed_time_sec < mrioc->ready_timeout); 1640 + 1641 + ioc_state = mpi3mr_get_iocstate(mrioc); 1642 + if (ioc_state == MRIOC_STATE_READY) { 1643 + ioc_info(mrioc, 1644 + "successfully transitioned to %s state after %llu seconds\n", 1645 + mpi3mr_iocstate_name(ioc_state), elapsed_time_sec); 1646 + mpi3mr_clear_reset_history(mrioc); 1647 + return 0; 1648 + } 1641 1649 1642 1650 out_failed: 1643 1651 elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000; ··· 4838 4828 } 4839 4829 4840 4830 for (i = 0; i < mrioc->num_queues; i++) { 4841 - mrioc->op_reply_qinfo[i].qid = 0; 4842 - mrioc->op_reply_qinfo[i].ci = 0; 4843 - mrioc->op_reply_qinfo[i].num_replies = 0; 4844 - mrioc->op_reply_qinfo[i].ephase = 0; 4845 - atomic_set(&mrioc->op_reply_qinfo[i].pend_ios, 0); 4846 - atomic_set(&mrioc->op_reply_qinfo[i].in_use, 0); 4847 - mpi3mr_memset_op_reply_q_buffers(mrioc, i); 4831 + if (mrioc->op_reply_qinfo) { 4832 + mrioc->op_reply_qinfo[i].qid = 0; 4833 + mrioc->op_reply_qinfo[i].ci = 0; 4834 + mrioc->op_reply_qinfo[i].num_replies = 0; 4835 + mrioc->op_reply_qinfo[i].ephase = 0; 4836 + atomic_set(&mrioc->op_reply_qinfo[i].pend_ios, 0); 4837 + atomic_set(&mrioc->op_reply_qinfo[i].in_use, 0); 4838 + mpi3mr_memset_op_reply_q_buffers(mrioc, i); 4839 + } 4848 4840 4849 - mrioc->req_qinfo[i].ci = 0; 4850 - mrioc->req_qinfo[i].pi = 0; 4851 - mrioc->req_qinfo[i].num_requests = 0; 4852 - mrioc->req_qinfo[i].qid = 0; 4853 - mrioc->req_qinfo[i].reply_qid = 0; 4854 - spin_lock_init(&mrioc->req_qinfo[i].q_lock); 4855 - mrioc->req_qinfo[i].last_full_host_tag = 0; 4856 - mpi3mr_memset_op_req_q_buffers(mrioc, i); 4841 + if (mrioc->req_qinfo) { 4842 + mrioc->req_qinfo[i].ci = 0; 4843 + mrioc->req_qinfo[i].pi = 0; 4844 + mrioc->req_qinfo[i].num_requests = 0; 4845 + mrioc->req_qinfo[i].qid = 0; 4846 + mrioc->req_qinfo[i].reply_qid = 0; 4847 + spin_lock_init(&mrioc->req_qinfo[i].q_lock); 4848 + mrioc->req_qinfo[i].last_full_host_tag = 0; 4849 + mpi3mr_memset_op_req_q_buffers(mrioc, i); 4850 + } 4857 4851 } 4858 4852 4859 4853 atomic_set(&mrioc->pend_large_data_sz, 0);
+3 -2
drivers/scsi/pm8001/pm8001_sas.c
··· 525 525 } else { 526 526 task->task_done(task); 527 527 } 528 - rc = -ENODEV; 529 - goto err_out; 528 + spin_unlock_irqrestore(&pm8001_ha->lock, flags); 529 + pm8001_dbg(pm8001_ha, IO, "pm8001_task_exec device gone\n"); 530 + return 0; 530 531 } 531 532 532 533 ccb = pm8001_ccb_alloc(pm8001_ha, pm8001_dev, task);
-2
drivers/scsi/qla2xxx/qla_iocb.c
··· 2751 2751 if (!elsio->u.els_logo.els_logo_pyld) { 2752 2752 /* ref: INIT */ 2753 2753 kref_put(&sp->cmd_kref, qla2x00_sp_release); 2754 - qla2x00_free_fcport(fcport); 2755 2754 return QLA_FUNCTION_FAILED; 2756 2755 } 2757 2756 ··· 2775 2776 if (rval != QLA_SUCCESS) { 2776 2777 /* ref: INIT */ 2777 2778 kref_put(&sp->cmd_kref, qla2x00_sp_release); 2778 - qla2x00_free_fcport(fcport); 2779 2779 return QLA_FUNCTION_FAILED; 2780 2780 } 2781 2781
+1 -1
drivers/scsi/scsi_devinfo.c
··· 190 190 {"IBM", "2076", NULL, BLIST_NO_VPD_SIZE}, 191 191 {"IBM", "2105", NULL, BLIST_RETRY_HWERROR}, 192 192 {"iomega", "jaz 1GB", "J.86", BLIST_NOTQ | BLIST_NOLUN}, 193 - {"IOMEGA", "ZIP", NULL, BLIST_NOTQ | BLIST_NOLUN}, 193 + {"IOMEGA", "ZIP", NULL, BLIST_NOTQ | BLIST_NOLUN | BLIST_SKIP_IO_HINTS}, 194 194 {"IOMEGA", "Io20S *F", NULL, BLIST_KEY}, 195 195 {"INSITE", "Floptical F*8I", NULL, BLIST_KEY}, 196 196 {"INSITE", "I325VM", NULL, BLIST_KEY},
+2 -5
drivers/scsi/scsi_scan.c
··· 360 360 * default device queue depth to figure out sbitmap shift 361 361 * since we use this queue depth most of times. 362 362 */ 363 - if (scsi_realloc_sdev_budget_map(sdev, depth)) { 364 - put_device(&starget->dev); 365 - kfree(sdev); 366 - goto out; 367 - } 363 + if (scsi_realloc_sdev_budget_map(sdev, depth)) 364 + goto out_device_destroy; 368 365 369 366 scsi_change_queue_depth(sdev, depth); 370 367
+1 -1
drivers/scsi/scsi_transport_sas.c
··· 1734 1734 break; 1735 1735 1736 1736 default: 1737 - if (channel < shost->max_channel) { 1737 + if (channel <= shost->max_channel) { 1738 1738 res = scsi_scan_host_selected(shost, channel, id, lun, 1739 1739 SCSI_SCAN_MANUAL); 1740 1740 } else {
+3 -4
drivers/scsi/ses.c
··· 215 215 unsigned char *type_ptr = ses_dev->page1_types; 216 216 unsigned char *desc_ptr = ses_dev->page2 + 8; 217 217 218 - if (ses_recv_diag(sdev, 2, ses_dev->page2, ses_dev->page2_len) < 0) 218 + if (ses_recv_diag(sdev, 2, ses_dev->page2, ses_dev->page2_len)) 219 219 return NULL; 220 220 221 221 for (i = 0; i < ses_dev->page1_num_types; i++, type_ptr += 4) { ··· 528 528 }; 529 529 530 530 static int ses_enclosure_find_by_addr(struct enclosure_device *edev, 531 - void *data) 531 + struct efd *efd) 532 532 { 533 - struct efd *efd = data; 534 533 int i; 535 534 struct ses_component *scomp; 536 535 ··· 682 683 if (efd.addr) { 683 684 efd.dev = &sdev->sdev_gendev; 684 685 685 - enclosure_for_each_device(ses_enclosure_find_by_addr, &efd); 686 + ses_enclosure_find_by_addr(edev, &efd); 686 687 } 687 688 } 688 689
-9
drivers/scsi/snic/vnic_dev.c
··· 42 42 struct vnic_devcmd_notify *notify; 43 43 struct vnic_devcmd_notify notify_copy; 44 44 dma_addr_t notify_pa; 45 - u32 *linkstatus; 46 - dma_addr_t linkstatus_pa; 47 45 struct vnic_stats *stats; 48 46 dma_addr_t stats_pa; 49 47 struct vnic_devcmd_fw_info *fw_info; ··· 648 650 649 651 int svnic_dev_link_status(struct vnic_dev *vdev) 650 652 { 651 - if (vdev->linkstatus) 652 - return *vdev->linkstatus; 653 653 654 654 if (!vnic_dev_notify_ready(vdev)) 655 655 return 0; ··· 682 686 sizeof(struct vnic_devcmd_notify), 683 687 vdev->notify, 684 688 vdev->notify_pa); 685 - if (vdev->linkstatus) 686 - dma_free_coherent(&vdev->pdev->dev, 687 - sizeof(u32), 688 - vdev->linkstatus, 689 - vdev->linkstatus_pa); 690 689 if (vdev->stats) 691 690 dma_free_coherent(&vdev->pdev->dev, 692 691 sizeof(struct vnic_stats),
+3 -2
drivers/scsi/storvsc_drv.c
··· 1856 1856 cmd_request->payload_sz = payload_sz; 1857 1857 1858 1858 /* Invokes the vsc to start an IO */ 1859 - ret = storvsc_do_io(dev, cmd_request, get_cpu()); 1860 - put_cpu(); 1859 + migrate_disable(); 1860 + ret = storvsc_do_io(dev, cmd_request, smp_processor_id()); 1861 + migrate_enable(); 1861 1862 1862 1863 if (ret) 1863 1864 scsi_dma_unmap(scmnd);
+46 -6
drivers/target/loopback/tcm_loop.c
··· 26 26 #include <linux/slab.h> 27 27 #include <linux/types.h> 28 28 #include <linux/configfs.h> 29 + #include <linux/blk-mq.h> 29 30 #include <scsi/scsi.h> 30 31 #include <scsi/scsi_tcq.h> 31 32 #include <scsi/scsi_host.h> ··· 270 269 return (ret == TMR_FUNCTION_COMPLETE) ? SUCCESS : FAILED; 271 270 } 272 271 272 + static bool tcm_loop_flush_work_iter(struct request *rq, void *data) 273 + { 274 + struct scsi_cmnd *sc = blk_mq_rq_to_pdu(rq); 275 + struct tcm_loop_cmd *tl_cmd = scsi_cmd_priv(sc); 276 + struct se_cmd *se_cmd = &tl_cmd->tl_se_cmd; 277 + 278 + flush_work(&se_cmd->work); 279 + return true; 280 + } 281 + 273 282 static int tcm_loop_target_reset(struct scsi_cmnd *sc) 274 283 { 275 284 struct tcm_loop_hba *tl_hba; 276 285 struct tcm_loop_tpg *tl_tpg; 286 + struct Scsi_Host *sh = sc->device->host; 287 + int ret; 277 288 278 289 /* 279 290 * Locate the tcm_loop_hba_t pointer 280 291 */ 281 - tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host); 292 + tl_hba = *(struct tcm_loop_hba **)shost_priv(sh); 282 293 if (!tl_hba) { 283 294 pr_err("Unable to perform device reset without active I_T Nexus\n"); 284 295 return FAILED; ··· 299 286 * Locate the tl_tpg pointer from TargetID in sc->device->id 300 287 */ 301 288 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; 302 - if (tl_tpg) { 303 - tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; 304 - return SUCCESS; 305 - } 306 - return FAILED; 289 + if (!tl_tpg) 290 + return FAILED; 291 + 292 + /* 293 + * Issue a LUN_RESET to drain all commands that the target core 294 + * knows about. This handles commands not yet marked CMD_T_COMPLETE. 295 + */ 296 + ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, 0, TMR_LUN_RESET); 297 + if (ret != TMR_FUNCTION_COMPLETE) 298 + return FAILED; 299 + 300 + /* 301 + * Flush any deferred target core completion work that may still be 302 + * queued. Commands that already had CMD_T_COMPLETE set before the TMR 303 + * are skipped by the TMR drain, but their async completion work 304 + * (transport_lun_remove_cmd → percpu_ref_put, release_cmd → scsi_done) 305 + * may still be pending in target_completion_wq. 306 + * 307 + * The SCSI EH will reuse in-flight scsi_cmnd structures for recovery 308 + * commands (e.g. TUR) immediately after this handler returns SUCCESS — 309 + * if deferred work is still pending, the memset in queuecommand would 310 + * zero the se_cmd while the work accesses it, leaking the LUN 311 + * percpu_ref and hanging configfs unlink forever. 312 + * 313 + * Use blk_mq_tagset_busy_iter() to find all started requests and 314 + * flush_work() on each — the same pattern used by mpi3mr, scsi_debug, 315 + * and other SCSI drivers to drain outstanding commands during reset. 316 + */ 317 + blk_mq_tagset_busy_iter(&sh->tag_set, tcm_loop_flush_work_iter, NULL); 318 + 319 + tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; 320 + return SUCCESS; 307 321 } 308 322 309 323 static const struct scsi_host_template tcm_loop_driver_template = {
+6 -9
drivers/target/target_core_configfs.c
··· 108 108 const char *page, size_t count) 109 109 { 110 110 ssize_t read_bytes; 111 - struct file *fp; 112 111 ssize_t r = -EINVAL; 112 + struct path path = {}; 113 113 114 114 mutex_lock(&target_devices_lock); 115 115 if (target_devices) { ··· 131 131 db_root_stage[read_bytes - 1] = '\0'; 132 132 133 133 /* validate new db root before accepting it */ 134 - fp = filp_open(db_root_stage, O_RDONLY, 0); 135 - if (IS_ERR(fp)) { 134 + r = kern_path(db_root_stage, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path); 135 + if (r) { 136 136 pr_err("db_root: cannot open: %s\n", db_root_stage); 137 + if (r == -ENOTDIR) 138 + pr_err("db_root: not a directory: %s\n", db_root_stage); 137 139 goto unlock; 138 140 } 139 - if (!S_ISDIR(file_inode(fp)->i_mode)) { 140 - filp_close(fp, NULL); 141 - pr_err("db_root: not a directory: %s\n", db_root_stage); 142 - goto unlock; 143 - } 144 - filp_close(fp, NULL); 141 + path_put(&path); 145 142 146 143 strscpy(db_root, db_root_stage); 147 144 pr_debug("Target_Core_ConfigFS: db_root set to %s\n", db_root);
+1 -1
drivers/target/target_core_file.c
··· 276 276 ssize_t len = 0; 277 277 int ret = 0, i; 278 278 279 - aio_cmd = kmalloc_flex(*aio_cmd, bvecs, sgl_nents); 279 + aio_cmd = kzalloc_flex(*aio_cmd, bvecs, sgl_nents); 280 280 if (!aio_cmd) 281 281 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 282 282
+35 -14
drivers/ufs/core/ufshcd.c
··· 24 24 #include <linux/pm_opp.h> 25 25 #include <linux/regulator/consumer.h> 26 26 #include <linux/sched/clock.h> 27 + #include <linux/sizes.h> 27 28 #include <linux/iopoll.h> 28 29 #include <scsi/scsi_cmnd.h> 29 30 #include <scsi/scsi_dbg.h> ··· 514 513 515 514 if (hba->mcq_enabled) { 516 515 struct ufs_hw_queue *hwq = ufshcd_mcq_req_to_hwq(hba, rq); 517 - 518 - hwq_id = hwq->id; 516 + if (hwq) 517 + hwq_id = hwq->id; 519 518 } else { 520 519 doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); 521 520 } ··· 4434 4433 spin_unlock_irqrestore(hba->host->host_lock, flags); 4435 4434 mutex_unlock(&hba->uic_cmd_mutex); 4436 4435 4437 - /* 4438 - * If the h8 exit fails during the runtime resume process, it becomes 4439 - * stuck and cannot be recovered through the error handler. To fix 4440 - * this, use link recovery instead of the error handler. 4441 - */ 4442 - if (ret && hba->pm_op_in_progress) 4443 - ret = ufshcd_link_recovery(hba); 4444 - 4445 4436 return ret; 4446 4437 } 4447 4438 ··· 5365 5372 hba->dev_info.rpmb_region_size[1] = desc_buf[RPMB_UNIT_DESC_PARAM_REGION1_SIZE]; 5366 5373 hba->dev_info.rpmb_region_size[2] = desc_buf[RPMB_UNIT_DESC_PARAM_REGION2_SIZE]; 5367 5374 hba->dev_info.rpmb_region_size[3] = desc_buf[RPMB_UNIT_DESC_PARAM_REGION3_SIZE]; 5375 + 5376 + if (hba->dev_info.wspecversion <= 0x0220) { 5377 + /* 5378 + * These older spec chips have only one RPMB region, 5379 + * sized between 128 kB minimum and 16 MB maximum. 5380 + * No per region size fields are provided (respective 5381 + * REGIONX_SIZE fields always contain zeros), so get 5382 + * it from the logical block count and size fields for 5383 + * compatibility 5384 + * 5385 + * (See JESD220C-2_2 Section 14.1.4.6 5386 + * RPMB Unit Descriptor,* offset 13h, 4 bytes) 5387 + */ 5388 + hba->dev_info.rpmb_region_size[0] = 5389 + (get_unaligned_be64(desc_buf 5390 + + RPMB_UNIT_DESC_PARAM_LOGICAL_BLK_COUNT) 5391 + << desc_buf[RPMB_UNIT_DESC_PARAM_LOGICAL_BLK_SIZE]) 5392 + / SZ_128K; 5393 + } 5368 5394 } 5369 5395 5370 5396 ··· 6101 6089 6102 6090 hba->auto_bkops_enabled = false; 6103 6091 trace_ufshcd_auto_bkops_state(hba, "Disabled"); 6092 + hba->urgent_bkops_lvl = BKOPS_STATUS_PERF_IMPACT; 6104 6093 hba->is_urgent_bkops_lvl_checked = false; 6105 6094 out: 6106 6095 return err; ··· 6205 6192 * impacted or critical. Handle these device by determining their urgent 6206 6193 * bkops status at runtime. 6207 6194 */ 6208 - if (curr_status < BKOPS_STATUS_PERF_IMPACT) { 6195 + if ((curr_status > BKOPS_STATUS_NO_OP) && (curr_status < BKOPS_STATUS_PERF_IMPACT)) { 6209 6196 dev_err(hba->dev, "%s: device raised urgent BKOPS exception for bkops status %d\n", 6210 6197 __func__, curr_status); 6211 6198 /* update the current status as the urgent bkops level */ ··· 7247 7234 7248 7235 ret = ufshcd_vops_get_outstanding_cqs(hba, &outstanding_cqs); 7249 7236 if (ret) 7250 - outstanding_cqs = (1U << hba->nr_hw_queues) - 1; 7237 + outstanding_cqs = (1ULL << hba->nr_hw_queues) - 1; 7251 7238 7252 7239 /* Exclude the poll queues */ 7253 7240 nr_queues = hba->nr_hw_queues - hba->nr_queues[HCTX_TYPE_POLL]; ··· 10239 10226 } 10240 10227 10241 10228 flush_work(&hba->eeh_work); 10229 + cancel_delayed_work_sync(&hba->ufs_rtc_update_work); 10242 10230 10243 10231 ret = ufshcd_vops_suspend(hba, pm_op, PRE_CHANGE); 10244 10232 if (ret) ··· 10294 10280 if (ret) 10295 10281 goto set_link_active; 10296 10282 10297 - cancel_delayed_work_sync(&hba->ufs_rtc_update_work); 10298 10283 goto out; 10299 10284 10300 10285 set_link_active: ··· 10365 10352 } else { 10366 10353 dev_err(hba->dev, "%s: hibern8 exit failed %d\n", 10367 10354 __func__, ret); 10368 - goto vendor_suspend; 10355 + /* 10356 + * If the h8 exit fails during the runtime resume 10357 + * process, it becomes stuck and cannot be recovered 10358 + * through the error handler. To fix this, use link 10359 + * recovery instead of the error handler. 10360 + */ 10361 + ret = ufshcd_link_recovery(hba); 10362 + if (ret) 10363 + goto vendor_suspend; 10369 10364 } 10370 10365 } else if (ufshcd_is_link_off(hba)) { 10371 10366 /*