mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
scsi: ufs: core: Reduce the power mode change timeout
[ Upstream commit 8f2c96420c
]
The current power mode change timeout (180 s) is so large that it can cause
a watchdog timer to fire. Reduce the power mode change timeout to 10
seconds.
Link: https://lore.kernel.org/r/20220811234401.1957911-1-bvanassche@acm.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8beb0f0152
commit
3432b6de5e
1 changed files with 8 additions and 1 deletions
|
@ -8476,6 +8476,8 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
|
|||
struct scsi_device *sdp;
|
||||
unsigned long flags;
|
||||
int ret, retries;
|
||||
unsigned long deadline;
|
||||
int32_t remaining;
|
||||
|
||||
spin_lock_irqsave(hba->host->host_lock, flags);
|
||||
sdp = hba->sdev_ufs_device;
|
||||
|
@ -8508,9 +8510,14 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
|
|||
* callbacks hence set the RQF_PM flag so that it doesn't resume the
|
||||
* already suspended childs.
|
||||
*/
|
||||
deadline = jiffies + 10 * HZ;
|
||||
for (retries = 3; retries > 0; --retries) {
|
||||
ret = -ETIMEDOUT;
|
||||
remaining = deadline - jiffies;
|
||||
if (remaining <= 0)
|
||||
break;
|
||||
ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
|
||||
START_STOP_TIMEOUT, 0, 0, RQF_PM, NULL);
|
||||
remaining / HZ, 0, 0, RQF_PM, NULL);
|
||||
if (!scsi_status_is_check_condition(ret) ||
|
||||
!scsi_sense_valid(&sshdr) ||
|
||||
sshdr.sense_key != UNIT_ATTENTION)
|
||||
|
|
Loading…
Add table
Reference in a new issue