Every time the driver is reloaded, the warning message
"Unbalanced pm_runtime_enable!" is triggered due to unbalanced
power.disable_depth.  This is because pm_runtime_enable() is called
during driver probe but pm_runtime_disable() is missed on driver remove.

This also restores the device's runtime PM status to 'suspended' on
driver remove as it was set to 'active' during driver probe.

Signed-off-by: Akinobu Mita <[email protected]>
Cc: Vinayak Holikatti <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Dolev Raviv <[email protected]>
Cc: Sujit Reddy Thumma <[email protected]>
Cc: Maya Erez <[email protected]>
Cc: Raviv Shvili <[email protected]>
Cc: Sahitya Tummala <[email protected]>
Cc: Subhash Jadavani <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: [email protected]
---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 9beac71..12f1246 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -369,6 +369,10 @@ static int ufshcd_pltfrm_remove(struct platform_device 
*pdev)
        pm_runtime_get_sync(&(pdev)->dev);
        ufshcd_remove(hba);
        pm_runtime_put_noidle(&pdev->dev);
+
+       pm_runtime_disable(&pdev->dev);
+       pm_runtime_set_suspended(&pdev->dev);
+
        return 0;
 }
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to