Commit 8db816c6 authored by Kai Mäkisara's avatar Kai Mäkisara Committed by Martin K. Petersen
Browse files

scsi: st: Tighten the page format heuristics with MODE SELECT



In the days when SCSI-2 was emerging, some drives did claim SCSI-2 but did
not correctly implement it. The st driver first tries MODE SELECT with the
page format bit set to set the block descriptor.  If not successful, the
non-page format is tried.

The test only tests the sense code and this triggers also from illegal
parameter in the parameter list. The test is limited to "old" devices and
made more strict to remove false alarms.

Signed-off-by: default avatarKai Mäkisara <Kai.Makisara@kolumbus.fi>
Link: https://lore.kernel.org/r/20250311112516.5548-4-Kai.Makisara@kolumbus.fi


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ad77cebf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3104,6 +3104,8 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
			   cmd_in == MTSETDRVBUFFER ||
			   cmd_in == SET_DENS_AND_BLK) {
			if (cmdstatp->sense_hdr.sense_key == ILLEGAL_REQUEST &&
				cmdstatp->sense_hdr.asc == 0x24 &&
				(STp->device)->scsi_level <= SCSI_2 &&
				!(STp->use_pf & PF_TESTED)) {
				/* Try the other possible state of Page Format if not
				   already tried */