scsi: ufs: pltfrm: Drop PM runtime reference count after ufshcd_remove()
BugLink: https://bugs.launchpad.net/bugs/2102118
commit 1745dcdb7227102e16248a324c600b9121c8f6df upstream.
During the remove stage of glue drivers, some of them are incrementing the
reference count using pm_runtime_get_sync(), before removing the ufshcd
using ufshcd_remove(). But they are not dropping that reference count after
ufshcd_remove() to balance the refcount.
So drop the reference count by calling pm_runtime_put_noidle() after
ufshcd_remove(). Since the behavior is applicable to all glue drivers, move
the PM handling to ufshcd_pltfrm_remove().
Cc: stable@vger.kernel.org # 3.12
Fixes: 62694735ca ("[SCSI] ufs: Add runtime PM support for UFS host controller driver")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20241111-ufs_bug_fix-v1-4-45ad8b62f02e@linaro.org
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
4c1a9c54d9
commit
84b6e9df37
@@ -76,7 +76,6 @@ static int tc_dwc_g210_pltfm_probe(struct platform_device *pdev)
|
||||
*/
|
||||
static void tc_dwc_g210_pltfm_remove(struct platform_device *pdev)
|
||||
{
|
||||
pm_runtime_get_sync(&(pdev)->dev);
|
||||
ufshcd_pltfrm_remove(pdev);
|
||||
}
|
||||
|
||||
|
||||
@@ -1615,7 +1615,6 @@ static void exynos_ufs_remove(struct platform_device *pdev)
|
||||
struct ufs_hba *hba = platform_get_drvdata(pdev);
|
||||
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
|
||||
|
||||
pm_runtime_get_sync(&(pdev)->dev);
|
||||
ufshcd_pltfrm_remove(pdev);
|
||||
|
||||
phy_power_off(ufs->phy);
|
||||
|
||||
@@ -1748,7 +1748,6 @@ out:
|
||||
*/
|
||||
static void ufs_mtk_remove(struct platform_device *pdev)
|
||||
{
|
||||
pm_runtime_get_sync(&(pdev)->dev);
|
||||
ufshcd_pltfrm_remove(pdev);
|
||||
}
|
||||
|
||||
|
||||
@@ -1831,7 +1831,6 @@ static void ufs_qcom_remove(struct platform_device *pdev)
|
||||
struct ufs_hba *hba = platform_get_drvdata(pdev);
|
||||
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
|
||||
|
||||
pm_runtime_get_sync(&(pdev)->dev);
|
||||
ufshcd_pltfrm_remove(pdev);
|
||||
if (host->esi_enabled)
|
||||
platform_msi_domain_free_irqs(hba->dev);
|
||||
|
||||
@@ -427,7 +427,6 @@ static int ufs_sprd_probe(struct platform_device *pdev)
|
||||
|
||||
static void ufs_sprd_remove(struct platform_device *pdev)
|
||||
{
|
||||
pm_runtime_get_sync(&(pdev)->dev);
|
||||
ufshcd_pltfrm_remove(pdev);
|
||||
}
|
||||
|
||||
|
||||
@@ -536,8 +536,10 @@ void ufshcd_pltfrm_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ufs_hba *hba = platform_get_drvdata(pdev);
|
||||
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
ufshcd_remove(hba);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ufshcd_pltfrm_remove);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user