Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=08ebd43d6b9b63de681b8f255c0fabae8033527c
Commit:     08ebd43d6b9b63de681b8f255c0fabae8033527c
Parent:     897ee77bfba12b83752027427a41009961458ee6
Author:     Laurent Riffard <[EMAIL PROTECTED]>
AuthorDate: Sun Sep 2 21:01:32 2007 +0200
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Mon Sep 10 21:50:24 2007 -0400

    Fix broken pata_via cable detection
    
    via_do_set_mode overwrites 80-wire cable detection bits. Let's
    preserve them.
    
    Signed-off-by: Laurent Riffard <[EMAIL PROTECTED]>
    Acked-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_via.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index ea18e33..1b0acaf 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -243,7 +243,6 @@ static void via_do_set_mode(struct ata_port *ap, struct 
ata_device *adev, int mo
        int ut;
        int offset = 3 - (2*ap->port_no) - adev->devno;
 
-
        /* Calculate the timing values we require */
        ata_timing_compute(adev, mode, &t, T, UT);
 
@@ -290,9 +289,17 @@ static void via_do_set_mode(struct ata_port *ap, struct 
ata_device *adev, int mo
                        ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
                        break;
        }
+
        /* Set UDMA unless device is not UDMA capable */
-       if (udma_type)
-               pci_write_config_byte(pdev, 0x50 + offset, ut);
+       if (udma_type) {
+               u8 cable80_status;
+
+               /* Get 80-wire cable detection bit */
+               pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
+               cable80_status &= 0x10;
+
+               pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
+       }
 }
 
 static void via_set_piomode(struct ata_port *ap, struct ata_device *adev)
-
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