On driver removal, pm_runtime_get_sync() is called, but
pm_runtime_put_sync() is missed.  So once the driver is reloaded, the
device's power.usage_count is unbalanced and the idle callback for the
device will never be called.

Signed-off-by: Akinobu Mita <akinobu.m...@gmail.com>
Cc: Vinayak Holikatti <vinholika...@gmail.com>
Cc: "James E.J. Bottomley" <jbottom...@parallels.com>
Cc: Christoph Hellwig <h...@lst.de>
Cc: Dolev Raviv <dra...@codeaurora.org>
Cc: Sujit Reddy Thumma <sthu...@codeaurora.org>
Cc: Subhash Jadavani <subha...@codeaurora.org>
Cc: Maya Erez <me...@codeaurora.org>
Cc: Sahitya Tummala <stumm...@codeaurora.org>
Cc: "Rafael J. Wysocki" <rafael.j.wyso...@intel.com>
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 7db9564..4164108 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -368,6 +368,7 @@ static int ufshcd_pltfrm_remove(struct platform_device 
*pdev)
 
        pm_runtime_get_sync(&(pdev)->dev);
        ufshcd_remove(hba);
+       pm_runtime_put_sync(&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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to