Patchwork sata_nv times out for BD-ROM iHOS104-08

login
register
mail settings
Submitter Tejun Heo
Date March 2, 2010, 11:48 a.m.
Message ID <4B8CFAF4.7030303@kernel.org>
Download mbox | patch
Permalink /patch/46632/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tejun Heo - March 2, 2010, 11:48 a.m.
Hello,

On 03/01/2010 02:24 AM, Cengiz Günay wrote:
> Before and after the swncq-atapi-pio patch I still get awful read
> times from the BD-ROM drive:
> 
> $ time dd if=/dev/sr0 of=/dev/null bs=64k count=1024
> 67108864 bytes (67 MB) copied, 106.945 seconds, 628 kB/s
> => real	1m46.977s

Hmmm... the drive is timing out even on 4k READ10's.  This shouldn't
really be happening.  Can you please try this one?
Cengiz Günay - March 8, 2010, 7:17 p.m.
Hello,

Sorry for the delay, I was confused about managing so many patches,
but I realized that you're sending me cumulative patches that I can
apply to the original. I just want to remind you that I still have the
patches to the other two files: libata-eh.c  libata-sff.c

On Tue, Mar 2, 2010 at 6:48 AM, Tejun Heo <tj@kernel.org> wrote:
> Hmmm... the drive is timing out even on 4k READ10's.  This shouldn't
> really be happening.  Can you please try this one?

Applied. It did not change anything visibly (dmesg attached). I have
also been getting other SCSI errors since we started communicating
with the device (search for sr0 in dmesg). I wonder if they give any
hints? Here's one:

