mbox series

[0/3] scsi: st: improve pos_unknown handling after reset

Message ID 20241031010032.117296-1-jmeneghi@redhat.com
Headers show
Series scsi: st: improve pos_unknown handling after reset | expand

Message

John Meneghini Oct. 31, 2024, 1 a.m. UTC
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(-)

Comments

Kai Mäkisara (Kolumbus) Oct. 31, 2024, 2:17 p.m. UTC | #1
On 31. Oct 2024, at 3.00, John Meneghini <jmeneghi@redhat.com> wrote:
> 
> From: Kai Makisara <kai.makisara@kolumbus.fi>
> 

The patch in this message is a WIP patch discussed in Bugzilla. It is not
meant to be submitted as such. (In addition to changes, it contains a bug
fix not related to the changes.) Those interested in the progress can look
at the Bugzilla entry shown below.

> Fixes: 3d882cca73be ("scsi: st: Fix input/output error on empty drive reset")
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219419
> Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I have NOT signed of this patch.

> Tested-by: John Meneghini <jmeneghi@redhat.com>

John has done extensive tests to see if the patch works.

> ---
> drivers/scsi/st.c | 31 ++++++++++++++++++++++---------
> 1 file changed, 22 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
> index e9d1cb6c8a86..0260361d19fa 100644
> --- a/drivers/scsi/st.c
> +++ b/drivers/scsi/st.c
...