Re: [PATCH] scsi: ufs: Reduce the power mode change timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/14/22 00:45, Avri Altman wrote:
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.
Maybe also worth noting that it was invented 20 years ago for scsi ioctl,
And is less applicable for nowadays ufs devices


Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
  drivers/ufs/core/ufshcd.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index e32b6b834b7f..2dd355a5da54 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8776,6 +8776,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;
>
Maybe use ktime api, like its done throughout the driver?

Hi Avri,

Calling ktime_get() is much more expensive than reading the jiffies counter. That's why I prefer to use the jiffies counter if the timeout is significantly larger than 1 / HZ and if the accuracy of 1 / HZ is sufficient.

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux