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 <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
{
ide_hwif_t *hwif = drive->hwif;
int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
{
ide_hwif_t *hwif = drive->hwif;
u8 stat;
// while (HWGROUP(drive)->busy)
u8 stat;
// while (HWGROUP(drive)->busy)
hwif->dma_host_off(drive);
#endif
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,
/*
* Don't use ide_wait_cmd here - it will
* attempt to set_geometry and recalibrate,
drive->id->dma_mword &= ~0x0F00;
drive->id->dma_1word &= ~0x0F00;
drive->id->dma_mword &= ~0x0F00;
drive->id->dma_1word &= ~0x0F00;
#ifdef CONFIG_BLK_DEV_IDEDMA
if (speed >= XFER_SW_DMA_0)
hwif->dma_host_on(drive);
#ifdef CONFIG_BLK_DEV_IDEDMA
if (speed >= XFER_SW_DMA_0)
hwif->dma_host_on(drive);