From: Manivannan Sadhasivam <mani@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, stable@vger.kernel.org,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Stanley Jhu <chu.stanley@gmail.com>,
Can Guo <quic_cang@quicinc.com>,
Asutosh Das <quic_asutoshd@quicinc.com>,
Bean Huo <beanhuo@micron.com>,
"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
Arthur Simchaev <Arthur.Simchaev@wdc.com>
Subject: Re: [PATCH 1/2] scsi: ufs: Simplify power management during async scan
Date: Wed, 20 Dec 2023 20:12:41 +0530 [thread overview]
Message-ID: <20231220144241.GG3544@thinkpad> (raw)
In-Reply-To: <20231218225229.2542156-2-bvanassche@acm.org>
On Mon, Dec 18, 2023 at 02:52:14PM -0800, Bart Van Assche wrote:
> ufshcd_init() calls pm_runtime_get_sync() before it calls
> async_schedule(). ufshcd_async_scan() calls pm_runtime_put_sync()
> directly or indirectly from ufshcd_add_lus(). Simplify
> ufshcd_async_scan() by always calling pm_runtime_put_sync() from
> ufshcd_async_scan().
>
> Cc: stable@vger.kernel.org
No fixes tag?
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> ---
> drivers/ufs/core/ufshcd.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index d6ae5d17892c..0ad8bde39cd1 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -8711,7 +8711,6 @@ static int ufshcd_add_lus(struct ufs_hba *hba)
>
> ufs_bsg_probe(hba);
> scsi_scan_host(hba->host);
> - pm_runtime_put_sync(hba->dev);
>
> out:
> return ret;
> @@ -8980,15 +8979,15 @@ static void ufshcd_async_scan(void *data, async_cookie_t cookie)
>
> /* Probe and add UFS logical units */
> ret = ufshcd_add_lus(hba);
> +
> out:
> + pm_runtime_put_sync(hba->dev);
> /*
> * If we failed to initialize the device or the device is not
> * present, turn off the power/clocks etc.
> */
> - if (ret) {
> - pm_runtime_put_sync(hba->dev);
> + if (ret)
> ufshcd_hba_exit(hba);
> - }
> }
>
> static enum scsi_timeout_action ufshcd_eh_timed_out(struct scsi_cmnd *scmd)
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-12-20 14:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231218225229.2542156-1-bvanassche@acm.org>
2023-12-18 22:52 ` [PATCH 1/2] scsi: ufs: Simplify power management during async scan Bart Van Assche
2023-12-19 5:04 ` Can Guo
2023-12-20 14:42 ` Manivannan Sadhasivam [this message]
2023-12-20 16:36 ` Bart Van Assche
2023-12-20 16:59 ` Manivannan Sadhasivam
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=20231220144241.GG3544@thinkpad \
--to=mani@kernel.org \
--cc=Arthur.Simchaev@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=chu.stanley@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=stable@vger.kernel.org \
/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