* ATAPI tape drives broken with libata
@ 2007-08-29 22:55 Chuck Ebbert
2007-08-29 23:50 ` Alan Cox
2007-08-30 4:00 ` Jeff Garzik
0 siblings, 2 replies; 13+ messages in thread
From: Chuck Ebbert @ 2007-08-29 22:55 UTC (permalink / raw)
To: IDE/ATA development list; +Cc: craig48
https://bugzilla.redhat.com/show_bug.cgi?id=243568
Using kernel 2.6.22:
Aug 29 17:08:11 itox kernel: ata2.00: ATAPI: Seagate STT8000A, 5.51, max MWDMA2
Aug 29 17:08:11 itox kernel: ata2.00: configured for MWDMA2
Aug 29 17:08:11 itox kernel: scsi 1:0:0:0: Sequential-Access Seagate STT8000A 5.51 PQ: 0 ANSI: 2
Aug 29 17:08:12 itox kernel: scsi 1:0:0:0: Attached scsi generic sg1 type 1
Aug 29 17:08:12 itox kernel: st: Version 20070203, fixed bufsize 32768, s/g segs 256
Aug 29 17:08:12 itox kernel: st 1:0:0:0: Attached scsi tape st0
Aug 29 17:08:12 itox kernel: st 1:0:0:0: st0: try direct i/o: yes (alignment 512 B)
Aug 29 17:08:12 itox kernel: ata2: DRQ=1 with device error, dev_stat 0x59
Aug 29 17:08:12 itox kernel: ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
Aug 29 17:08:12 itox kernel: ata2.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
Aug 29 17:08:12 itox kernel: res 51/60:03:00:00:20/00:00:00:00:00/a0 Emask 0x3 (HSM violation)
Aug 29 17:08:13 itox kernel: ata2: soft resetting port
Aug 29 17:08:13 itox kernel: ata2.00: revalidation failed (errno=-2)
Aug 29 17:08:13 itox kernel: ata2: failed to recover some devices, retrying in 5 secs
Aug 29 17:08:13 itox kernel: ata2: soft resetting port
Aug 29 17:08:13 itox kernel: ata2.00: revalidation failed (errno=-2)
Aug 29 17:08:13 itox kernel: ata2: failed to recover some devices, retrying in 5 secs
Aug 29 17:08:13 itox kernel: ata2: soft resetting port
Aug 29 17:08:13 itox kernel: ata2.00: revalidation failed (errno=-2)
Aug 29 17:08:13 itox kernel: ata2.00: disabled
Aug 29 17:08:13 itox kernel: ata2: EH complete
Opening the device returns -EIO and prints this kernel message:
Aug 29 17:20:29 itox kernel: st0: Error 40000 (sugg. bt 0x0, driver bt 0x0, host bt 0x4).
17:23:45.360014 open("/dev/nst0", O_RDONLY|O_NONBLOCK) = -1 EIO (Input/output error)
The old ide drivers with ide-scsi work.
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: ATAPI tape drives broken with libata
2007-08-29 22:55 ATAPI tape drives broken with libata Chuck Ebbert
@ 2007-08-29 23:50 ` Alan Cox
2007-08-30 16:11 ` Chuck Ebbert
2007-08-30 4:00 ` Jeff Garzik
1 sibling, 1 reply; 13+ messages in thread
From: Alan Cox @ 2007-08-29 23:50 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: IDE/ATA development list, craig48
On Wed, 29 Aug 2007 18:55:55 -0400
Chuck Ebbert <cebbert@redhat.com> wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=243568
>
> Using kernel 2.6.22:
>
> Aug 29 17:08:11 itox kernel: ata2.00: ATAPI: Seagate STT8000A, 5.51, max MWDMA2
> Aug 29 17:08:11 itox kernel: ata2.00: configured for MWDMA2
> Aug 29 17:08:11 itox kernel: scsi 1:0:0:0: Sequential-Access Seagate STT8000A 5.51 PQ: 0 ANSI: 2
> Aug 29 17:08:12 itox kernel: scsi 1:0:0:0: Attached scsi generic sg1 type 1
> Aug 29 17:08:12 itox kernel: st: Version 20070203, fixed bufsize 32768, s/g segs 256
> Aug 29 17:08:12 itox kernel: st 1:0:0:0: Attached scsi tape st0
> Aug 29 17:08:12 itox kernel: st 1:0:0:0: st0: try direct i/o: yes (alignment 512 B)
> Aug 29 17:08:12 itox kernel: ata2: DRQ=1 with device error, dev_stat 0x59
> Aug 29 17:08:12 itox kernel: ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
> Aug 29 17:08:12 itox kernel: ata2.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
> Aug 29 17:08:12 itox kernel: res 51/60:03:00:00:20/00:00:00:00:00/a0 Emask 0x3 (HSM
Device Ready, Seek Complete, Data Request, Error
DRQ and Error together is a bit odd to say the least
It then commits suicide and falls off the bus. That may be due to the
fact we use SRST on ATAPI device errors still rather than trying an ATAPI
reset first. Shouldn't matter though.
Since you are the lucky owner of the object in question can you dump the
contents of the packet command going to the device when this occurs ?
Alan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-08-29 23:50 ` Alan Cox
@ 2007-08-30 16:11 ` Chuck Ebbert
2007-08-31 14:19 ` Alan Cox
0 siblings, 1 reply; 13+ messages in thread
From: Chuck Ebbert @ 2007-08-30 16:11 UTC (permalink / raw)
To: Alan Cox; +Cc: IDE/ATA development list, craig48
On 08/29/2007 07:50 PM, Alan Cox wrote:
>
> Device Ready, Seek Complete, Data Request, Error
>
> DRQ and Error together is a bit odd to say the least
>
> It then commits suicide and falls off the bus. That may be due to the
> fact we use SRST on ATAPI device errors still rather than trying an ATAPI
> reset first. Shouldn't matter though.
>
> Since you are the lucky owner of the object in question can you dump the
> contents of the packet command going to the device when this occurs ?
>
I don't have it, it's a Fedora user. Maybe I should ask Mark Lord if he'll
send me the one he has.
IAC how do I dump the packet? Use ata_scsi_dump_cdb()?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-08-30 16:11 ` Chuck Ebbert
@ 2007-08-31 14:19 ` Alan Cox
2007-09-13 16:35 ` Mark Lord
0 siblings, 1 reply; 13+ messages in thread
From: Alan Cox @ 2007-08-31 14:19 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: IDE/ATA development list, craig48
On Thu, 30 Aug 2007 12:11:39 -0400
Chuck Ebbert <cebbert@redhat.com> wrote:
> On 08/29/2007 07:50 PM, Alan Cox wrote:
> >
> > Device Ready, Seek Complete, Data Request, Error
> >
> > DRQ and Error together is a bit odd to say the least
> >
> > It then commits suicide and falls off the bus. That may be due to the
> > fact we use SRST on ATAPI device errors still rather than trying an ATAPI
> > reset first. Shouldn't matter though.
> >
> > Since you are the lucky owner of the object in question can you dump the
> > contents of the packet command going to the device when this occurs ?
> >
>
> I don't have it, it's a Fedora user. Maybe I should ask Mark Lord if he'll
> send me the one he has.
>
> IAC how do I dump the packet? Use ata_scsi_dump_cdb()?
Yep - if the command issued is a packet command the cdb is 12-16 bytes of
SCSI command block.
Alan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-08-31 14:19 ` Alan Cox
@ 2007-09-13 16:35 ` Mark Lord
2007-09-13 18:22 ` Mark Lord
0 siblings, 1 reply; 13+ messages in thread
From: Mark Lord @ 2007-09-13 16:35 UTC (permalink / raw)
To: Alan Cox; +Cc: Chuck Ebbert, IDE/ATA development list, craig48
Alan Cox wrote:
> On Thu, 30 Aug 2007 12:11:39 -0400
> Chuck Ebbert <cebbert@redhat.com> wrote:
>
>> On 08/29/2007 07:50 PM, Alan Cox wrote:
>>> Device Ready, Seek Complete, Data Request, Error
>>>
>>> DRQ and Error together is a bit odd to say the least
>>>
>>> It then commits suicide and falls off the bus. That may be due to the
>>> fact we use SRST on ATAPI device errors still rather than trying an ATAPI
>>> reset first. Shouldn't matter though.
>>>
>>> Since you are the lucky owner of the object in question can you dump the
>>> contents of the packet command going to the device when this occurs ?
>>>
>> I don't have it, it's a Fedora user. Maybe I should ask Mark Lord if he'll
>> send me the one he has.
>>
>> IAC how do I dump the packet? Use ata_scsi_dump_cdb()?
>
> Yep - if the command issued is a packet command the cdb is 12-16 bytes of
> SCSI command block.
More or less the same behaviour is observed here with the Conner ATAPI tape unit
that I (still!) have on the shelf.
I'll see about instrumenting things for more info. It really sucks as is, though! :)
Cheers
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-09-13 16:35 ` Mark Lord
@ 2007-09-13 18:22 ` Mark Lord
2007-09-13 18:42 ` Mark Lord
0 siblings, 1 reply; 13+ messages in thread
From: Mark Lord @ 2007-09-13 18:22 UTC (permalink / raw)
To: Alan Cox; +Cc: Chuck Ebbert, IDE/ATA development list, craig48
I added code in libata-core.c at ata_qc_issue & ata_qc_issue_prot
which dumps qc->cdb if protocol is ATAPI:
14:10:48 root: writing to the tape next
14:11:01 kernel: qc_issue: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
14:11:01 kernel: qc_issue_prot: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
14:11:01 kernel: qc_issue: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
14:11:01 kernel: qc_issue_prot: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
14:11:01 kernel: ata3: DRQ=1 with device error, dev_stat 0x59
14:11:01 kernel: ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
14:11:01 kernel: ata3.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
14:11:01 kernel: res 51/60:03:00:00:20/00:00:00:00:00/a0 Emask 0x3 (HSM violation)
14:11:01 kernel: ata3: soft resetting port
14:11:02 kernel: ata3.00: revalidation failed (errno=-2)
14:11:02 kernel: ata3: failed to recover some devices, retrying in 5 secs
14:11:07 kernel: ata3: soft resetting port
14:11:08 kernel: spurious 8259A interrupt: IRQ7.
14:11:09 kernel: ata3.01: failed to IDENTIFY (I/O error, err_mask=0x1)
14:11:09 kernel: ata3: failed to recover some devices, retrying in 5 secs
14:11:14 kernel: ata3: soft resetting port
14:11:15 kernel: ata3.01: failed to IDENTIFY (I/O error, err_mask=0x1)
14:11:15 kernel: ata3.01: limiting speed to UDMA7:PIO4
14:11:15 kernel: ata3: failed to recover some devices, retrying in 5 secs
14:11:20 kernel: ata3: soft resetting port
14:11:20 kernel: ata3.01: failed to IDENTIFY (I/O error, err_mask=0x1)
14:11:20 kernel: ata3: failed to recover some devices, retrying in 5 secs
14:11:25 kernel: ata3: soft resetting port
14:11:26 kernel: ata3.00: configured for PIO2
14:11:26 kernel: ata3: EH pending after completion, repeating EH (cnt=4)
14:11:26 kernel: ata3: EH complete
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-09-13 18:22 ` Mark Lord
@ 2007-09-13 18:42 ` Mark Lord
2007-09-13 19:07 ` Mark Lord
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Mark Lord @ 2007-09-13 18:42 UTC (permalink / raw)
To: Alan Cox; +Cc: Chuck Ebbert, IDE/ATA development list, craig48
> 14:10:48 root: writing to the tape next
> 14:11:01 kernel: qc_issue: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 14:11:01 kernel: qc_issue_prot: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 14:11:01 kernel: qc_issue: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
> 14:11:01 kernel: qc_issue_prot: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
> 14:11:01 kernel: ata3: DRQ=1 with device error, dev_stat 0x59
> 14:11:01 kernel: ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
> 14:11:01 kernel: ata3.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
> 14:11:01 kernel: res 51/60:03:00:00:20/00:00:00:00:00/a0 Emask 0x3 (HSM violation)
> 14:11:01 kernel: ata3: soft resetting port
...
Okay, if I simply change the code to ignore the test
for "DRQ=1 with device error", things appear to work.
14:26:48 root: writing
14:26:54 kernel: qc_issue: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue_prot: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue: CDB 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue_prot: CDB 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue_prot: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: ata3: DRQ=1 with device error, dev_stat 0x59
14:26:54 kernel: st0: Sense Key : Illegal Request [current]
14:26:54 kernel: st0: Add. Sense: Invalid command operation code
14:26:54 kernel: qc_issue: CDB 1a 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue_prot: CDB 1a 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:26:54 kernel: qc_issue_prot: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue_prot: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue_prot: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue_prot: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue_prot: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue_prot: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
14:27:01 kernel: qc_issue_prot: CDB 0a 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00
I can read and write the tape successfully, and the written data matches
what is later read back from it.
Here's the hack I used. Not ready for mainline, but perhaps it will
help Alan or whomever come up with something nice for Jeff.
--- 2.6.23-rc6/drivers/ata/libata-core.c 2007-09-13 09:49:16.000000000 -0400
+++ linux/drivers/ata/libata-core.c 2007-09-13 14:15:57.000000000 -0400
@@ -4932,9 +4932,9 @@
if (unlikely(status & (ATA_ERR | ATA_DF))) {
ata_port_printk(ap, KERN_WARNING, "DRQ=1 with device "
"error, dev_stat 0x%X\n", status);
- qc->err_mask |= AC_ERR_HSM;
- ap->hsm_task_state = HSM_ST_ERR;
- goto fsm_start;
+ //qc->err_mask |= AC_ERR_HSM;
+ //ap->hsm_task_state = HSM_ST_ERR;
+ //goto fsm_start;
}
/* Send the CDB (atapi) or the first data block (ata pio out).
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: ATAPI tape drives broken with libata
2007-09-13 18:42 ` Mark Lord
@ 2007-09-13 19:07 ` Mark Lord
2007-09-13 19:09 ` Mark Lord
2007-09-19 20:50 ` Alan Cox
2007-09-21 3:07 ` Albert Lee
2 siblings, 1 reply; 13+ messages in thread
From: Mark Lord @ 2007-09-13 19:07 UTC (permalink / raw)
To: Alan Cox; +Cc: Chuck Ebbert, IDE/ATA development list, craig48
> 14:26:48 root: writing
> 14:26:54 kernel: qc_issue: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 14:26:54 kernel: qc_issue_prot: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 14:26:54 kernel: qc_issue: CDB 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 14:26:54 kernel: qc_issue_prot: CDB 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 14:26:54 kernel: qc_issue: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
> 14:26:54 kernel: qc_issue_prot: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
> 14:26:54 kernel: ata3: DRQ=1 with device error, dev_stat 0x59
> 14:26:54 kernel: st0: Sense Key : Illegal Request [current]
> 14:26:54 kernel: st0: Add. Sense: Invalid command operation code
One more bit of possibly helpful information here.
The last time I wrote a working ATAPI Tape driver,
it always translated SCSI opcode 0x05 (READ_BLOCK_LIMITS) into MODE_SENSE.
I don't remember why it did that, but it was necessary at the time.
So I wonder if the error above has anything to do with the READ_BLOCK_LIMITS
command that can be seen just above the TEST_UNIT_READY and REQUEST_SENSE CDBs ?
Cheers
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-09-13 19:07 ` Mark Lord
@ 2007-09-13 19:09 ` Mark Lord
0 siblings, 0 replies; 13+ messages in thread
From: Mark Lord @ 2007-09-13 19:09 UTC (permalink / raw)
To: Alan Cox; +Cc: Chuck Ebbert, IDE/ATA development list, craig48
>
>> 14:26:48 root: writing
>> 14:26:54 kernel: qc_issue: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> 14:26:54 kernel: qc_issue_prot: CDB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> 14:26:54 kernel: qc_issue: CDB 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> 14:26:54 kernel: qc_issue_prot: CDB 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>> 14:26:54 kernel: qc_issue: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
>> 14:26:54 kernel: qc_issue_prot: CDB 03 00 00 00 60 00 00 00 00 00 00 00 00 00 00 00
>> 14:26:54 kernel: ata3: DRQ=1 with device error, dev_stat 0x59
>> 14:26:54 kernel: st0: Sense Key : Illegal Request [current]
>> 14:26:54 kernel: st0: Add. Sense: Invalid command operation code
>
>
> One more bit of possibly helpful information here.
>
> The last time I wrote a working ATAPI Tape driver,
> it always translated SCSI opcode 0x05 (READ_BLOCK_LIMITS) into MODE_SENSE.
>
> I don't remember why it did that, but it was necessary at the time.
> So I wonder if the error above has anything to do with the READ_BLOCK_LIMITS
> command that can be seen just above the TEST_UNIT_READY and REQUEST_SENSE CDBs ?
Ah.. my notes to myself from that era say:
// ATAPI tape drives do not implement the "READ_BLOCK_LIMITS" command,
// but the same information can be obtained from a MODE_SENSE instead.
// So here we emulate the former, using the latter.
Cheers
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-09-13 18:42 ` Mark Lord
2007-09-13 19:07 ` Mark Lord
@ 2007-09-19 20:50 ` Alan Cox
2007-09-22 0:28 ` Mark Lord
2007-09-21 3:07 ` Albert Lee
2 siblings, 1 reply; 13+ messages in thread
From: Alan Cox @ 2007-09-19 20:50 UTC (permalink / raw)
To: Mark Lord; +Cc: Chuck Ebbert, IDE/ATA development list, craig48
> I can read and write the tape successfully, and the written data matches
> what is later read back from it.
>
> Here's the hack I used. Not ready for mainline, but perhaps it will
> help Alan or whomever come up with something nice for Jeff.
Its possible we should just scream and shout but for robustness and
paranoia I just added ATA_HORKAGE_DRQ and skip the error setup in the
case that HORKAGE_DRQ is set.
Just need the identify data now..
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-09-19 20:50 ` Alan Cox
@ 2007-09-22 0:28 ` Mark Lord
0 siblings, 0 replies; 13+ messages in thread
From: Mark Lord @ 2007-09-22 0:28 UTC (permalink / raw)
To: Alan Cox; +Cc: Chuck Ebbert, IDE/ATA development list, craig48
Alan Cox wrote:
>> I can read and write the tape successfully, and the written data matches
>> what is later read back from it.
>>
>> Here's the hack I used. Not ready for mainline, but perhaps it will
>> help Alan or whomever come up with something nice for Jeff.
>
> Its possible we should just scream and shout but for robustness and
> paranoia I just added ATA_HORKAGE_DRQ and skip the error setup in the
> case that HORKAGE_DRQ is set.
>
> Just need the identify data now..
I duspect it's *all* ATAPI tape units. Mine (Conner) is quite a bit older
than the other (Seagate) one that began this thread. And ide-tape has no
problem with either drive. Perhaps a whitelist rather than a blacklist here.
Meanwhile, my old Conner tape unit is several hundred miles away from me at present.
Cheers
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-09-13 18:42 ` Mark Lord
2007-09-13 19:07 ` Mark Lord
2007-09-19 20:50 ` Alan Cox
@ 2007-09-21 3:07 ` Albert Lee
2 siblings, 0 replies; 13+ messages in thread
From: Albert Lee @ 2007-09-21 3:07 UTC (permalink / raw)
To: Mark Lord
Cc: Alan Cox, Chuck Ebbert, IDE/ATA development list, craig48,
Jeff Garzik
Mark Lord wrote:
>
> I can read and write the tape successfully, and the written data matches
> what is later read back from it.
>
> Here's the hack I used. Not ready for mainline, but perhaps it will
> help Alan or whomever come up with something nice for Jeff.
>
> --- 2.6.23-rc6/drivers/ata/libata-core.c 2007-09-13 09:49:16.000000000
> -0400
> +++ linux/drivers/ata/libata-core.c 2007-09-13 14:15:57.000000000 -0400
> @@ -4932,9 +4932,9 @@
> if (unlikely(status & (ATA_ERR | ATA_DF))) {
> ata_port_printk(ap, KERN_WARNING, "DRQ=1 with
> device "
> "error, dev_stat 0x%X\n", status);
> - qc->err_mask |= AC_ERR_HSM;
> - ap->hsm_task_state = HSM_ST_ERR;
> - goto fsm_start;
> + //qc->err_mask |= AC_ERR_HSM;
> + //ap->hsm_task_state = HSM_ST_ERR;
> + //goto fsm_start;
> }
>
> /* Send the CDB (atapi) or the first data block (ata pio
> out).
>
It's strange that the device reports DRQ + ERR at this point since if
it knows something wrong, asking to transfer the CDB doesn't help...
Is the device configured to MWDMA? If yes, maybe it's ATAPI DMA of
the previous command makes the device state machine confused...
Could you please try if the attached debug patch helps? Thanks.
--
albert
diff -Nrup 00_libata-dev/drivers/ata/libata-core.c 01_atapi_dma/drivers/ata/libata-core.c
--- 00_libata-dev/drivers/ata/libata-core.c 2007-09-21 10:35:54.000000000 +0800
+++ 01_atapi_dma/drivers/ata/libata-core.c 2007-09-21 10:49:20.000000000 +0800
@@ -4193,6 +4193,8 @@ static void ata_fill_sg_dumb(struct ata_
int ata_check_atapi_dma(struct ata_queued_cmd *qc)
{
struct ata_port *ap = qc->ap;
+ struct scsi_cmnd *cmd = qc->scsicmd;
+ u8 *scsicmd = cmd->cmnd;
/* Don't allow DMA if it isn't multiple of 16 bytes. Quite a
* few ATAPI devices choke on such DMA requests.
@@ -4200,6 +4202,21 @@ int ata_check_atapi_dma(struct ata_queue
if (unlikely(qc->nbytes & 15))
return 1;
+ switch (scsicmd[0]) {
+ case READ_10:
+ case WRITE_10:
+ case READ_12:
+ case WRITE_12:
+ case READ_6:
+ case WRITE_6:
+ case 0xad: /* READ_DVD_STRUCTURE */
+ case 0xbe: /* READ_CD */
+ /* ATAPI DMA maybe ok */
+ break;
+ default:
+ return 1;
+ }
+
if (ap->ops->check_atapi_dma)
return ap->ops->check_atapi_dma(qc);
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: ATAPI tape drives broken with libata
2007-08-29 22:55 ATAPI tape drives broken with libata Chuck Ebbert
2007-08-29 23:50 ` Alan Cox
@ 2007-08-30 4:00 ` Jeff Garzik
1 sibling, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2007-08-30 4:00 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: IDE/ATA development list, craig48, Alan
Chuck Ebbert wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=243568
>
> Using kernel 2.6.22:
>
> Aug 29 17:08:11 itox kernel: ata2.00: ATAPI: Seagate STT8000A, 5.51, max MWDMA2
> Aug 29 17:08:11 itox kernel: ata2.00: configured for MWDMA2
> Aug 29 17:08:11 itox kernel: scsi 1:0:0:0: Sequential-Access Seagate STT8000A 5.51 PQ: 0 ANSI: 2
> Aug 29 17:08:12 itox kernel: scsi 1:0:0:0: Attached scsi generic sg1 type 1
> Aug 29 17:08:12 itox kernel: st: Version 20070203, fixed bufsize 32768, s/g segs 256
> Aug 29 17:08:12 itox kernel: st 1:0:0:0: Attached scsi tape st0
> Aug 29 17:08:12 itox kernel: st 1:0:0:0: st0: try direct i/o: yes (alignment 512 B)
> Aug 29 17:08:12 itox kernel: ata2: DRQ=1 with device error, dev_stat 0x59
> Aug 29 17:08:12 itox kernel: ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
> Aug 29 17:08:12 itox kernel: ata2.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
> Aug 29 17:08:12 itox kernel: res 51/60:03:00:00:20/00:00:00:00:00/a0 Emask 0x3 (HSM violation)
DRQ=1 is quite unusual, and would definitely trigger the problems
further down (that I snipped)...
Jeff
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-09-22 0:28 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 22:55 ATAPI tape drives broken with libata Chuck Ebbert
2007-08-29 23:50 ` Alan Cox
2007-08-30 16:11 ` Chuck Ebbert
2007-08-31 14:19 ` Alan Cox
2007-09-13 16:35 ` Mark Lord
2007-09-13 18:22 ` Mark Lord
2007-09-13 18:42 ` Mark Lord
2007-09-13 19:07 ` Mark Lord
2007-09-13 19:09 ` Mark Lord
2007-09-19 20:50 ` Alan Cox
2007-09-22 0:28 ` Mark Lord
2007-09-21 3:07 ` Albert Lee
2007-08-30 4:00 ` Jeff Garzik
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).