linux/drivers/scsi/ufs
Stanley Chu 24e2e7a19f scsi: ufs: Avoid runtime suspend possibly being blocked forever
UFS runtime suspend can be triggered after pm_runtime_enable() is invoked
in ufshcd_pltfrm_init(). However if the first runtime suspend is triggered
before binding ufs_hba structure to ufs device structure via
platform_set_drvdata(), then UFS runtime suspend will be no longer
triggered in the future because its dev->power.runtime_error was set in the
first triggering and does not have any chance to be cleared.

To be more clear, dev->power.runtime_error is set if hba is NULL in
ufshcd_runtime_suspend() which returns -EINVAL to rpm_callback() where
dev->power.runtime_error is set as -EINVAL. In this case, any future
rpm_suspend() for UFS device fails because rpm_check_suspend_allowed()
fails due to non-zero
dev->power.runtime_error.

To resolve this issue, make sure the first UFS runtime suspend get valid
"hba" in ufshcd_runtime_suspend(): Enable UFS runtime PM only after hba is
successfully bound to UFS device structure.

Fixes: 62694735ca ([SCSI] ufs: Add runtime PM support for UFS host controller driver)
Cc: stable@vger.kernel.org
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-06-18 22:50:25 -04:00
..
cdns-pltfrm.c scsi: ufs-cdns: Add support for UFSHCI with M31 PHY 2019-04-03 23:45:59 -04:00
Kconfig scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips 2019-03-19 16:56:21 -04:00
Makefile scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips 2019-03-19 16:56:21 -04:00
tc-dwc-g210-pci.c scsi: ufs: Fix kernel-doc errors and warnings 2018-03-01 21:00:23 -05:00
tc-dwc-g210-pltfrm.c scsi: ufs: Fix kernel-doc errors and warnings 2018-03-01 21:00:23 -05:00
tc-dwc-g210.c scsi: ufs: tc-dwc-g210: make arrays static, reduces object code size 2017-09-15 15:41:45 -04:00
tc-dwc-g210.h
ufs_bsg.c scsi: ufs-bsg: Allow reading descriptors 2019-02-27 09:00:02 -05:00
ufs_bsg.h scsi: ufs: Add a bsg endpoint that supports UPIUs 2018-10-10 23:09:46 -04:00
ufs_quirks.h scsi: ufs: Remove unused device quirks 2019-02-27 08:54:57 -05:00
ufs-hisi.c scsi: ufs-hisi: Re-factor ufshcd_get_pwr_dev_param 2019-03-19 16:56:21 -04:00
ufs-hisi.h scsi: ufs: Add HI3670 SoC UFS driver support 2019-02-19 18:58:34 -05:00
ufs-mediatek.c scsi: ufs-mediatek: Add missing MODULE_* information 2019-03-25 22:09:42 -04:00
ufs-mediatek.h scsi: ufs-mediatek: Add UFS support for Mediatek SoC chips 2019-03-19 16:56:21 -04:00
ufs-qcom.c scsi: ufs-qcom: Re-factor ufshcd_get_pwr_dev_param 2019-03-19 16:56:21 -04:00
ufs-qcom.h scsi/ufs: qcom: Remove ufs_qcom_phy_*() calls from host 2018-09-26 13:09:37 +05:30
ufs-sysfs.c scsi: ufs: Add support for Auto-Hibernate Idle Timer 2018-03-21 21:21:25 -04:00
ufs-sysfs.h scsi: ufs: sysfs: attributes 2018-02-15 18:35:05 -05:00
ufs.h scsi: ufs: Remove unused min_uA field in struct ufs_vreg 2019-04-03 23:11:35 -04:00
ufshcd-dwc.c scsi: ufs: fix a typo in comment 2019-02-12 22:03:11 -05:00
ufshcd-dwc.h
ufshcd-pci.c scsi: ufs: Fix kernel-doc errors and warnings 2018-03-01 21:00:23 -05:00
ufshcd-pltfrm.c scsi: ufs: Avoid runtime suspend possibly being blocked forever 2019-06-18 22:50:25 -04:00
ufshcd-pltfrm.h scsi: ufs: Introduce ufshcd_get_pwr_dev_param 2019-03-19 16:56:20 -04:00
ufshcd.c scsi: ufs: Check that space was properly alloced in copy_query_response 2019-06-04 22:11:01 -04:00
ufshcd.h scsi: ufs: hisi: fix ufs_hba_variant_ops passing 2019-03-06 19:26:45 -05:00
ufshci-dwc.h
ufshci.h scsi: ufs: cleanup struct utp_task_req_desc 2018-10-10 23:09:46 -04:00
unipro.h scsi: ufs: Fix RX_TERMINATION_FORCE_ENABLE define value 2019-04-29 08:34:10 -04:00