Skip to contentSkip to conversation

ufs: update the timeout timer after resume

PATCH In review Ed Tsai 2 participants 2 messages Dec 29, 2022

Subsystems (3)
lore
Share & tools
lore

Ed Tsai

author
#0 lore raw

PATCH 1/1 ufs: update the timeout timer after resume

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.

---
 drivers/ufs/core/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ufs/core/ufshcd.c +1 -0
index e18c9f4463ec..c77570caa3a8 100644
@@ -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;
Signature · 1 line
2.18.0
#1 lore raw
Quoted 19 lines · 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.

---
  drivers/ufs/core/ufshcd.c | 1 +
  1 file changed, 1 insertion(+)
drivers/ufs/core/ufshcd.c +0 -0
index e18c9f4463ec..c77570caa3a8 100644

drivers/ufs/core/ufshcd.c static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, · line 8848

Quoted 7 lines
drivers/ufs/core/ufshcd.c +1 -0
@@ -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.