From: "Asutosh Das (asd)" <asutoshd@codeaurora.org>
To: Bart Van Assche <bvanassche@acm.org>,
cang@codeaurora.org, martin.petersen@oracle.com,
adrian.hunter@intel.com, linux-scsi@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Pedro Sousa <pedrom.sousa@synopsys.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Stanley Chu <stanley.chu@mediatek.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Lee Jones <lee.jones@linaro.org>, Bean Huo <beanhuo@micron.com>,
Kiwoong Kim <kwmad.kim@samsung.com>, Yue Hu <huyue2@yulong.com>,
Wei Yongjun <weiyongjun1@huawei.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Dinghao Liu <dinghao.liu@zju.edu.cn>,
Jaegeuk Kim <jaegeuk@kernel.org>,
Satya Tangirala <satyat@google.com>,
open list <linux-kernel@vger.kernel.org>,
"moderated list:ARM/SAMSUNG S3C,
S5P AND EXYNOS ARM ARCHITECTURES"
<linux-arm-kernel@lists.infradead.org>,
"open list:ARM/SAMSUNG S3C,
S5P AND EXYNOS ARM ARCHITECTURES"
<linux-samsung-soc@vger.kernel.org>,
"moderated list:UNIVERSAL FLASH STORAGE HOST CONTROLLER
DRIVER..." <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v18 1/2] scsi: ufs: Enable power management for wlun
Date: Fri, 16 Apr 2021 11:21:48 -0700 [thread overview]
Message-ID: <9ae35c14-f8aa-a181-2259-2d32bd2c1f07@codeaurora.org> (raw)
In-Reply-To: <f111e363-c709-fe3c-65da-450c9e9e3408@acm.org>
On 4/15/2021 4:11 PM, Bart Van Assche wrote:
> On 4/14/21 11:58 AM, Asutosh Das wrote:
>> [ ... ]
>
Hi Bart,
Thanks for the comments. I will fix the comments in the next version.
> The following code is executed before ufshcd_async_scan() is called:
>
> dev = hba->dev;
> [ ... ]
> /* Hold auto suspend until async scan completes */
> pm_runtime_get_sync(dev);
>
That would only keep the hba runtime resumed. At this point of time the
luns are not detected yet.
> and the following code occurs in ufshcd_add_lus():
>
> pm_runtime_put_sync(hba->dev);
>
> Isn't that sufficient to postpone enabling of runtime PM until LUN
> scanning has finished? Or in other words, is adding a
> pm_runtime_get_noresume() call in ufshcd_slave_configure() really necessary?
>
Yes, because the supplier (device wlun) may be suspended otherwise in
scsi_sysfs_add_sdev().
>> @@ -4979,15 +5035,9 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
>> */
>> if (!hba->pm_op_in_progress &&
>> !ufshcd_eh_in_progress(hba) &&
>> - ufshcd_is_exception_event(lrbp->ucd_rsp_ptr) &&
>> - schedule_work(&hba->eeh_work)) {
>> - /*
>> - * Prevent suspend once eeh_work is scheduled
>> - * to avoid deadlock between ufshcd_suspend
>> - * and exception event handler.
>> - */
>> - pm_runtime_get_noresume(hba->dev);
>> - }
>> + ufshcd_is_exception_event(lrbp->ucd_rsp_ptr))
>> + /* Flushed in suspend */
>> + schedule_work(&hba->eeh_work);
>
> What makes it safe to leave out the above pm_runtime_get_noresume() call?
>
The __ufshcd_wl_suspend() would flush this work so that it doesn't run
after suspend.
> Thanks,
>
> Bart.
>
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project
next prev parent reply other threads:[~2021-04-16 18:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 18:58 [PATCH v18 0/2] Enable power management for ufs wlun Asutosh Das
2021-04-14 18:58 ` [PATCH v18 1/2] scsi: ufs: Enable power management for wlun Asutosh Das
2021-04-14 22:41 ` kernel test robot
2021-04-15 11:06 ` Adrian Hunter
2021-04-15 18:22 ` Dan Carpenter
2021-04-15 23:11 ` Bart Van Assche
2021-04-16 2:10 ` Martin K. Petersen
2021-04-16 18:21 ` Asutosh Das (asd) [this message]
2021-04-14 18:58 ` [PATCH v18 2/2] ufs: sysfs: Resume the proper scsi device Asutosh Das
2021-04-15 9:21 ` Adrian Hunter
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=9ae35c14-f8aa-a181-2259-2d32bd2c1f07@codeaurora.org \
--to=asutoshd@codeaurora.org \
--cc=adrian.hunter@intel.com \
--cc=agross@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bjorn.andersson@linaro.org \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=dinghao.liu@zju.edu.cn \
--cc=gustavoars@kernel.org \
--cc=huyue2@yulong.com \
--cc=jaegeuk@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=krzk@kernel.org \
--cc=kwmad.kim@samsung.com \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=mingo@redhat.com \
--cc=pedrom.sousa@synopsys.com \
--cc=rostedt@goodmis.org \
--cc=satyat@google.com \
--cc=stanley.chu@mediatek.com \
--cc=weiyongjun1@huawei.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;
as well as URLs for NNTP newsgroup(s).