]> Git Repo - J-linux.git/commitdiff
scsi: ufs: pltfrm: Drop PM runtime reference count after ufshcd_remove()
authorManivannan Sadhasivam <[email protected]>
Mon, 11 Nov 2024 17:48:33 +0000 (23:18 +0530)
committerMartin K. Petersen <[email protected]>
Thu, 21 Nov 2024 03:03:05 +0000 (22:03 -0500)
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: [email protected] # 3.12
Fixes: 62694735ca95 ("[SCSI] ufs: Add runtime PM support for UFS host controller driver")
Signed-off-by: Manivannan Sadhasivam <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Peter Wang <[email protected]>
Reviewed-by: Bean Huo <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/ufs/host/tc-dwc-g210-pltfrm.c
drivers/ufs/host/ufs-exynos.c
drivers/ufs/host/ufs-mediatek.c
drivers/ufs/host/ufs-qcom.c
drivers/ufs/host/ufs-sprd.c
drivers/ufs/host/ufshcd-pltfrm.c

index 113e0ef7b2cf84d212ae3bff0181aee9db6926a3..c6f8565ede21a1872899d84bff15ee1212897e5b 100644 (file)
@@ -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);
 }
 
index b20f6526777a7f215ccca1dc557e6396151c9a93..9d4db13e142d51dafd2aed1fef5acc85c2816d1f 100644 (file)
@@ -1992,7 +1992,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);
index b444146419dea87ba1b79b46870eb7f8fa7cbc45..ffe4d03a0f3833ca5332c21e017a7725f6616688 100644 (file)
@@ -1879,7 +1879,6 @@ out:
  */
 static void ufs_mtk_remove(struct platform_device *pdev)
 {
-       pm_runtime_get_sync(&(pdev)->dev);
        ufshcd_pltfrm_remove(pdev);
 }
 
index 3762337d75765f342788fa71ffa15c5c9127b0c7..73b4fec8221a049d58501fb6e51e084e51f0a176 100644 (file)
@@ -1863,7 +1863,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_device_msi_free_irqs_all(hba->dev);
index e455890cf7d49e3e49ffb2e4c7f840c62d7d7e2c..d220978c2d8c8ac83c5c5be9e143ee141c9fc9fe 100644 (file)
@@ -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);
 }
 
index bad5b1303eb685ce9d7ae36609104ff0b859fb79..b8dadd0a2f4c0010bceec9c6eaf595c015b4b107 100644 (file)
@@ -532,8 +532,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);
 
This page took 0.059104 seconds and 4 git commands to generate.