Re: LibPATA code issues / 2.6.17.3 (What is the next step?)
From: Justin Piszcz
Date: Wed Jul 12 2006 - 18:27:25 EST
Unfortunately not, the correct patch you need is attached to get the
ata_op code, against 2.6.17.3.
On Wed, 12 Jul 2006, David Greaves wrote:
Alan Cox wrote:
Ar Maw, 2006-07-11 am 09:28 -0400, ysgrifennodd Justin Piszcz:
Alan/Jeff/Mark,
Is there anything else I can do to further troubleshoot this problem now
that we have the failed opcode(s)? Again, there is never any corruption
on these drives, so it is more of an annoyance than anything else.
Nothing strikes me so far other than the data not making sense. Possibly
it will become clearer later if/when we see other examples.
For me it's SMART related.
smartctl -data -o on /dev/sda reliably gets a similar message.
Justin - does this smartctl command trigger a message for you?
I've been mailing on and off since January-ish.
(http://marc.theaimsgroup.com/?l=linux-ide&w=2&r=7&s=libpata&q=b)
Back in March I was running 2.6.16 (with a different version of Mark's
opcode patch) and I sent an email with the following info:
dmesg:
ata1: translated op=0x28 cmd=0x25 ATA stat/err 0x51/04 to SCSI
SK/ASC/ASCQ 0xb/00/00
ata1: status=0x51 { DriveReady SeekComplete Error }
ata1: error=0x04 { DriveStatusError }
Does that help with the diagnosis?
Also see my emails: SMART on SATA reporting errors?
http://marc.theaimsgroup.com/?l=linux-ide&m=113933732903205&w=2
I did reply but got no response so I assumed I was just so far off base
that I was being ignored :)
David
diff -uprN linux-2.6.17.3/drivers/scsi/libata-scsi.c linux-2.6.17.3-diff/drivers/scsi/libata-scsi.c
--- linux-2.6.17.3/drivers/scsi/libata-scsi.c 2006-06-30 13:37:38.000000000 -0400
+++ linux-2.6.17.3-diff/drivers/scsi/libata-scsi.c 2006-07-09 16:31:45.665112000 -0400
@@ -428,10 +428,16 @@ int ata_scsi_device_suspend(struct scsi_
* spin_lock_irqsave(host_set lock)
*/
void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk, u8 *asc,
- u8 *ascq)
+ u8 *ascq, struct ata_queued_cmd *qc)
{
int i;
+ struct scsi_cmnd *cmd = qc->scsicmd;
+ struct ata_taskfile *tf = &qc->tf;
+ unsigned char *sb = cmd->sense_buffer;
+ unsigned char *desc = sb + 8;
+ unsigned char ata_op = tf->command;
+
/* Based on the 3ware driver translation table */
static const unsigned char sense_table[][4] = {
/* BBD|ECC|ID|MAR */
@@ -520,6 +526,7 @@ void ata_to_sense_error(unsigned id, u8
printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "
"SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n", id, drv_stat, drv_err,
*sk, *asc, *ascq);
+ printk(KERN_ERR "ata_gen_ata_desc_sense: failed ata_op=0x%02x\n", ata_op);
return;
}
@@ -542,6 +549,7 @@ void ata_gen_ata_desc_sense(struct ata_q
struct ata_taskfile *tf = &qc->tf;
unsigned char *sb = cmd->sense_buffer;
unsigned char *desc = sb + 8;
+ unsigned char ata_op = tf->command;
memset(sb, 0, SCSI_SENSE_BUFFERSIZE);
@@ -558,8 +566,9 @@ void ata_gen_ata_desc_sense(struct ata_q
* onto sense key, asc & ascq.
*/
if (tf->command & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
+ printk(KERN_WARNING "ata_gen_ata_desc_sense: failed ata_op=0x%02x\n", ata_op);
ata_to_sense_error(qc->ap->id, tf->command, tf->feature,
- &sb[1], &sb[2], &sb[3]);
+ &sb[1], &sb[2], &sb[3],qc);
sb[1] &= 0x0f;
}
@@ -617,6 +626,7 @@ void ata_gen_fixed_sense(struct ata_queu
struct scsi_cmnd *cmd = qc->scsicmd;
struct ata_taskfile *tf = &qc->tf;
unsigned char *sb = cmd->sense_buffer;
+ unsigned char ata_op = tf->command;
memset(sb, 0, SCSI_SENSE_BUFFERSIZE);
@@ -633,8 +643,9 @@ void ata_gen_fixed_sense(struct ata_queu
* onto sense key, asc & ascq.
*/
if (tf->command & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
+ printk(KERN_WARNING "ata_gen_fixed_sense: failed ata_op=0x%02x\n", ata_op);
ata_to_sense_error(qc->ap->id, tf->command, tf->feature,
- &sb[2], &sb[12], &sb[13]);
+ &sb[2], &sb[12], &sb[13],qc);
sb[2] &= 0x0f;
}