linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA
@ 2007-11-19 14:37 Alan Cox
  2007-11-24  0:36 ` Jeff Garzik
  2007-11-28  1:36 ` Tejun Heo
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Cox @ 2007-11-19 14:37 UTC (permalink / raw)
  To: jeff, akpm, linux-ide

Hopefully there is a better long term solution but for now lets favour
reliability.

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

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.24-rc2-mm1/drivers/ata/pata_ali.c linux-2.6.24-rc2-mm1/drivers/ata/pata_ali.c
--- linux.vanilla-2.6.24-rc2-mm1/drivers/ata/pata_ali.c	2007-11-16 17:55:11.000000000 +0000
+++ linux-2.6.24-rc2-mm1/drivers/ata/pata_ali.c	2007-11-16 18:12:21.000000000 +0000
@@ -282,6 +285,21 @@
 	adev->max_sectors = 255;
 }
 
+/**
+ *	ali_check_atapi_dma	-	DMA check for most ALi controllers
+ *	@adev: Device
+ *
+ *	Called to decide whether commands should be sent by DMA or PIO
+ */
+ 
+static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+	/* If its not a media command, its not worth it */
+	if (qc->nbytes < 2048)
+		return -EOPNOTSUPP;
+	return 0;
+}
+
 static struct scsi_host_template ali_sht = {
 	.module			= THIS_MODULE,
 	.name			= DRV_NAME,
@@ -378,6 +396,7 @@
 	.mode_filter	= ata_pci_default_filter,
 	.tf_load	= ata_tf_load,
 	.tf_read	= ata_tf_read,
+	.check_atapi_dma = ali_check_atapi_dma,
 	.check_status 	= ata_check_status,
 	.exec_command	= ata_exec_command,
 	.dev_select 	= ata_std_dev_select,
@@ -415,6 +434,7 @@
 	.mode_filter	= ata_pci_default_filter,
 	.tf_load	= ata_tf_load,
 	.tf_read	= ata_tf_read,
+	.check_atapi_dma = ali_check_atapi_dma,
 	.check_status 	= ata_check_status,
 	.exec_command	= ata_exec_command,
 	.dev_select 	= ata_std_dev_select,

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

end of thread, other threads:[~2007-11-28 13:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 14:37 [PATCH] pata_ali: Lots of problems still showing up with small ATAPI DMA Alan Cox
2007-11-24  0:36 ` Jeff Garzik
2007-11-28  1:36 ` Tejun Heo
2007-11-28  9:25   ` Alan Cox
2007-11-28 11:26     ` Tejun Heo
2007-11-28 13:05       ` 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).