Re: DVD drive fails in 2.6.20.2

2007-03-19 Thread Albert Lee
Albert Lee wrote:
 Vlad Codrea wrote:
 
Albert Lee wrote:


This is the first problem.
It's weird to see HSM violation here, without any debug task_state trace.
In your previous log, it was detected correctly with debug task_state
trace.

ata2.00: ATAPI, max MWDMA2, CDB intr
ata2.00: configured for MWDMA2
PM: Adding info for No Bus:target0:0:0
scsi 0:0:0:0: Direct-Access ATA  IBM-DADA-26480   AD6O PQ: 0
ANSI: 5
PM: Adding info for scsi:0:0:0:0
PM: Adding info for No Bus:target1:0:0
ata2: protocol 5 task_state 4
ata2: protocol 5 task_state 4 (dev_stat 0x58)
ata2: protocol 5 task_state 1
ata2: protocol 5 task_state 1 (dev_stat 0x58)
ata2: protocol 5 task_state 2
ata2: protocol 5 task_state 2 (dev_stat 0x50)
scsi 1:0:0:0: CD-ROMTORiSAN  DVD-ROM DRD-N216 1.08 PQ: 0
ANSI: 5

 


The first problem shouldn't be there -- I accidentaly copied the top
portion (before the mount command) from an old dmesg where the DMA was
still enabled. Sorry about that.

 
 
 It's ok. With the TORiSAN  DVD-ROM DRD-N216 DMA blacklisted,
 the device identify and inquiry look good. The first problem is gone. :)
 
 
libata version 2.00 loaded.
ata_piix :00:07.1: version 2.00ac7
ata1: PATA max UDMA/33 cmd 0x1F0 ctl 0x3F6 bmdma 0xFCD0 irq 14
ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xFCD8 irq 15
scsi0 : ata_piix
PM: Adding info for No Bus:host0
ata1.00: ATA-4, max UDMA/33, 12685680 sectors: LBA 
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/33
scsi1 : ata_piix
PM: Adding info for No Bus:host1
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
USB Universal Host Controller Interface driver v3.0
ata2: protocol 2 task_state 1 (dev_stat 0x58)
ata2: protocol 2 task_state 2 (dev_stat 0x50)
ata2.00: ATAPI, max MWDMA2, CDB intr
ata2.00: device is on DMA blacklist, disabling DMA
ata2: protocol 1 task_state 2
ata2: host_stat 0x4
ata2: protocol 1 task_state 2 (dev_stat 0x50)
ata2: protocol 2 task_state 1 (dev_stat 0x58)
ata2: protocol 2 task_state 2 (dev_stat 0x50)
ata2.00: configured for PIO4
PM: Adding info for No Bus:target0:0:0
scsi 0:0:0:0: Direct-Access ATA  IBM-DADA-26480   AD6O PQ: 0 ANSI: 5
PM: Adding info for scsi:0:0:0:0
PM: Adding info for No Bus:target1:0:0
CDB (2:0,0,0) 12 00 00 00 24 00 00 00 00
ata2: protocol 5 task_state 4
ata2: host_stat 0x4
ata2: protocol 5 task_state 4 (dev_stat 0x58)
ata2: protocol 5 task_state 1
ata2: host_stat 0x4
ata2: protocol 5 task_state 1 (dev_stat 0x58)
ata2: protocol 5 task_state 1
ata2: host_stat 0x4
ata2: protocol 5 task_state 1 (dev_stat 0x50)
ata2: protocol 5 task_state 2 (dev_stat 0x50)
scsi 1:0:0:0: CD-ROMTORiSAN  DVD-ROM DRD-N216 1.08 PQ: 0 ANSI: 5
 
 
 

This is the second problem. The device firmware/state machine stopped
working suddenly. The INTRQ was not cleared even after the device status
register was read. And the device status was struck to 0x58.
Let the device transfer the trailing data without limitation didn't help.

