Skip to content

Commit 1745dcd

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
scsi: ufs: pltfrm: Drop PM runtime reference count after ufshcd_remove()
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: 6269473 ("[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]>
1 parent d3326e6 commit 1745dcd

File tree

6 files changed

+2
-5
lines changed

6 files changed

+2
-5
lines changed

drivers/ufs/host/tc-dwc-g210-pltfrm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ static int tc_dwc_g210_pltfm_probe(struct platform_device *pdev)
7676
*/
7777
static void tc_dwc_g210_pltfm_remove(struct platform_device *pdev)
7878
{
79-
pm_runtime_get_sync(&(pdev)->dev);
8079
ufshcd_pltfrm_remove(pdev);
8180
}
8281

drivers/ufs/host/ufs-exynos.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,6 @@ static void exynos_ufs_remove(struct platform_device *pdev)
19921992
struct ufs_hba *hba = platform_get_drvdata(pdev);
19931993
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
19941994

1995-
pm_runtime_get_sync(&(pdev)->dev);
19961995
ufshcd_pltfrm_remove(pdev);
19971996

19981997
phy_power_off(ufs->phy);

drivers/ufs/host/ufs-mediatek.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,6 @@ static int ufs_mtk_probe(struct platform_device *pdev)
18791879
*/
18801880
static void ufs_mtk_remove(struct platform_device *pdev)
18811881
{
1882-
pm_runtime_get_sync(&(pdev)->dev);
18831882
ufshcd_pltfrm_remove(pdev);
18841883
}
18851884

drivers/ufs/host/ufs-qcom.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,6 @@ static void ufs_qcom_remove(struct platform_device *pdev)
18631863
struct ufs_hba *hba = platform_get_drvdata(pdev);
18641864
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
18651865

1866-
pm_runtime_get_sync(&(pdev)->dev);
18671866
ufshcd_pltfrm_remove(pdev);
18681867
if (host->esi_enabled)
18691868
platform_device_msi_free_irqs_all(hba->dev);

drivers/ufs/host/ufs-sprd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ static int ufs_sprd_probe(struct platform_device *pdev)
427427

428428
static void ufs_sprd_remove(struct platform_device *pdev)
429429
{
430-
pm_runtime_get_sync(&(pdev)->dev);
431430
ufshcd_pltfrm_remove(pdev);
432431
}
433432

drivers/ufs/host/ufshcd-pltfrm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,10 @@ void ufshcd_pltfrm_remove(struct platform_device *pdev)
532532
{
533533
struct ufs_hba *hba = platform_get_drvdata(pdev);
534534

535+
pm_runtime_get_sync(&pdev->dev);
535536
ufshcd_remove(hba);
536537
pm_runtime_disable(&pdev->dev);
538+
pm_runtime_put_noidle(&pdev->dev);
537539
}
538540
EXPORT_SYMBOL_GPL(ufshcd_pltfrm_remove);
539541

0 commit comments

Comments
 (0)