On 2020-05-28 18:39, Can Guo wrote: > On 2020-05-29 00:12, Bart Van Assche wrote: >> ufshcd_queuecommand() must have >> finished before the block layer timeout handler is activated. > > This is the ideal/expected situation, but we are seeing the corner case. > > Fixing the root cause of that is one thing, but having the timeout handler > back can prevent UFS driver from messing up the subsequent requests further > in such case, causing possible data corruption. Is there any drawbacks if > we have it back? Hi Can, My conclusion from your emails is that ufshcd_queuecommand() can spend more time than the SCSI timeout (30 seconds) in dma_map_sg(). A dma_map_sg() call that keeps the CPU busy during more than 30 seconds is not only weird but it is also a disaster from the point of view of energy consumption. Please fix the root cause. Thanks, Bart.