Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89613e667f7539defb053795f18653003179cf7e
Commit:     89613e667f7539defb053795f18653003179cf7e
Parent:     a1d85864d30181a71243193ed01d322dc0618dc6
Author:     Sergei Shtylyov <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 27 21:35:52 2007 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Tue Nov 27 21:35:52 2007 +0100

    ide: don't set PIO mode on pre-EIDE drives
    
    Fix handling of the PIO modes for the pre-EIDE drives that did not support
    the PIO Flow Control Transfer Mode value (00001 nnn) of the Set Transfer 
Mode
    feature by skipping the actual mode programming.
    
    Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-iops.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index e17a9ee..1cdf688 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -756,7 +756,7 @@ int ide_driveid_update(ide_drive_t *drive)
 int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
 {
        ide_hwif_t *hwif = drive->hwif;
-       int error;
+       int error = 0;
        u8 stat;
 
 //     while (HWGROUP(drive)->busy)
@@ -767,6 +767,10 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
                hwif->dma_host_off(drive);
 #endif
 
+       /* Skip setting PIO flow-control modes on pre-EIDE drives */
+       if ((speed & 0xf8) == XFER_PIO_0 && !(drive->id->capability & 0x08))
+               goto skip;
+
        /*
         * Don't use ide_wait_cmd here - it will
         * attempt to set_geometry and recalibrate,
@@ -814,6 +818,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
        drive->id->dma_mword &= ~0x0F00;
        drive->id->dma_1word &= ~0x0F00;
 
+ skip:
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (speed >= XFER_SW_DMA_0)
                hwif->dma_host_on(drive);
-
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