Vlad, could you please apply the attached debug patch. The patch
1. adds your TORiSAM drive to the DMA blacklist
  (so, we don't need to the check_atapi_dma() change this time)
2. adds more debug trace

 


I have attached the dmesg generated after applying this patch.


For the 2nd problem, could you please try change the medium and copy
the data from another known to be good CD? It might be the medium that
caused the device firmware malfunction.
 


I have switched mediums to another pressed CD that I know works on my
other computer and on this laptop when it is booted in Windows 98.

 
 
 # Inserted CD and ran mount /dev/sr0 /root/cdrom #
 = This part looks good as before.
 
 # Ran cp -r /root/cdrom /root/cdrom_copy #
 = Looks bad, the the trailing data problem still exists even after the
 medium is replaced. And the device stopped working.
 
From the following trace, it is not clear what happened right before the 
crash.
 Could you please sent me the full dmesg.
 (If it is too big for the mailing list, please gzip and send to my e-mail
 address as attachment.)
 

Ah, just saw this on bugzilla (bug 6710):
(http://bugzilla.kernel.org/show_bug.cgi?id=6710).

So, if ok, please attach the full dmesg to the bugzilla to keep record,
thanks.

--
albert

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVD drive fails in 2.6.20.2

2007-03-19 Thread Vlad Codrea

Albert Lee wrote:

From the following trace, it is not clear what happened right before the crash.
Could you please sent me the full dmesg.
(If it is too big for the mailing list, please gzip and send to my e-mail
address as attachment.)




Ah, just saw this on bugzilla (bug 6710):
(http://bugzilla.kernel.org/show_bug.cgi?id=6710).

So, if ok, please attach the full dmesg to the bugzilla to keep record,

  



I've attached the full dmesg at:

http://bugzilla.kernel.org/show_bug.cgi?id=6710#c11

Thank you,
Vlad
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVD drive fails in 2.6.20.2

2007-03-18 Thread Albert Lee
Vlad Codrea wrote:
 Albert Lee wrote:
 
 Vlad Codrea wrote:
  

 Albert Lee wrote:



 ata2: protocol 7 task_state 4   === The device interrupts to
 receive CDB
 ata2: protocol 7 task_state 4 (dev_stat 0x58)  == Good, DRQ seen. CDB
 sent.
 ata2: protocol 7 task_state 2   === interrupt. We expect DMA complete.
 ata2: protocol 7 task_state 2 (dev_stat 0x58) == What? DRQ set? No
 good.
 ata2: protocol 7 task_state 3 (dev_stat 0x58) == HSM violation.
 (BMDMA stat 0x5) === Interrupted, DMA active.

 Still no clue why the device wrongly sets DRQ here for a DMA
 transfer...
 Possibilities:
 1. HSM sent all CDB to the device, but the device is waiting for more
 CDB data?
 2. HSM asked the drive to do ATAPI DMA, but the drive is doing PIO?

 Hi Vlad,

 Could you please turn off ATAPI DMA and see if the drive works under
 PIO,
 thanks.

 -- 
 albert

 (This is not a patch. Please edit drivers/ata/libata-core.c as below.)

 int ata_check_atapi_dma(struct ata_queued_cmd *qc)
 {
 struct ata_port *ap = qc-ap;
 int rc = 0; /* Assume ATAPI DMA is OK by default */

 if (ap-ops-check_atapi_dma)
 rc = ap-ops-check_atapi_dma(qc);

  rc = 1; ( Please add rc = 1; here to turn off ATAPI DMA. )

 return rc;
 }
 

 Hi,

 After adding rc = 1;, the drive now appears as /dev/sr0. I've attached
 an annotated dmesg: the first part contains the messages immediately
 after booting. The second part contains messages after I inserted a CD
 and ran  mount /dev/sr0 /root/cdrom. The third part contains messages
 after I ran cp -r /root/cdrom /root/cdrom_copy. I separated the parts
 by adding lines containing #.

 The recursive copy fails after about 10 seconds, even though a few files
 are copied.

 


 Ok, as Tejun said, PIO looks better than DMA, but still has problems.
 Two problems seen:

  

 ata2: protocol 5 task_state 4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2 (dev_stat 0x50)
 


 1. The drive interrups when it is still BSY.

  

 ata2: protocol 5 task_state 4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x50)
 ata2: protocol 5 task_state 2 (dev_stat 0x50)
 ata2: protocol 5 task_state 4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2.00: 59392 bytes trailing data
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2 (dev_stat 0x58)
 ata2: protocol 5 task_state 3 (dev_stat 0x58)
 ata2.00: ata_eh_analyze_tf, AC_ERR_HSM, 0x58
 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata2.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x28 data
 79872 in
  res 58/00:02:00:00:f8/00:00:00:00:00/a0 Emask 0x2 (HSM
 violation)
 


 2. The drive wants to transfer more data than expected.
Libata transfers some of the trailing data. But when the drive asks
to tranfer even more trailing data, libata forces it to stop by HSM
 violation.

  

 ata2: soft resetting port
 ata2: port is slow to respond, please be patient (Status 0xd8)
 ata2: port failed to respond (30 secs, Status 0xd8)
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ata2.00: qc timeout (cmd 0xa1)
 ata2.00: failed to IDENTIFY (I/O error, err_mask=0x4)
 ata2.00: revalidation failed (errno=-5)
 ata2: failed to recover some devices, retrying in 5 secs
 


 3. After the HSM violation, the drive stays BSY after the EH resets it.
It seems doesn't like the recovery actions and totally lost.

 Could you please try the attached patch (together with the previous
 debug patches).
 This patch let the drive transfer all of the trailing data it wants to.

 The data transferred might be junk. So, please also verify the files
 copied.
 (e.g. If the file copied from the CD is *.gz file, please do gunzip
 -tv foo.gz.)

 -- 
 albert

 --- linux-2.6.20.3/drivers/ata/libata-core.c2007-03-14
 02:27:08.0 +0800
 +++ 

Re: DVD drive fails in 2.6.20.2

2007-03-18 Thread Albert Lee
Vlad Codrea wrote:
 Albert Lee wrote:
 
 This is the first problem.
 It's weird to see HSM violation here, without any debug task_state trace.
 In your previous log, it was detected correctly with debug task_state
 trace.

 ata2.00: ATAPI, max MWDMA2, CDB intr
 ata2.00: configured for MWDMA2
 PM: Adding info for No Bus:target0:0:0
 scsi 0:0:0:0: Direct-Access ATA  IBM-DADA-26480   AD6O PQ: 0
 ANSI: 5
 PM: Adding info for scsi:0:0:0:0
 PM: Adding info for No Bus:target1:0:0
 ata2: protocol 5 task_state 4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2 (dev_stat 0x50)
 scsi 1:0:0:0: CD-ROMTORiSAN  DVD-ROM DRD-N216 1.08 PQ: 0
 ANSI: 5

  

 
 The first problem shouldn't be there -- I accidentaly copied the top
 portion (before the mount command) from an old dmesg where the DMA was
 still enabled. Sorry about that.
 

It's ok. With the TORiSAN  DVD-ROM DRD-N216 DMA blacklisted,
the device identify and inquiry look good. The first problem is gone. :)

 libata version 2.00 loaded.
 ata_piix :00:07.1: version 2.00ac7
 ata1: PATA max UDMA/33 cmd 0x1F0 ctl 0x3F6 bmdma 0xFCD0 irq 14
 ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xFCD8 irq 15
 scsi0 : ata_piix
 PM: Adding info for No Bus:host0
 ata1.00: ATA-4, max UDMA/33, 12685680 sectors: LBA 
 ata1.00: ata1: dev 0 multi count 16
 ata1.00: configured for UDMA/33
 scsi1 : ata_piix
 PM: Adding info for No Bus:host1
 usbcore: registered new interface driver usbfs
 usbcore: registered new interface driver hub
 usbcore: registered new device driver usb
 USB Universal Host Controller Interface driver v3.0
 ata2: protocol 2 task_state 1 (dev_stat 0x58)
 ata2: protocol 2 task_state 2 (dev_stat 0x50)
 ata2.00: ATAPI, max MWDMA2, CDB intr
 ata2.00: device is on DMA blacklist, disabling DMA
 ata2: protocol 1 task_state 2
 ata2: host_stat 0x4
 ata2: protocol 1 task_state 2 (dev_stat 0x50)
 ata2: protocol 2 task_state 1 (dev_stat 0x58)
 ata2: protocol 2 task_state 2 (dev_stat 0x50)
 ata2.00: configured for PIO4
 PM: Adding info for No Bus:target0:0:0
 scsi 0:0:0:0: Direct-Access ATA  IBM-DADA-26480   AD6O PQ: 0 ANSI: 5
 PM: Adding info for scsi:0:0:0:0
 PM: Adding info for No Bus:target1:0:0
 CDB (2:0,0,0) 12 00 00 00 24 00 00 00 00
 ata2: protocol 5 task_state 4
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 1 (dev_stat 0x50)
 ata2: protocol 5 task_state 2 (dev_stat 0x50)
 scsi 1:0:0:0: CD-ROMTORiSAN  DVD-ROM DRD-N216 1.08 PQ: 0 ANSI: 5




 This is the second problem. The device firmware/state machine stopped
 working suddenly. The INTRQ was not cleared even after the device status
 register was read. And the device status was struck to 0x58.
 Let the device transfer the trailing data without limitation didn't help.

 Vlad, could you please apply the attached debug patch. The patch
 1. adds your TORiSAM drive to the DMA blacklist
   (so, we don't need to the check_atapi_dma() change this time)
 2. adds more debug trace

  

 
 I have attached the dmesg generated after applying this patch.
 
 For the 2nd problem, could you please try change the medium and copy
 the data from another known to be good CD? It might be the medium that
 caused the device firmware malfunction.
  

 
 I have switched mediums to another pressed CD that I know works on my
 other computer and on this laptop when it is booted in Windows 98.
 

# Inserted CD and ran mount /dev/sr0 /root/cdrom #
= This part looks good as before.

# Ran cp -r /root/cdrom /root/cdrom_copy #
= Looks bad, the the trailing data problem still exists even after the
medium is replaced. And the device stopped working.

From the following trace, it is not clear what happened right before the crash.
Could you please sent me the full dmesg.
(If it is too big for the mailing list, please gzip and send to my e-mail
address as attachment.)

--
Thanks,

Albert

 
 -- snip --
 
 ata2.00: 63488 bytes trailing data
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2.00: 63488 bytes trailing data
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2.00: 63488 bytes trailing data
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2.00: 63488 bytes trailing data
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2.00: 63488 bytes trailing data
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2.00: 63488 bytes trailing data
 ata2: protocol 5 task_state 1
 ata2: host_stat 0x4
 ata2: protocol 

Re: DVD drive fails in 2.6.20.2

2007-03-16 Thread Albert Lee
Vlad Codrea wrote:

 
 Hi,
 
 I've attached the full dmesg after applying Albert's patch. The new
 messages seem to be:
 
 ata2: protocol 7 task_state 4
 ata2: protocol 7 task_state 4 (dev_stat 0x58)
 ata2: protocol 7 task_state 2
 ata2: protocol 7 task_state 2 (dev_stat 0x58)
 ata2: protocol 7 task_state 3 (dev_stat 0x58)
 
 
snip

 libata version 2.00 loaded.
 ata_piix :00:07.1: version 2.00ac7
 ata1: PATA max UDMA/33 cmd 0x1F0 ctl 0x3F6 bmdma 0xFCF0 irq 14
 ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xFCF8 irq 15
 scsi0 : ata_piix
 PM: Adding info for No Bus:host0
 usbcore: registered new interface driver usbfs
 usbcore: registered new interface driver hub
 usbcore: registered new device driver usb
 USB Universal Host Controller Interface driver v3.0
 ata1.00: ATA-4, max UDMA/33, 12685680 sectors: LBA 
 ata1.00: ata1: dev 0 multi count 16
 ata1.00: configured for UDMA/33
 scsi1 : ata_piix
 PM: Adding info for No Bus:host1
 ata2.00: ATAPI, max MWDMA2, CDB intr
 ata2.00: configured for MWDMA2
 PM: Adding info for No Bus:target0:0:0
 scsi 0:0:0:0: Direct-Access ATA  IBM-DADA-26480   AD6O PQ: 0 ANSI: 5
 PM: Adding info for scsi:0:0:0:0
 PM: Adding info for No Bus:target1:0:0
 ata2: protocol 7 task_state 4
 ata2: protocol 7 task_state 4 (dev_stat 0x58)
 ata2: protocol 7 task_state 2
 ata2: protocol 7 task_state 2 (dev_stat 0x58)
 ata2: protocol 7 task_state 3 (dev_stat 0x58)
 ata2.00: ata_eh_analyze_tf, AC_ERR_HSM, 0x58
 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata2.00: (BMDMA stat 0x5)
 ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
  res 58/00:02:00:24:00/00:00:00:00:00/a0 Emask 0x2 (HSM violation)
 ata2: soft resetting port
 ata2: port is slow to respond, please be patient (Status 0xd8)
 ata2: port failed to respond (30 secs, Status 0xd8)
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177

ata2: protocol 7 task_state 4   === The device interrupts to receive CDB
ata2: protocol 7 task_state 4 (dev_stat 0x58)  == Good, DRQ seen. CDB sent.
ata2: protocol 7 task_state 2   === interrupt. We expect DMA complete.
ata2: protocol 7 task_state 2 (dev_stat 0x58) == What? DRQ set? No good.
ata2: protocol 7 task_state 3 (dev_stat 0x58) == HSM violation.
(BMDMA stat 0x5) === Interrupted, DMA active.

Still no clue why the device wrongly sets DRQ here for a DMA transfer...
Possibilities:
1. HSM sent all CDB to the device, but the device is waiting for more CDB data?
2. HSM asked the drive to do ATAPI DMA, but the drive is doing PIO?

Hi Vlad,

Could you please turn off ATAPI DMA and see if the drive works under PIO,
thanks.

--
albert

(This is not a patch. Please edit drivers/ata/libata-core.c as below.)

int ata_check_atapi_dma(struct ata_queued_cmd *qc)
{
struct ata_port *ap = qc-ap;
int rc = 0; /* Assume ATAPI DMA is OK by default */

if (ap-ops-check_atapi_dma)
rc = ap-ops-check_atapi_dma(qc);

 rc = 1; ( Please add rc = 1; here to turn off ATAPI DMA. )

return rc;
}

-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVD drive fails in 2.6.20.2

2007-03-16 Thread Albert Lee
Vlad Codrea wrote:
 Albert Lee wrote:
 
 ata2: protocol 7 task_state 4   === The device interrupts to receive CDB
 ata2: protocol 7 task_state 4 (dev_stat 0x58)  == Good, DRQ seen. CDB
 sent.
 ata2: protocol 7 task_state 2   === interrupt. We expect DMA complete.
 ata2: protocol 7 task_state 2 (dev_stat 0x58) == What? DRQ set? No good.
 ata2: protocol 7 task_state 3 (dev_stat 0x58) == HSM violation.
 (BMDMA stat 0x5) === Interrupted, DMA active.

 Still no clue why the device wrongly sets DRQ here for a DMA transfer...
 Possibilities:
 1. HSM sent all CDB to the device, but the device is waiting for more
 CDB data?
 2. HSM asked the drive to do ATAPI DMA, but the drive is doing PIO?

 Hi Vlad,

 Could you please turn off ATAPI DMA and see if the drive works under PIO,
 thanks.

 -- 
 albert

 (This is not a patch. Please edit drivers/ata/libata-core.c as below.)

 int ata_check_atapi_dma(struct ata_queued_cmd *qc)
 {
 struct ata_port *ap = qc-ap;
 int rc = 0; /* Assume ATAPI DMA is OK by default */

 if (ap-ops-check_atapi_dma)
 rc = ap-ops-check_atapi_dma(qc);

  rc = 1; ( Please add rc = 1; here to turn off ATAPI DMA. )

 return rc;
 }
   
 
 
 Hi,
 
 After adding rc = 1;, the drive now appears as /dev/sr0. I've attached
 an annotated dmesg: the first part contains the messages immediately
 after booting. The second part contains messages after I inserted a CD
 and ran  mount /dev/sr0 /root/cdrom. The third part contains messages
 after I ran cp -r /root/cdrom /root/cdrom_copy. I separated the parts
 by adding lines containing #.
 
 The recursive copy fails after about 10 seconds, even though a few files
 are copied.
 

Ok, as Tejun said, PIO looks better than DMA, but still has problems.
Two problems seen:

 ata2: protocol 5 task_state 4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2 (dev_stat 0x50)

1. The drive interrups when it is still BSY.

 ata2: protocol 5 task_state 4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x50)
 ata2: protocol 5 task_state 2 (dev_stat 0x50)
 ata2: protocol 5 task_state 4
 ata2: protocol 5 task_state 4 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2: protocol 5 task_state 1
 ata2: protocol 5 task_state 1 (dev_stat 0x58)
 ata2.00: 59392 bytes trailing data
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2
 ata2: protocol 5 task_state 2 (dev_stat 0x58)
 ata2: protocol 5 task_state 3 (dev_stat 0x58)
 ata2.00: ata_eh_analyze_tf, AC_ERR_HSM, 0x58
 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata2.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x28 data 79872 in
  res 58/00:02:00:00:f8/00:00:00:00:00/a0 Emask 0x2 (HSM violation)

2. The drive wants to transfer more data than expected.
   Libata transfers some of the trailing data. But when the drive asks
   to tranfer even more trailing data, libata forces it to stop by HSM 
violation.

 ata2: soft resetting port
 ata2: port is slow to respond, please be patient (Status 0xd8)
 ata2: port failed to respond (30 secs, Status 0xd8)
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 ata2.00: qc timeout (cmd 0xa1)
 ata2.00: failed to IDENTIFY (I/O error, err_mask=0x4)
 ata2.00: revalidation failed (errno=-5)
 ata2: failed to recover some devices, retrying in 5 secs

3. After the HSM violation, the drive stays BSY after the EH resets it.
   It seems doesn't like the recovery actions and totally lost.

Could you please try the attached patch (together with the previous debug 
patches).
This patch let the drive transfer all of the trailing data it wants to.

The data transferred might be junk. So, please also verify the files copied.
(e.g. If the file copied from the CD is *.gz file, please do gunzip -tv foo.gz.)

--
albert

--- linux-2.6.20.3/drivers/ata/libata-core.c2007-03-14 02:27:08.0 
+0800
+++ linux-2.6.20.3-mod/drivers/ata/libata-core.c2007-03-17 
12:16:36.0 +0800
@@ -4143,8 +4143,8 @@ static void 

Re: DVD drive fails in 2.6.20.2

2007-03-15 Thread Vlad Codrea

Tejun Heo wrote:

[cc'ing Albert Lee.  Hi!]

Vlad Codrea wrote:
  

Okay, now that you're on libata driver, it's easier for me to debug.
Can you apply the attached patch over 2.6.20 and report what the kernel
says? (the patch will apply with some noise, it's okay)
  

I've applied your patch and recompiled the kernel, but the new dmesg
(attached as dmesg_2.txt) doesn't seem to have changed much.



Hmmm.. that's weird, can you please try the attached patch?

Albert, can you take a look at this one?  I'm pretty sure you know much
better about this than me.  The whole thread can be read at...

  http://thread.gmane.org/gmane.linux.ide/17052

Thanks.

  



diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 14629a3..855d33a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4382,6 +4382,12 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd 
*qc, int in_wq)
 */
qc = ata_qc_from_tag(ap, qc-tag);
if (qc) {
+   if ((qc-flags  ATA_QCFLAG_FAILED) ||
+   qc-err_mask)
+   ata_port_printk(ap, KERN_WARNING,
+   hsm_qc_complete: 
+   flags=0x%lx err_mask=0x%x\n,
+   qc-flags, qc-err_mask);
if (likely(!(qc-err_mask  AC_ERR_HSM))) {
ap-ops-irq_on(ap);
ata_qc_complete(qc);
@@ -4453,9 +4459,13 @@ fsm_start:
if (likely(status  (ATA_ERR | ATA_DF)))
/* device stops HSM for abort/error */
qc-err_mask |= AC_ERR_DEV;
-   else
+   else {
/* HSM violation. Let EH handle this */
+   ata_port_printk(ap, KERN_WARNING,
+   !DRQ on HSM_ST_FIRST (0x%x)\n,
+   status);
qc-err_mask |= AC_ERR_HSM;
+   }
 
 			ap-hsm_task_state = HSM_ST_ERR;

goto fsm_start;
@@ -4547,13 +4557,17 @@ fsm_start:
if (likely(status  (ATA_ERR | ATA_DF)))
/* device stops HSM for abort/error */
qc-err_mask |= AC_ERR_DEV;
-   else
+   else {
+   ata_port_printk(ap, KERN_WARNING,
+   !DRQ on HSM_ST (0x%x)\n,
+   status);
/* HSM violation. Let EH handle this.
 * Phantom devices also trigger this
 * condition.  Mark hint.
 */
qc-err_mask |= AC_ERR_HSM |
AC_ERR_NODEV_HINT;
+   }
 
 ap-hsm_task_state = HSM_ST_ERR;

goto fsm_start;
@@ -4579,8 +4593,12 @@ fsm_start:
status = ata_wait_idle(ap);
}
 
-if (status  (ATA_BUSY | ATA_DRQ))

+   if (status  (ATA_BUSY | ATA_DRQ)) {
+   ata_port_printk(ap, KERN_WARNING,
+   BUSY|DRQ on ERR|DF (0x%x)\n,
+   status);
qc-err_mask |= AC_ERR_HSM;
+   }
 
 /* ata_pio_sectors() might change the

 * state to HSM_ST_LAST. so, the state
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7349c3d..a956aaa 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1146,6 +1146,8 @@ static unsigned int ata_eh_analyze_tf(struct 
ata_queued_cmd *qc,
u8 stat = tf-command, err = tf-feature;
 
 	if ((stat  (ATA_BUSY | ATA_DRQ | ATA_DRDY)) != ATA_DRDY) {

+   ata_dev_printk(qc-dev, KERN_WARNING,
+  ata_eh_analyze_tf, AC_ERR_HSM, 0x%x\n, stat);
qc-err_mask |= AC_ERR_HSM;
return ATA_EH_SOFTRESET;
}
  


I've attached the dmesg after applying this patch. There is now a new 
line reading ata2.00: ata_eh_analyze_tf, AC_ERR_HSM, 0x58.


Thank you,
Vlad
Linux version 2.6.20.2 ([EMAIL PROTECTED]) (gcc version 4.1.2 20061115 
(prerelease) 

Re: DVD drive fails in 2.6.20.2

2007-03-15 Thread Albert Lee
Vlad Codrea wrote:
 Tejun Heo wrote:
 
 [cc'ing Albert Lee.  Hi!]

 Vlad Codrea wrote:
  

 Okay, now that you're on libata driver, it's easier for me to debug.
 Can you apply the attached patch over 2.6.20 and report what the kernel
 says? (the patch will apply with some noise, it's okay)
   

 I've applied your patch and recompiled the kernel, but the new dmesg
 (attached as dmesg_2.txt) doesn't seem to have changed much.
 


 Hmmm.. that's weird, can you please try the attached patch?

 Albert, can you take a look at this one?  I'm pretty sure you know much
 better about this than me.  The whole thread can be read at...

   http://thread.gmane.org/gmane.linux.ide/17052

 Thanks.

  
 
 
 I've attached the dmesg after applying this patch. There is now a new
 line reading ata2.00: ata_eh_analyze_tf, AC_ERR_HSM, 0x58.
 

This device is configured as MWDMA2:
  ata2.00: ATAPI, max MWDMA2, CDB intr
  ata2.00: configured for MWDMA2 
The state machine should start at HSM_ST_FIRST to transfer CDB then
transit to HSM_ST_LAST after DMA is completed.

Device status 0x58 looks good for HSM_ST_FIRST, maybe libata is
seeing 0x58 in the HSM_ST_LAST state?

Hi Vlad,

Could you please also apply the attached HSM debug patch and collect the dmesg,
thanks.

--
albert

--- linux-2.6.20.3/drivers/ata/libata-core.c2007-03-15 12:13:12.0 
+0800
+++ linux-2.6.20.3-mod/drivers/ata/libata-core.c2007-03-15 
12:13:55.0 +0800
@@ -4371,8 +4371,9 @@ int ata_hsm_move(struct ata_port *ap, st
WARN_ON(in_wq != ata_hsm_ok_in_wq(ap, qc));
 
 fsm_start:
-   DPRINTK(ata%u: protocol %d task_state %d (dev_stat 0x%X)\n,
-   ap-id, qc-tf.protocol, ap-hsm_task_state, status);
+   if (is_atapi_taskfile(qc-tf))
+   printk(KERN_ERR ata%u: protocol %d task_state %d (dev_stat 
0x%X)\n,
+  ap-id, qc-tf.protocol, ap-hsm_task_state, status);
 
switch (ap-hsm_task_state) {
case HSM_ST_FIRST:
@@ -5091,8 +5092,9 @@ inline unsigned int ata_host_intr (struc
struct ata_eh_info *ehi = ap-eh_info;
u8 status, host_stat = 0;
 
-   VPRINTK(ata%u: protocol %d task_state %d\n,
-   ap-id, qc-tf.protocol, ap-hsm_task_state);
+   if (is_atapi_taskfile(qc-tf))
+   printk(KERN_ERR ata%u: protocol %d task_state %d\n,
+  ap-id, qc-tf.protocol, ap-hsm_task_state);
 
/* Check whether we are expecting interrupt in this state */
switch (ap-hsm_task_state) {




-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVD drive fails in 2.6.20.2

2007-03-15 Thread Vlad Codrea

Albert Lee wrote:

This device is configured as MWDMA2:
  ata2.00: ATAPI, max MWDMA2, CDB intr
  ata2.00: configured for MWDMA2 
The state machine should start at HSM_ST_FIRST to transfer CDB then

transit to HSM_ST_LAST after DMA is completed.

Device status 0x58 looks good for HSM_ST_FIRST, maybe libata is
seeing 0x58 in the HSM_ST_LAST state?

Hi Vlad,

Could you please also apply the attached HSM debug patch and collect the dmesg,
thanks.

--
albert

--- linux-2.6.20.3/drivers/ata/libata-core.c2007-03-15 12:13:12.0 
+0800
+++ linux-2.6.20.3-mod/drivers/ata/libata-core.c2007-03-15 
12:13:55.0 +0800
@@ -4371,8 +4371,9 @@ int ata_hsm_move(struct ata_port *ap, st
WARN_ON(in_wq != ata_hsm_ok_in_wq(ap, qc));
 
 fsm_start:

-   DPRINTK(ata%u: protocol %d task_state %d (dev_stat 0x%X)\n,
-   ap-id, qc-tf.protocol, ap-hsm_task_state, status);
+   if (is_atapi_taskfile(qc-tf))
+   printk(KERN_ERR ata%u: protocol %d task_state %d (dev_stat 
0x%X)\n,
+  ap-id, qc-tf.protocol, ap-hsm_task_state, status);
 
 	switch (ap-hsm_task_state) {

case HSM_ST_FIRST:
@@ -5091,8 +5092,9 @@ inline unsigned int ata_host_intr (struc
struct ata_eh_info *ehi = ap-eh_info;
u8 status, host_stat = 0;
 
-	VPRINTK(ata%u: protocol %d task_state %d\n,

-   ap-id, qc-tf.protocol, ap-hsm_task_state);
+   if (is_atapi_taskfile(qc-tf))
+   printk(KERN_ERR ata%u: protocol %d task_state %d\n,
+  ap-id, qc-tf.protocol, ap-hsm_task_state);
 
 	/* Check whether we are expecting interrupt in this state */

switch (ap-hsm_task_state) {

  



Hi,

I've attached the full dmesg after applying Albert's patch. The new 
messages seem to be:


ata2: protocol 7 task_state 4
ata2: protocol 7 task_state 4 (dev_stat 0x58)
ata2: protocol 7 task_state 2
ata2: protocol 7 task_state 2 (dev_stat 0x58)
ata2: protocol 7 task_state 3 (dev_stat 0x58)

Thanks,
Vlad

Linux version 2.6.20.2 ([EMAIL PROTECTED]) (gcc version 4.1.2 20061115 
(prerelease) (Debian 4.1.1-21)) #1 SMP PREEMPT Mon Mar 12 05:24:53 CDT 2007
BIOS-provided physical RAM map:
sanitize start
sanitize end
copy_e820_map() start:  size: 0009f800 end: 
0009f800 type: 1
copy_e820_map() type is E820_RAM
copy_e820_map() start: 0009f800 size: 0800 end: 
000a type: 2
copy_e820_map() start: 000f0400 size: fc00 end: 
0010 type: 2
copy_e820_map() start: 0010 size: 05f0 end: 
0600 type: 1
copy_e820_map() type is E820_RAM
copy_e820_map() start: 0400 size: fc00 end: 
0001 type: 2
 BIOS-e820:  - 0009f800 (usable)
 BIOS-e820: 0009f800 - 000a (reserved)
 BIOS-e820: 000f0400 - 0010 (reserved)
 BIOS-e820: 0010 - 0600 (usable)
 BIOS-e820: 0400 - 0001 (reserved)
0MB HIGHMEM available.
96MB LOWMEM available.
Entering add_active_range(0, 0, 24576) 0 entries of 256 used
Zone PFN ranges:
  DMA 0 - 4096
  Normal   4096 -24576
  HighMem 24576 -24576
early_node_map[1] active PFN ranges
0:0 -24576
On node 0 totalpages: 24576
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 160 pages used for memmap
  Normal zone: 20320 pages, LIFO batch:3
  HighMem zone: 0 pages used for memmap
DMI not present or invalid.
Allocating PCI resources starting at 1000 (gap: 0600:f9ff0400)
Detected 232.124 MHz processor.
Built 1 zonelists.  Total pages: 24384
Kernel command line: root=/dev/sda2 ro 
Local APIC disabled by BIOS -- you can enable it with lapic
mapped APIC to d000 (010c9000)
Enabling fast FPU save and restore... done.
Initializing CPU#0
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour VGA+ 80x25
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 90960k/98304k available (1471k kernel code, 6888k reserved, 540k data, 
256k init, 0k highmem)
virtual kernel memory layout:
fixmap  : 0xfff54000 - 0xf000   ( 684 kB)
pkmap   : 0xff80 - 0xffc0   (4096 kB)
vmalloc : 0xc680 - 0xff7fe000   ( 911 MB)
lowmem  : 0xc000 - 0xc600   (  96 MB)
  .init : 0xc02fd000 - 0xc033d000   ( 256 kB)
  .data : 0xc026fd35 - 0xc02f6fb4   ( 540 kB)
  .text : 0xc010 - 0xc026fd35   (1471 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 465.02 BogoMIPS (lpj=930044)
Security Framework v1.0.0 initialized
SELinux:  Disabled at boot.
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 0183f9ff     
 

Re: DVD drive fails in 2.6.20.2

2007-03-14 Thread Vlad Codrea

Vlad Codrea wrote:

Tejun Heo wrote:

Vlad Codrea wrote:
 

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
ata2.00: (BMDMA stat 0x25)
ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 
36 in
res 58/00:02:00:24:00/00:00:00:00:00/a0 Emask 0x2 (HSM 
violation)

ata2: soft resetting port
ata2: port is slow to respond, please be patient (Status 0xd8)
ata2: port failed to respond (30 secs, Status 0xd8)
ATA: abnormal status 0xD8 on port 0x177
ATA: abnormal status 0xD8 on port 0x177



Okay, now that you're on libata driver, it's easier for me to debug.
Can you apply the attached patch over 2.6.20 and report what the kernel
says? (the patch will apply with some noise, it's okay)
  



I've applied your patch and recompiled the kernel, but the new dmesg 
(attached as dmesg_2.txt) doesn't seem to have changed much.


After doing a cold reboot without an inserted CD, it's now saying 
ata2.00: (BMDMA stat 0x5)  instead of ata2.00: (BMDMA stat 0x25) I'm 
not sure whether this is significant...


Vlad
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVD drive fails in 2.6.20.2

2007-03-14 Thread Tejun Heo
[cc'ing Albert Lee.  Hi!]

Vlad Codrea wrote:
 Okay, now that you're on libata driver, it's easier for me to debug.
 Can you apply the attached patch over 2.6.20 and report what the kernel
 says? (the patch will apply with some noise, it's okay)
 
 I've applied your patch and recompiled the kernel, but the new dmesg
 (attached as dmesg_2.txt) doesn't seem to have changed much.

Hmmm.. that's weird, can you please try the attached patch?

Albert, can you take a look at this one?  I'm pretty sure you know much
better about this than me.  The whole thread can be read at...

  http://thread.gmane.org/gmane.linux.ide/17052

Thanks.

-- 
tejun
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 14629a3..855d33a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4382,6 +4382,12 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq)
 			 */
 			qc = ata_qc_from_tag(ap, qc-tag);
 			if (qc) {
+if ((qc-flags  ATA_QCFLAG_FAILED) ||
+qc-err_mask)
+	ata_port_printk(ap, KERN_WARNING,
+		hsm_qc_complete: 
+		flags=0x%lx err_mask=0x%x\n,
+		qc-flags, qc-err_mask);
 if (likely(!(qc-err_mask  AC_ERR_HSM))) {
 	ap-ops-irq_on(ap);
 	ata_qc_complete(qc);
@@ -4453,9 +4459,13 @@ fsm_start:
 			if (likely(status  (ATA_ERR | ATA_DF)))
 /* device stops HSM for abort/error */
 qc-err_mask |= AC_ERR_DEV;
-			else
+			else {
 /* HSM violation. Let EH handle this */
+ata_port_printk(ap, KERN_WARNING,
+		!DRQ on HSM_ST_FIRST (0x%x)\n,
+		status);
 qc-err_mask |= AC_ERR_HSM;
+			}
 
 			ap-hsm_task_state = HSM_ST_ERR;
 			goto fsm_start;
@@ -4547,13 +4557,17 @@ fsm_start:
 if (likely(status  (ATA_ERR | ATA_DF)))
 	/* device stops HSM for abort/error */
 	qc-err_mask |= AC_ERR_DEV;
-else
+else {
+	ata_port_printk(ap, KERN_WARNING,
+		!DRQ on HSM_ST (0x%x)\n,
+		status);
 	/* HSM violation. Let EH handle this.
 	 * Phantom devices also trigger this
 	 * condition.  Mark hint.
 	 */
 	qc-err_mask |= AC_ERR_HSM |
 			AC_ERR_NODEV_HINT;
+}
 
 ap-hsm_task_state = HSM_ST_ERR;
 goto fsm_start;
@@ -4579,8 +4593,12 @@ fsm_start:
 	status = ata_wait_idle(ap);
 }
 
-if (status  (ATA_BUSY | ATA_DRQ))
+if (status  (ATA_BUSY | ATA_DRQ)) {
+	ata_port_printk(ap, KERN_WARNING,
+		BUSY|DRQ on ERR|DF (0x%x)\n,
+		status);
 	qc-err_mask |= AC_ERR_HSM;
+}
 
 /* ata_pio_sectors() might change the
  * state to HSM_ST_LAST. so, the state
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7349c3d..a956aaa 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1146,6 +1146,8 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
 	u8 stat = tf-command, err = tf-feature;
 
 	if ((stat  (ATA_BUSY | ATA_DRQ | ATA_DRDY)) != ATA_DRDY) {
+		ata_dev_printk(qc-dev, KERN_WARNING,
+			   ata_eh_analyze_tf, AC_ERR_HSM, 0x%x\n, stat);
 		qc-err_mask |= AC_ERR_HSM;
 		return ATA_EH_SOFTRESET;
 	}


Re: DVD drive fails in 2.6.20.2

2007-03-13 Thread Tejun Heo
Vlad Codrea wrote:
 Hi,
 
 The DVD-ROM drive on my laptop does not work with the vanilla 2.6.20.2
 kernel using drivers/ata. The attached file dmesg.txt contains the full
 dmesg output including the error messages. I have also attached the
 .config file I used when compiling the kernel. The DVD device does not
 appear under /dev (only /dev/sda shows up, which is the hard drive).
 
 The ATA-related errors seem to start with:
 
 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata2.00: (BMDMA stat 0x25)
 ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
 res 58/00:02:00:24:00/00:00:00:00:00/a0 Emask 0x2 (HSM violation)
 ata2: soft resetting port
 ata2: port is slow to respond, please be patient (Status 0xd8)
 ata2: port failed to respond (30 secs, Status 0xd8)
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177
 
 I should point out that this DVD drive hasn't worked with drivers/ide
 either, but it works perfectly under Windows 98. For background on this
 bug, please see:
 
 https://bugzilla.novell.com/show_bug.cgi?id=177050
 http://bugzilla.kernel.org/show_bug.cgi?id=6710
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197477
 https://launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/50161

To add more info, the drive is...

 Model=TORiSAN DVD-ROM DRD-N216, FwRev=1.08,
SerialNo=0001
 Config={ SpinMotCtl Removeable DTR=5Mbs DTR10Mbs nonMagnetic }
 RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=0kB, MaxMultSect=0
 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 *mdma2
 AdvancedPM=no

and as written above it also doesn't work with the ide drivers.  If DMA
is turned off using hdparm -d 0, it seems to work better but still
doesn't seem to work reliably.

-- 
tejun
-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVD drive fails in 2.6.20.2

2007-03-13 Thread Tejun Heo
Vlad Codrea wrote:
 ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen
 ata2.00: (BMDMA stat 0x25)
 ata2.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x12 data 36 in
 res 58/00:02:00:24:00/00:00:00:00:00/a0 Emask 0x2 (HSM violation)
 ata2: soft resetting port
 ata2: port is slow to respond, please be patient (Status 0xd8)
 ata2: port failed to respond (30 secs, Status 0xd8)
 ATA: abnormal status 0xD8 on port 0x177
 ATA: abnormal status 0xD8 on port 0x177

Okay, now that you're on libata driver, it's easier for me to debug.
Can you apply the attached patch over 2.6.20 and report what the kernel
says? (the patch will apply with some noise, it's okay)

Thanks.

-- 
tejun
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 14629a3..387235f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4453,9 +4453,13 @@ fsm_start:
 			if (likely(status  (ATA_ERR | ATA_DF)))
 /* device stops HSM for abort/error */
 qc-err_mask |= AC_ERR_DEV;
-			else
+			else {
 /* HSM violation. Let EH handle this */
+ata_port_printk(ap, KERN_WARNING,
+		!DRQ on HSM_ST_FIRST (0x%x)\n,
+		status);
 qc-err_mask |= AC_ERR_HSM;
+			}
 
 			ap-hsm_task_state = HSM_ST_ERR;
 			goto fsm_start;
@@ -4547,13 +4551,17 @@ fsm_start:
 if (likely(status  (ATA_ERR | ATA_DF)))
 	/* device stops HSM for abort/error */
 	qc-err_mask |= AC_ERR_DEV;
-else
+else {
+	ata_port_printk(ap, KERN_WARNING,
+		!DRQ on HSM_ST (0x%x)\n,
+		status);
 	/* HSM violation. Let EH handle this.
 	 * Phantom devices also trigger this
 	 * condition.  Mark hint.
 	 */
 	qc-err_mask |= AC_ERR_HSM |
 			AC_ERR_NODEV_HINT;
+}
 
 ap-hsm_task_state = HSM_ST_ERR;
 goto fsm_start;
@@ -4579,8 +4587,12 @@ fsm_start:
 	status = ata_wait_idle(ap);
 }
 
-if (status  (ATA_BUSY | ATA_DRQ))
+if (status  (ATA_BUSY | ATA_DRQ)) {
+	ata_port_printk(ap, KERN_WARNING,
+		BUSY|DRQ on ERR|DF (0x%x)\n,
+		status);
 	qc-err_mask |= AC_ERR_HSM;
+}
 
 /* ata_pio_sectors() might change the
  * state to HSM_ST_LAST. so, the state