linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Albert Lee <albertcc@tw.ibm.com>
To: Mark Lord <liml@rtr.ca>
Cc: albertl@mail.com, Tejun Heo <htejun@gmail.com>,
	Stanislav Brabec <sbrabec@novell.com>,
	jeff@garzik.org, bzolnier@gmail.com, alan@lxorguk.ukuu.org.uk,
	paul@paulbristow.net, chrubis@suse.cz, linux-ide@vger.kernel.org
Subject: Re: IOMEGA IDE ZIP (ATAPI) drive
Date: Sat, 17 Mar 2007 01:21:08 +0800	[thread overview]
Message-ID: <45FAD204.2060700@tw.ibm.com> (raw)
In-Reply-To: <45FAB418.2070402@rtr.ca>

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 */


  reply	other threads:[~2007-03-16 17:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14 10:19 regression: ide-floppy doesn't work with IOMEGA IDE ZIP drive Stanislav Brabec
2007-03-14 11:58 ` Tejun Heo
2007-03-14 13:30   ` Mark Lord
2007-03-14 13:48     ` Tejun Heo
2007-03-15 22:12       ` IOMEGA IDE ZIP (ATAPI) drive Mark Lord
2007-03-16 14:30         ` Albert Lee
2007-03-16 14:37           ` Mark Lord
2007-03-16 15:13           ` Mark Lord
2007-03-16 17:21             ` Albert Lee [this message]
2007-03-16 21:17               ` Mark Lord
2007-03-17  3:19                 ` Albert Lee
2007-03-19 15:25                   ` Mark Lord
2007-03-20 10:16                     ` Albert Lee
2007-03-14 17:42     ` regression: ide-floppy doesn't work with IOMEGA IDE ZIP drive Jeff Garzik
2007-03-14 13:42 ` Bartlomiej Zolnierkiewicz
2007-03-14 13:44   ` Tejun Heo
2007-03-14 18:27     ` Mark Lord
2007-03-15  2:08       ` Tejun Heo
     [not found] ` <45F80841.EMEA5.EMEA5-1.100.1396E6E.1.3873.1@1:7.EMEA5.EMEA5-1.100.0.1.0.1@16>
2007-03-14 20:41   ` Stanislav Brabec
2007-03-15  4:29     ` Albert Lee
2007-03-15 19:58     ` Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45FAD204.2060700@tw.ibm.com \
    --to=albertcc@tw.ibm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertl@mail.com \
    --cc=bzolnier@gmail.com \
    --cc=chrubis@suse.cz \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=paul@paulbristow.net \
    --cc=sbrabec@novell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).