Re: [PATCH v2 14/20] scsi: ufs: Introduce ufshcd_release_scsi_cmd()

Bart Van Assche
2021-11-30T19:17:05Z

On 11/30/21 11:02 AM, Adrian Hunter wrote:
> On 30/11/2021 20:00, Bart Van Assche wrote:
>> ufshcd_abort() only calls
>> ufshcd_release_scsi_cmd() after ufshcd_try_to_abort_task() succeeded.
>> That means that the command has not completed and hence that
>> ufshcd_update_monitor() must not be called.
>
> AFAICT the monitor is for successful commands, which is why I suggested
> checking the 'result'.
>
> So make that change to __ufshcd_transfer_req_compl() and then it will
> work for ufshcd_abort() and provide tracing.

ufshcd_abort() does not set cmd->result because it doesn't have to.
Additionally, __ufshcd_transfer_req_compl() calls scsi_done() while an
abort handler should not call scsi_done(). In other words, my point of
view is that ufshcd_abort() should not call __ufshcd_transfer_req_compl().

Thanks,

Bart.