These patches address some issues with positoin lost handling which where introduced by commit 9604eea5bd3a ("scsi: st: Add third party poweron reset handling"). That commit added code which detected any unexpected power on/reset unit attention to st_chk_results() and correclty set pos_unknown in the driver. However, the aforementioned changes is catching POR UAs that are expected as well as those that are unexpected as st_chk_results() sets pos_unknown every time a POR UA is seen. This results in a change of behavior that is confusing as some tape drives can set a POR UA when the system reboots, the driver reloads, or a tape is reloaded. This results in regressions as MTIOGET now fails following and kind of reset. These issues are documented in the kernel bugzilla: Link: https://bugzilla.kernel.org/show_bug.cgi?id=219419 A reproducer test script can be found at: Link: https://github.com/johnmeneghini/tape_tests John Meneghini (3): scsi: st: instrument the pos_unknown code scsi: st: clear was_reset when CHKRES_NEW_SESSION scsi: st: clear pos_unknown when the por ua is expected drivers/scsi/st.c | 63 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 9 deletions(-) -- 2.47.0