LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI
@ 2008-01-19 15:51 Alan Cox
  2008-01-21 23:13 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2008-01-19 15:51 UTC (permalink / raw)
  To: jeff, akpm, torvalds, linux-kernel

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.

Signed-off-by: Alan Cox <alan@redhat.com>

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
--- linux.vanilla-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c	2008-01-19 14:47:56.000000000 +0000
+++ linux-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c	2008-01-19 15:19:25.000000000 +0000
@@ -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,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI
  2008-01-19 15:51 [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI Alan Cox
@ 2008-01-21 23:13 ` Bartlomiej Zolnierkiewicz
  2008-01-22  0:00   ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-01-21 23:13 UTC (permalink / raw)
  To: Alan Cox; +Cc: jeff, akpm, torvalds, linux-kernel


Hi,

On Saturday 19 January 2008, Alan Cox wrote:
> 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.

> 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

> Signed-off-by: Alan Cox <alan@redhat.com>
> 
> 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
> --- linux.vanilla-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c	2008-01-19 14:47:56.000000000 +0000
> +++ linux-2.6.24-rc8-mm1/drivers/ata/pata_pdc202xx_old.c	2008-01-19 15:19:25.000000000 +0000
> @@ -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,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI
  2008-01-21 23:13 ` Bartlomiej Zolnierkiewicz
@ 2008-01-22  0:00   ` Alan Cox
  2008-01-22  1:25     ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2008-01-22  0:00 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: jeff, akpm, torvalds, linux-kernel

> 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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI
  2008-01-22  0:00   ` Alan Cox
@ 2008-01-22  1:25     ` Bartlomiej Zolnierkiewicz
  2008-01-22  1:36       ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-01-22  1:25 UTC (permalink / raw)
  To: Alan Cox; +Cc: jeff, akpm, torvalds, linux-kernel

On Tuesday 22 January 2008, Alan Cox wrote:
> > 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 <tobiasoed@hotmail.com>
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
...
    Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
    Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
...

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)... ]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI
  2008-01-22  1:25     ` Bartlomiej Zolnierkiewicz
@ 2008-01-22  1:36       ` Alan Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2008-01-22  1:36 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: jeff, akpm, torvalds, linux-kernel

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-22  1:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-19 15:51 [PATCH] pata_pdc202xx_old: Fix crashes with ATAPI Alan Cox
2008-01-21 23:13 ` Bartlomiej Zolnierkiewicz
2008-01-22  0:00   ` Alan Cox
2008-01-22  1:25     ` Bartlomiej Zolnierkiewicz
2008-01-22  1:36       ` Alan Cox

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).