sr 4:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sr 4:0:0:0: [sr0] Sense Key : Aborted Command [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
        72 0b 00 00 00 00 00 0e 09 0c 00 00 00 02 00 00
        00 20 00 00 a0 40
sr 4:0:0:0: [sr0] Add. Sense: No additional sense information
sr 4:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 40 00
end_request: I/O error, dev sr0, sector 0

Thanks,
Cengiz
Robert Hancock - March 8, 2010, 11:46 p.m.
2010/3/8 Cengiz Günay <cgunay@emory.edu>:
> Hello,
>
> Sorry for the delay, I was confused about managing so many patches,
> but I realized that you're sending me cumulative patches that I can
> apply to the original. I just want to remind you that I still have the
> patches to the other two files: libata-eh.c  libata-sff.c
>
> On Tue, Mar 2, 2010 at 6:48 AM, Tejun Heo <tj@kernel.org> wrote:
>> Hmmm... the drive is timing out even on 4k READ10's.  This shouldn't
>> really be happening.  Can you please try this one?
>
> Applied. It did not change anything visibly (dmesg attached). I have
> also been getting other SCSI errors since we started communicating
> with the device (search for sr0 in dmesg). I wonder if they give any
> hints? Here's one:
>
> sr 4:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
> sr 4:0:0:0: [sr0] Sense Key : Aborted Command [current] [descriptor]
> Descriptor sense data with sense descriptors (in hex):
>        72 0b 00 00 00 00 00 0e 09 0c 00 00 00 02 00 00
>        00 20 00 00 a0 40
> sr 4:0:0:0: [sr0] Add. Sense: No additional sense information
> sr 4:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 40 00
> end_request: I/O error, dev sr0, sector 0

Don't think that part's very useful, that's just the after-effect of
the timeouts in the driver..
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo - March 9, 2010, 1:21 a.m.
On 03/09/2010 04:17 AM, Cengiz Günay wrote:
> Hello,
> 
> Sorry for the delay, I was confused about managing so many patches,
> but I realized that you're sending me cumulative patches that I can
> apply to the original. I just want to remind you that I still have the
> patches to the other two files: libata-eh.c  libata-sff.c
> 
> On Tue, Mar 2, 2010 at 6:48 AM, Tejun Heo <tj@kernel.org> wrote:
>> Hmmm... the drive is timing out even on 4k READ10's.  This shouldn't
>> really be happening.  Can you please try this one?
> 
> Applied. It did not change anything visibly (dmesg attached). I have
> also been getting other SCSI errors since we started communicating
> with the device (search for sr0 in dmesg). I wonder if they give any
> hints? Here's one:
> 
> sr 4:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
> sr 4:0:0:0: [sr0] Sense Key : Aborted Command [current] [descriptor]
> Descriptor sense data with sense descriptors (in hex):
>         72 0b 00 00 00 00 00 0e 09 0c 00 00 00 02 00 00
>         00 20 00 00 a0 40
> sr 4:0:0:0: [sr0] Add. Sense: No additional sense information
> sr 4:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 40 00
> end_request: I/O error, dev sr0, sector 0

Hmmm... can you please post full dmesg?
Cengiz Günay - March 9, 2010, 5:18 a.m.
Ok, I see. BTW, the full dmesg was attached to that message. I'm
attaching it again.

-Cengiz

On Mon, Mar 8, 2010 at 8:21 PM, Tejun Heo <tj@kernel.org> wrote:
> On 03/09/2010 04:17 AM, Cengiz Günay wrote:
>> Hello,
>>
>> Sorry for the delay, I was confused about managing so many patches,
>> but I realized that you're sending me cumulative patches that I can
>> apply to the original. I just want to remind you that I still have the
>> patches to the other two files: libata-eh.c  libata-sff.c
>>
>> On Tue, Mar 2, 2010 at 6:48 AM, Tejun Heo <tj@kernel.org> wrote:
>>> Hmmm... the drive is timing out even on 4k READ10's.  This shouldn't
>>> really be happening.  Can you please try this one?
>>
>> Applied. It did not change anything visibly (dmesg attached). I have
>> also been getting other SCSI errors since we started communicating
>> with the device (search for sr0 in dmesg). I wonder if they give any
>> hints? Here's one:
>>
>> sr 4:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
>> sr 4:0:0:0: [sr0] Sense Key : Aborted Command [current] [descriptor]
>> Descriptor sense data with sense descriptors (in hex):
>>         72 0b 00 00 00 00 00 0e 09 0c 00 00 00 02 00 00
>>         00 20 00 00 a0 40
>> sr 4:0:0:0: [sr0] Add. Sense: No additional sense information
>> sr 4:0:0:0: [sr0] CDB: Read(10): 28 00 00 00 00 00 00 00 40 00
>> end_request: I/O error, dev sr0, sector 0
>
> Hmmm... can you please post full dmesg?
>
> --
> tejun
>

Patch

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 0c82d33..84d3eba 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -307,6 +307,7 @@  static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
 
 static int nv_hardreset(struct ata_link *link, unsigned int *class,
 			unsigned long deadline);
+static int nv_check_atapi_dma(struct ata_queued_cmd *qc);
 static void nv_nf2_freeze(struct ata_port *ap);
 static void nv_nf2_thaw(struct ata_port *ap);
 static void nv_ck804_freeze(struct ata_port *ap);
@@ -470,6 +471,7 @@  static struct ata_port_operations nv_generic_ops = {
 	.scr_read		= nv_scr_read,
 	.scr_write		= nv_scr_write,
 	.hardreset		= nv_hardreset,
+	.check_atapi_dma	= nv_check_atapi_dma,
 };
 
 static struct ata_port_operations nv_nf2_ops = {
@@ -585,7 +587,7 @@  static const struct ata_port_info nv_port_info[] = {
 	/* SWNCQ */
 	{
 		.flags	        = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
-				  ATA_FLAG_NCQ,
+				  ATA_FLAG_NCQ | ATA_FLAG_PIO_POLLING,
 		.pio_mask	= NV_PIO_MASK,
 		.mwdma_mask	= NV_MWDMA_MASK,
 		.udma_mask	= NV_UDMA_MASK,
@@ -1614,6 +1616,25 @@  static int nv_hardreset(struct ata_link *link, unsigned int *class,
 	return -EAGAIN;
 }
 
+#include <scsi/scsi_cmnd.h>
+static int nv_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+	/* Whitelist commands that may use DMA. */
+	switch (qc->scsicmd->cmnd[0]) {
+	case WRITE_12:
+	case WRITE_10:
+	case WRITE_6:
+	case READ_12:
+	case READ_10:
+	case READ_6:
+	case 0xad: /* READ_DVD_STRUCTURE */
+	case 0xbe: /* READ_CD */
+		if (ata_qc_raw_nbytes(qc) > 4096)
+			return 0;
+	}
+	return 1;
+}
+
 static void nv_nf2_freeze(struct ata_port *ap)
 {
 	void __iomem *scr_addr = ap->host->ports[0]->ioaddr.scr_addr;