[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4aaf60bc-b398-67a1-7ed5-e0571f30bc95@codeaurora.org>
Date: Fri, 24 Jan 2020 10:07:23 -0800
From: "Asutosh Das (asd)" <asutoshd@...eaurora.org>
To: Can Guo <cang@...eaurora.org>, nguyenb@...eaurora.org,
hongwus@...eaurora.org, rnayak@...eaurora.org,
linux-scsi@...r.kernel.org, kernel-team@...roid.com,
saravanak@...gle.com, salyzyn@...gle.com
Cc: Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
Pedro Sousa <pedrom.sousa@...opsys.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Stanley Chu <stanley.chu@...iatek.com>,
Venkat Gopalakrishnan <venkatg@...eaurora.org>,
Tomas Winkler <tomas.winkler@...el.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 5/8] scsi: ufs: Fix ufshcd_hold() caused scheduling
while atomic
On 1/22/2020 11:25 PM, Can Guo wrote:
> The async version of ufshcd_hold(async == true), which is only called
> in queuecommand path as for now, is expected to work in atomic context,
> thus it should not sleep or schedule out. When it runs into the condition
> that clocks are ON but link is still in hibern8 state, it should bail out
> without flushing the clock ungate work.
>
> Signed-off-by: Can Guo <cang@...eaurora.org>
> Reviewed-by: Hongwu Su <hongwus@...eaurora.org>
> ---
Reviewed-by: Asutosh Das <asutoshd@...eaurora.org>
> drivers/scsi/ufs/ufshcd.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 4dfd705..c316a07 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -1542,6 +1542,11 @@ int ufshcd_hold(struct ufs_hba *hba, bool async)
> */
> if (ufshcd_can_hibern8_during_gating(hba) &&
> ufshcd_is_link_hibern8(hba)) {
> + if (async) {
> + rc = -EAGAIN;
> + hba->clk_gating.active_reqs--;
> + break;
> + }
> spin_unlock_irqrestore(hba->host->host_lock, flags);
> flush_work(&hba->clk_gating.ungate_work);
> spin_lock_irqsave(hba->host->host_lock, flags);
>
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project
Powered by blists - more mailing lists