> On 31. Oct 2024, at 3.00, John Meneghini <jmeneghi@xxxxxxxxxx> wrote: > > Be sure to clear was_reset when ever we clear pos_unknown. If we don't > then the code in st_chk_result() will turn on pos_unknown again. > > STp->pos_unknown |= STp->device->was_reset; > > This results in confusion as future commands fail unexpectedly. This brings in my mind (again) the question: is the hack using was_reset set by scsi_error to detect device reset necessary any more? It was introduced as a temporary method somewhere between 1.3.20 and 1.3.30 (in 1995) when the POR (power on/reset) UAs (Unit Attention) were not passed to st. The worst problem with this hack is clearing was_reset. St should not clear something set by error handling (layering violation). Your earlier patch added code to st to set pos_unknown when a POR UA was found. So, is this now alone enough to catch the resets? I now did some experiments with scsi_debug and in those experiments reset initiated using sg_reset did result in st getting POR UA. But this was just a simple and somewhat artificial test.