[bug#12874] Seagate STT20000A no longer works

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(moving discussion to mail and adding Bart to CC)

(In reply to comment #24)
> (In reply to comment #20)
> > Hmm, seems like the buffer is quite botched or the drive replies with some mode
> > parameter headers I cannot correlate.
> 
> If you mean this line:
> 
> [   42.272638] caps:  70 0 6 0 0 0 0 a 0 0 0 0 29 0 0 0 0 0 0 0 0 0 0 0
> 
> 
> this is the extended sense data with its characteristic 1st byte of 0x70,
> 8-byte header with sense key UNIT ATTENTION, 10 bytes of additinal length and
> ASC of 0x29 meaning "reset hs occured".

Haa, thanks for catching that, although the QIC157d document I'm staring
at here states that the drive might return sense data instead of the
requested page, it seems that we don't get any CHECK CONDITION status
otherwise ide_pc_intr would've caught it (stat & ATA_ERR) and retried
the command.

Now, without having tested it since I don't have the hardware, would
something in the lines below be a sensible kludge for now? I guess we
should have similar error handling for the other MODE SENSE call sites
and propagate some error status from idetape_get_mode_sense_results()
upwards to idetape_setup()? Yeah, I know, the driver needs a lot of
massaging in order even to start looking ok... :)

__

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 70e7876..827485a 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2095,6 +2095,21 @@ static void idetape_get_mode_sense_results(ide_drive_t *drive)
 		put_unaligned(540,  (u16 *)&tape->caps[14]);
 		put_unaligned(6*52, (u16 *)&tape->caps[16]);
 		return;
+
+	} else if ((pc.buf[0] & 0x7f) == 0x70) {
+		/* unit attention: power on reset or device reset/not ready to
+		 * ready transition */
+		if ((pc.buf[2] & 0xf) == 0x6 &&
+		     (pc.buf[12] == 0x29 || pc.buf[12] == 0x28) &&
+		     pc.buf[13] == 0x0) {
+			tape->failed_pc = &pc;
+			ide_retry_pc(drive, tape->disk);
+		}
+		else {
+			printk(KERN_ERR "%s: error getting caps page\n",
+					drive->name);
+			return;
+		}
 	}
 	caps = pc.buf + 4 + pc.buf[3];
 


-- 
Regards/Gruss,
    Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux