From: Rajendra Nayak <rnayak@codeaurora.org>
To: vinholikatti@gmail.com, alim.akhtar@samsung.com,
pedrom.Sousa@synopsys.com
Cc: subhashj@codeaurora.org, asutoshd@codeaurora.org,
linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Rajendra Nayak <rnayak@codeaurora.org>
Subject: [PATCH 1/3] scsi: ufs: Fix runtime pm handling in ufshcd-pltfrm
Date: Fri, 8 Mar 2019 14:00:51 +0530 [thread overview]
Message-ID: <20190308083053.30631-2-rnayak@codeaurora.org> (raw)
In-Reply-To: <20190308083053.30631-1-rnayak@codeaurora.org>
runtime pm calls as part of ufshcd_init() can trigger a
ufshcd_runtime_suspend() which always fails until the point
we do a platform_set_drvdata(), setting the devices 'power.runtime_error'
Use pm_runtime_get_noresume()/pm_runtime_put_noidle() to prevent
this from happening.
Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
---
drivers/scsi/ufs/ufshcd-pltfrm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 895a9b5ac989..974441fa4e75 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -340,6 +340,7 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
goto dealloc_host;
}
+ pm_runtime_get_noresume(&pdev->dev);
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
@@ -352,12 +353,14 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
}
platform_set_drvdata(pdev, hba);
+ pm_runtime_put_noidle(&pdev->dev);
return 0;
out_disable_rpm:
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
+ pm_runtime_put_noidle(&pdev->dev);
dealloc_host:
ufshcd_dealloc_host(hba);
out:
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
next prev parent reply other threads:[~2019-03-08 8:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 8:30 [PATCH 0/3] scsi: ufs: runtime pm fixes Rajendra Nayak
2019-03-08 8:30 ` Rajendra Nayak [this message]
2019-03-08 8:30 ` [PATCH 2/3] scsi: ufs: Add error checks for pm_runtime_get_sync() Rajendra Nayak
2019-03-12 14:06 ` Avri Altman
2019-03-08 8:30 ` [PATCH 3/3] scsi: ufs: qcom: Remove unnecessary runtime pm calls Rajendra Nayak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190308083053.30631-2-rnayak@codeaurora.org \
--to=rnayak@codeaurora.org \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=pedrom.Sousa@synopsys.com \
--cc=subhashj@codeaurora.org \
--cc=vinholikatti@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox