Skip to contentSkip to conversation

pata_pdc202xx_old: Fix crashes with ATAPI

PATCH In review Alan Cox 2 participants 5 messages Jan 19, 2008 – Jan 22, 2008 libata

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 pata_pdc202xx_old: Fix crashes with ATAPI

The PDC202xx older devices do not support ATAPI DMA via the usual interfaces. What documentation I have isn't sufficient to support DMA and it isn't clear if the Windows drivers do this or it is possible at all. (Neither do the drivers/ide old drivers)

So turn it ATAPI DMA off, these are disk optimised controllers.

drivers/ata/pata_pdc202xx_old.c +19 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c linux-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c
@@ -243,6 +243,24 @@
 	return ata_sff_port_start(ap);
 }
 
+/**
+ *	pdc2026x_check_atapi_dma - Check whether ATAPI DMA can be supported for this command
+ *	@qc: Metadata associated with taskfile to check
+ *
+ *	Just say no - not supported on older Promise.
+ *
+ *	LOCKING:
+ *	None (inherited from caller).
+ *
+ *	RETURNS: 0 when ATAPI DMA can be used
+ *		 1 otherwise
+ */
+
+static int pdc2026x_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+	return 1;
+}
+
 static struct scsi_host_template pdc202xx_sht = {
 	.module			= THIS_MODULE,
 	.name			= DRV_NAME,
@@ -310,6 +328,7 @@
 	.post_internal_cmd = ata_bmdma_post_internal_cmd,
 	.cable_detect	= pdc2026x_cable_detect,
 
+	.check_atapi_dma= pdc2026x_check_atapi_dma,
 	.bmdma_setup 	= ata_bmdma_setup,
 	.bmdma_start 	= pdc2026x_bmdma_start,
 	.bmdma_stop	= pdc2026x_bmdma_stop,
#1 lore raw

Hi,

Quoted 4 lines · Alan Cox

The PDC202xx older devices do not support ATAPI DMA via the usual interfaces. What documentation I have isn't sufficient to support DMA and it isn't clear if the Windows drivers do this or it is possible at all. (Neither do the drivers/ide old drivers)

IDE pdc202xx_old host driver supports ATAPI DMA just fine and in line with the PDC2026x programming guide.

Quoted 1 line

So turn it ATAPI DMA off, these are disk optimised controllers.

This is an acceptable workaround for 2.6.24 but it probably just hides some deeper pata_pdc202xx_old or/and libata problem.

Thanks,
Bart

Quoted 38 lines

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c linux-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c

drivers/ata/pata_pdc202xx_old.c +19 -0
@@ -243,6 +243,24 @@
 	return ata_sff_port_start(ap);
 }
 
+/**
+ *	pdc2026x_check_atapi_dma - Check whether ATAPI DMA can be supported for this command
+ *	@qc: Metadata associated with taskfile to check
+ *
+ *	Just say no - not supported on older Promise.
+ *
+ *	LOCKING:
+ *	None (inherited from caller).
+ *
+ *	RETURNS: 0 when ATAPI DMA can be used
+ *		 1 otherwise
+ */
+
+static int pdc2026x_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+	return 1;
+}
+
 static struct scsi_host_template pdc202xx_sht = {
 	.module			= THIS_MODULE,
 	.name			= DRV_NAME,
@@ -310,6 +328,7 @@
 	.post_internal_cmd = ata_bmdma_post_internal_cmd,
 	.cable_detect	= pdc2026x_cable_detect,
 
+	.check_atapi_dma= pdc2026x_check_atapi_dma,
 	.bmdma_setup 	= ata_bmdma_setup,
 	.bmdma_start 	= pdc2026x_bmdma_start,
 	.bmdma_stop	= pdc2026x_bmdma_stop,
author
#2 lore raw
Quoted 2 lines

IDE pdc202xx_old host driver supports ATAPI DMA just fine and in line with the PDC2026x programming guide.

News to me. It didn't last time I tried it the driver selected PIO.

Quoted 4 lines
Quoted 1 line

So turn it ATAPI DMA off, these are disk optimised controllers.

This is an acceptable workaround for 2.6.24 but it probably just hides some deeper pata_pdc202xx_old or/and libata problem.

Hard to be sure. No docs here for the older ones.

Alan

Acked-by Alan Cox
#3 lore raw
Quoted 4 lines · Alan Cox
Quoted 2 lines

IDE pdc202xx_old host driver supports ATAPI DMA just fine and in line with the PDC2026x programming guide.

News to me. It didn't last time I tried it the driver selected PIO.

Hmmm...

commit f3d5b34caae393f13a9486036f98c81cac1595c4

Author: Tobias Oed <[email protected]>
Date:   Tue Oct 3 01:14:17 2006 -0700

[PATCH] Enable cdrom dma access with pdc20265_old

This patch allows me to use dma with my cd/dvd attached to my on board pdc20265 ide controller
...

Cc Bartlomiej Zolnierkiewicz <[email protected]>

...

Are you by any chance using PDC20263?

[ PDC2026{5,7} should be fine (unless somebody broke it but then git-bisect
should do the job)... ]

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

So turn it ATAPI DMA off, these are disk optimised controllers.

This is an acceptable workaround for 2.6.24 but it probably just hides some deeper pata_pdc202xx_old or/and libata problem.

Hard to be sure. No docs here for the older ones.

I lack the docs for PDC20263...

Bart

author
#4 lore raw
Quoted 4 lines

Are you by any chance using PDC20263?

[ PDC2026{5,7} should be fine (unless somebody broke it but then git-bisect
should do the job)... ]

I tried both the 20263 and 20267. The logs I've got from the older trees all show PIO in use. I'll dig further when I get time.

Alan