]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-iops.c
ide: don't set PIO mode on pre-EIDE drives
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-iops.c
index 95168833d0691a82c896197a7a4d01beae361479..1cdf688a5422ee98cd824a938f21c5b9304dc539 100644 (file)
@@ -403,8 +403,12 @@ void ide_fix_driveid (struct hd_driveid *id)
 #endif
 }
 
-/* FIXME: exported for use by the USB storage (isd200.c) code only */
-EXPORT_SYMBOL(ide_fix_driveid);
+/*
+ * ide_fixstring() cleans up and (optionally) byte-swaps a text string,
+ * removing leading/trailing blanks and compressing internal blanks.
+ * It is primarily used to tidy up the model name/number fields as
+ * returned by the WIN_[P]IDENTIFY commands.
+ */
 
 void ide_fixstring (u8 *s, const int bytecount, const int byteswap)
 {
@@ -582,9 +586,12 @@ EXPORT_SYMBOL_GPL(ide_in_drive_list);
 /*
  * Early UDMA66 devices don't set bit14 to 1, only bit13 is valid.
  * We list them here and depend on the device side cable detection for them.
+ *
+ * Some optical devices with the buggy firmwares have the same problem.
  */
 static const struct drive_list_entry ivb_list[] = {
        { "QUANTUM FIREBALLlct10 05"    , "A03.0900"    },
+       { "TSSTcorp CDDVDW SH-S202J"    , "SB00"        },
        { NULL                          , NULL          }
 };
 
@@ -749,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)
@@ -760,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,
@@ -807,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);