mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] ufs: update the timeout timer after resume
@ 2022-12-29  3:06 Ed Tsai
  2022-12-29 14:12 ` Bart Van Assche
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Tsai @ 2022-12-29  3:06 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, jejb, martin.petersen, matthias.bgg,
	linux-scsi
  Cc: peter.wang, alice.chao, powen.kao, naomi.chu, stanley.chu,
	wsd_upstream, linux-kernel, linux-arm-kernel, linux-mediatek,
	Ed Tsai

The tags allocation is limited by the number of active queues and a
queue is marked as inactive by the queue timeout worker after up to 30Hz
by default.

Therefore, tags for the general I/O may be limited to half of the max
depth up to 30HZ after resume. To make sure the ufs request queue for pm
usage can be inactive immediately, trigger the timeout worker to release
the tag set.

Signed-off-by: Ed Tsai <ed.tsai@mediatek.com>
---
 drivers/ufs/core/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index e18c9f4463ec..c77570caa3a8 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8842,6 +8842,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
 		hba->curr_dev_pwr_mode = pwr_mode;
 	}
 
+	mod_timer(&sdp->request_queue->timeout, 0);
 	scsi_device_put(sdp);
 	hba->host->eh_noresume = 0;
 	return ret;
-- 
2.18.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] ufs: update the timeout timer after resume
  2022-12-29  3:06 [PATCH 1/1] ufs: update the timeout timer after resume Ed Tsai
@ 2022-12-29 14:12 ` Bart Van Assche
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Van Assche @ 2022-12-29 14:12 UTC (permalink / raw)
  To: Ed Tsai, alim.akhtar, avri.altman, jejb, martin.petersen,
	matthias.bgg, linux-scsi
  Cc: peter.wang, alice.chao, powen.kao, naomi.chu, stanley.chu,
	wsd_upstream, linux-kernel, linux-arm-kernel, linux-mediatek

On 12/28/22 19:06, Ed Tsai wrote:
> The tags allocation is limited by the number of active queues and a
> queue is marked as inactive by the queue timeout worker after up to 30Hz
> by default.
> 
> Therefore, tags for the general I/O may be limited to half of the max
> depth up to 30HZ after resume. To make sure the ufs request queue for pm
> usage can be inactive immediately, trigger the timeout worker to release
> the tag set.
> 
> Signed-off-by: Ed Tsai <ed.tsai@mediatek.com>
> ---
>   drivers/ufs/core/ufshcd.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index e18c9f4463ec..c77570caa3a8 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -8842,6 +8842,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
>   		hba->curr_dev_pwr_mode = pwr_mode;
>   	}
>   
> +	mod_timer(&sdp->request_queue->timeout, 0);
>   	scsi_device_put(sdp);
>   	hba->host->eh_noresume = 0;
>   	return ret;

Where is the code that restores the timeout to the original value?

Additionally, I think that only the block layer core should manipulate 
the request queue timer directly. Please add a helper function in the 
block layer and call that helper function from the UFS driver.

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-29 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-29  3:06 [PATCH 1/1] ufs: update the timeout timer after resume Ed Tsai
2022-12-29 14:12 ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®