> > Fix this lockup by making ufshcd_exec_dev_cmd() allocate a reserved > > request. > > It is worth noting that the error handler itself could always find > a free slot, either by waiting for one, or by taking the reset > path which clears all slots. > > However, the problem would then be places that cause the error > handler to wait, like sysfs (due to hba->host_sem), exception > event handler (due to cancel_work_sync(&hba->eeh_work)), or > potentially any other dev cmd user (due to hba->dev_cmd.lock). Instead of the reserved tag mechanism, since we are in reset-and-restore path, how about forcing one slot out if the doorbell is full? > > Once the layering and locking is sorted out, it might be possible > to get rid of the reserved tag, if there was a performance > benefit. > > More to the point though, for the reasons above, you need to > change the other dev cmd path also > i.e. ufshcd_issue_devman_upiu_cmd() Maybe we can just return ebusy if ufshcd_eh_in_progress()? Thanks, Avri