Patchwork sata_nv times out for BD-ROM iHOS104-08

login
register
mail settings
Submitter Tejun Heo
Date Feb. 18, 2010, 1:50 a.m.
Message ID <4B7C9CEE.4080902@kernel.org>
Download mbox | patch
Permalink /patch/45726/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tejun Heo - Feb. 18, 2010, 1:50 a.m.
On 02/18/2010 01:14 AM, Cengiz Günay wrote:
> 2010/2/1 Tejun Heo <tj@kernel.org>:
> 
>> Can you please attach full dmesg w/ the patch applied w/o any kernel
>> parameter?  I'm curious where the hda warnings are coming from.  Is
>> generic IDE driver loaded?
> 
> The dmesg snippet I attached last time was w/o any kernel parameters.
> This time I'm attaching the full dmesg output. hda is my other DVD-RW
> drive, I'm not sure what the warnings mean. ide_core is loaded, but
> not the ide-generic or ide-pci-generic modules, although they are
> available. Would you like me to force them to load?

No, I was concerned because there were a few cases where two drivers
were attached to the same controller but I don't think that's possible
here.

Does the attached patch make any difference?

Thanks.
Cengiz Günay - Feb. 20, 2010, 7:11 p.m.
On Wed, Feb 17, 2010 at 8:50 PM, Tejun Heo <tj@kernel.org> wrote:
> No, I was concerned because there were a few cases where two drivers
> were attached to the same controller but I don't think that's possible
> here.

Ok.

> Does the attached patch make any difference?

Not that I can tell. I still get an infinite loop of ata4 errors. I
attached a full dmesg output with the patch. Note that I have both the
patches disable-clear-ua and drain-from-atapi-pio-bytes applied at the
same time.

Thanks,
-Cengiz

Patch

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 730ef3c..d189b48 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -1070,6 +1070,7 @@  static void atapi_pio_bytes(struct ata_queued_cmd *qc)
 	struct ata_eh_info *ehi = &dev->link->eh_info;
 	unsigned int ireason, bc_lo, bc_hi, bytes;
 	int i_write, do_write = (qc->tf.flags & ATA_TFLAG_WRITE) ? 1 : 0;
+	u8 stat;
 
 	/* Abuse qc->result_tf for temp storage of intermediate TF
 	 * here to save some kernel stack usage.
@@ -1099,6 +1100,21 @@  static void atapi_pio_bytes(struct ata_queued_cmd *qc)
 
 	if (unlikely(__atapi_pio_bytes(qc, bytes)))
 		goto err_out;
+
+	/* this really should be done only after the final transfer is complete */
+	stat = ata_sff_altstatus(ap);
+	if (stat & ATA_DRQ) {
+		int count;
+
+		ata_port_printk(ap, KERN_INFO, "stat=%x after atapi_pio_bytes\n", stat);
+
+		for (count = 0; (ap->ops->sff_check_status(ap) & ATA_DRQ)
+						&& count < 65536; count += 2)
+			ioread16(ap->ioaddr.data_addr);
+		if (count)
+			ata_port_printk(ap, KERN_DEBUG,
+					"drained %d bytes to clear DRQ.\n", count);
+	}
 	ata_sff_sync(ap); /* flush */
 
 	return;