Message ID | 1579759946-5448-6-git-send-email-cang@codeaurora.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | UFS driver general fixes bundle 4 | expand |
Hi Can, On 2020-01-23 14:12, 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@codeaurora.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); It looks good to me. Reviewed-by: Hongwu Su <hongwus@codeaurora.org>
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 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@codeaurora.org> --- drivers/scsi/ufs/ufshcd.c | 5 +++++ 1 file changed, 5 insertions(+)