linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug#12874] Seagate STT20000A no longer works
@ 2009-04-10 17:42 Borislav Petkov
  2009-04-14 21:34 ` Mark de Wever
  2009-04-14 21:41 ` Mark de Wever
  0 siblings, 2 replies; 10+ messages in thread
From: Borislav Petkov @ 2009-04-10 17:42 UTC (permalink / raw)
  To: sshtylyov; +Cc: bzolnier, koraq, linux-ide

(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.

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-16 15:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-10 17:42 [bug#12874] Seagate STT20000A no longer works Borislav Petkov
2009-04-14 21:34 ` Mark de Wever
2009-04-14 21:41 ` Mark de Wever
2009-04-20  9:30   ` Borislav Petkov
2009-05-05 21:12     ` Mark de Wever
2009-05-05 21:19       ` [PATCH] Fix ide-tape compilation error Mark de Wever
2009-05-06  6:10         ` Borislav Petkov
2009-05-16 15:08           ` Borislav Petkov
2009-05-06  6:11       ` [bug#12874] Seagate STT20000A no longer works Borislav Petkov
2009-05-16  8:25         ` Mark de Wever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).