On Tue, 2024-10-08 at 11:29 -0700, Bart Van Assche wrote: > Hi Peter, > > I think what you wrote applies to MCQ mode only. In my previous email > I clearly referred to "legacy mode" (SDB mode). Summarizing my > previous > email, I think that in legacy mode it is possible that > ufshcd_release() > is called twice while it only should be called once. Here are the > possible solutions I see: > * Add a function to the SCSI core for setting SCMD_STATE_COMPLETE. > This > may be controversial since no other SCSI LLD needs this > functionality. > * Changing the error handling approach in the UFS driver to the same > approach other SCSI LLDs use: instead of using queue_work() to > activate the error handler, call scsi_schedule_eh(). This will > cause > the error handler to be activated later, namely after all pending > commands have timed out instead of aborting any pending commands > first. > * Add a variant of scsi_schedule_eh() to the SCSI core that > accelerates > error handling by calling scsi_timeout() on all pending commands. > > Thanks, > > Bart. > Hi Bart, Yes, this patch is only for MCQ mode, because only MCQ mode receives OCS: ABORTED, right? This patch doesn't modify any of the Legacy mode flows, does it? Additionally, I still don't understand why you say there would be an issue with legacy mode having duplicate ufshcd_release(hba) calls. As I mentioned before, it is protected by the outstanding_lock. Could you please clarify the detailed error flow? Furthermore, even if there is an issue with Legacy mode, it should be addressed by a separate patch, not by this one, which is intended to resolve the MCQ mode issue. We shouldn't mix two different issues together, don't you agree? Thanks Peter