Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=498222f323ab11331dc5cfedb97752477f0fe42a
Commit:     498222f323ab11331dc5cfedb97752477f0fe42a
Parent:     8f59a13accd78e9759548b40aa2a053938a01ec7
Author:     Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 19 14:37:58 2007 +0000
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Nov 23 19:33:27 2007 -0500

    pata_ali: Lots of problems still showing up with small ATAPI DMA
    
    Hopefully there is a better long term solution but for now lets favour
    reliability.
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_ali.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index d12f386..62aa2f9 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -285,6 +285,21 @@ static void ali_lock_sectors(struct ata_device *adev)
        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,
@@ -381,6 +396,7 @@ static struct ata_port_operations ali_c2_port_ops = {
        .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,
@@ -418,6 +434,7 @@ static struct ata_port_operations ali_c5_port_ops = {
        .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,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to