Re: IOMEGA IDE ZIP (ATAPI) drive

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

 



Mark Lord wrote:
> Albert Lee wrote:
> 
>> Could you please apply the attached debugging patch for clue about
>> what caused the HSM violation, thanks.
> 
> 
> I had to edit the patch to get it to apply on 2.6.21-rc3-git9,
> but here (attached) is the output from syslog.
> 
> zip_insert.txt :: response to inserting a disc into the drive.
> zip_button.txt :: response to pressing the eject button.
> zip_eject.txt  :: response to using "eject /dev/sdc".
> 
> Enjoy!
> 
> 
> ------------------------------------------------------------------------
> 
> 11:08:57: sdc: Spinning up disk...<3>ata port 1: protocol 6 task_state 4
> 11:08:57:          res 00/00:03:00:00:20/00:00:00:00:00/a0 Emask 0x2 (HSM violation)
> 11:08:57: ata4: soft resetting port
> 11:08:57: ATA: abnormal status 0x7F on port 0x00010177
> 11:08:57: ATA: abnormal status 0x7F on port 0x00010177
> 11:08:58: ata4.00: configured for PIO2
> 11:08:58: ata4: EH complete

Thanks for this good clue.

<3>ata port 1: protocol 6 task_state 4
11:08:57:          res 00/00:03:00:00:20/00:00:00:00:00/a0 Emask 0x2 (HSM violation)

>From the trace, the zip 100 drive clears BSY and raises irq to tell libata
when it is ready to transfer the CDB. However, the DRQ is not set yet. The status
0x00 causes libata HSM violation.

Maybe we can wait a moment and give the slow ATAPI devices some time to set DRQ.
Could you please try if the attached patch works, thanks.
--
albert

--- linux-2.6.20.3/drivers/ata/libata-core.c	2007-03-15 18:03:27.000000000 +0800
+++ linux-2.6.20.3-mod2/drivers/ata/libata-core.c	2007-03-17 01:12:53.000000000 +0800
@@ -4384,6 +4384,19 @@ fsm_start:
 		 */
 		poll_next = (qc->tf.flags & ATA_TFLAG_POLLING);
 
+		/* wait for some slow ATAPI devices to set DRQ */
+		if (unlikely((status & ATA_DRQ) == 0) &&
+		    is_atapi_taskfile(&qc->tf)) {
+			int max = 100;
+
+			do {
+				udelay(10);
+				status = ata_chk_status(ap);
+				max--;
+				ata_port_printk(ap, KERN_ERR, "wait for DRQ %d\n", 100-max);	
+			} while (((status & ATA_DRQ) == 0) && (max > 0));
+		}
+
 		/* check device status */
 		if (unlikely((status & ATA_DRQ) == 0)) {
 			/* handle BSY=0, DRQ=0 as error */

-
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