|
| 1 | +scsi: st: Don't set pos_unknown just after device recognition |
| 2 | + |
| 3 | +jira LE-2741 |
| 4 | +Rebuild_History Non-Buildable kernel-4.18.0-553.42.1.el8_10 |
| 5 | +commit-author Kai Mäkisara < [email protected]> |
| 6 | +commit 98b37881b7492ae9048ad48260cc8a6ee9eb39fd |
| 7 | +Empty-Commit: Cherry-Pick Conflicts during history rebuild. |
| 8 | +Will be included in final tarball splat. Ref for failed cherry-pick at: |
| 9 | +ciq/ciq_backports/kernel-4.18.0-553.42.1.el8_10/98b37881.failed |
| 10 | + |
| 11 | +Commit 9604eea5bd3a ("scsi: st: Add third party poweron reset handling") in |
| 12 | +v6.6 added new code to handle the Power On/Reset Unit Attention (POR UA) |
| 13 | +sense data. This was in addition to the existing method. When this Unit |
| 14 | +Attention is received, the driver blocks attempts to read, write and some |
| 15 | +other operations because the reset may have rewinded the tape. Because of |
| 16 | +the added code, also the initial POR UA resulted in blocking operations, |
| 17 | +including those that are used to set the driver options after the device is |
| 18 | +recognized. Also, reading and writing are refused, whereas they succeeded |
| 19 | +before this commit. |
| 20 | + |
| 21 | +Add code to not set pos_unknown to block operations if the POR UA is |
| 22 | +received from the first test_ready() call after the st device has been |
| 23 | +created. This restores the behavior before v6.6. |
| 24 | + |
| 25 | + Signed-off-by: Kai Mäkisara < [email protected]> |
| 26 | +Link: https://lore.kernel.org/r/ [email protected] |
| 27 | +Fixes: 9604eea5bd3a ("scsi: st: Add third party poweron reset handling") |
| 28 | + |
| 29 | +Closes: https://lore.kernel.org/linux-scsi/ [email protected]/ |
| 30 | + Signed-off-by: Martin K. Petersen < [email protected]> |
| 31 | +(cherry picked from commit 98b37881b7492ae9048ad48260cc8a6ee9eb39fd) |
| 32 | + Signed-off-by: Jonathan Maple < [email protected]> |
| 33 | + |
| 34 | +# Conflicts: |
| 35 | +# drivers/scsi/st.c |
| 36 | +diff --cc drivers/scsi/st.c |
| 37 | +index 32db554d65e0,ebbd50ec0cda..000000000000 |
| 38 | +--- a/drivers/scsi/st.c |
| 39 | ++++ b/drivers/scsi/st.c |
| 40 | +@@@ -4355,7 -4332,8 +4360,12 @@@ static int st_probe(struct device *dev |
| 41 | + tpnt->nbr_partitions = 0; |
| 42 | + blk_queue_rq_timeout(tpnt->device->request_queue, ST_TIMEOUT); |
| 43 | + tpnt->long_timeout = ST_LONG_TIMEOUT; |
| 44 | +++<<<<<<< HEAD |
| 45 | + + tpnt->try_dio = try_direct_io && !SDp->host->unchecked_isa_dma; |
| 46 | +++======= |
| 47 | ++ tpnt->try_dio = try_direct_io; |
| 48 | ++ tpnt->first_tur = 1; |
| 49 | +++>>>>>>> 98b37881b749 (scsi: st: Don't set pos_unknown just after device recognition) |
| 50 | + |
| 51 | + for (i = 0; i < ST_NBR_MODES; i++) { |
| 52 | + STm = &(tpnt->modes[i]); |
| 53 | +* Unmerged path drivers/scsi/st.c |
| 54 | +diff --git a/drivers/scsi/st.h b/drivers/scsi/st.h |
| 55 | +index 95d2e7a7988d..355e55f681b9 100644 |
| 56 | +--- a/drivers/scsi/st.h |
| 57 | ++++ b/drivers/scsi/st.h |
| 58 | +@@ -173,6 +173,7 @@ struct scsi_tape { |
| 59 | + unsigned char rew_at_close; /* rewind necessary at close */ |
| 60 | + unsigned char inited; |
| 61 | + unsigned char cleaning_req; /* cleaning requested? */ |
| 62 | ++ unsigned char first_tur; /* first TEST UNIT READY */ |
| 63 | + int block_size; |
| 64 | + int min_block; |
| 65 | + int max_block; |
0 commit comments