Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 242ce41f authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Linus Torvalds
Browse files

[PATCH] PIIX: remove check for broken MW DMA mode 0



There's no need to check in piix_config_drive_for_dma() for broken MW DMA
mode 0 as this mode is not supported by the driver (it sets
hwif->mwdma_mask to 0x6), and hence can't be selected by ide_dma_speed().

(Alan sayeth "Probably right but if not you've got a subtle corruptor.  Should
at least stick a BUG_ON mode 0 setting right close when the mode is set.")

Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: default avatarBartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 755cd900
Loading
Loading
Loading
Loading
+0 −31
Original line number Original line Diff line number Diff line
@@ -352,33 +352,6 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed)
	return (ide_config_drive_speed(drive, speed));
	return (ide_config_drive_speed(drive, speed));
}
}


/**
 *	piix_faulty_dma0		-	check for DMA0 errata
 *	@hwif: IDE interface to check
 *
 *	If an ICH/ICH0/ICH2 interface is is operating in multi-word
 *	DMA mode with 600nS cycle time the IDE PIO prefetch buffer will
 *	inadvertently provide an extra piece of secondary data to the primary
 *	device resulting in data corruption.
 *
 *	With such a device this test function returns true. This allows
 *	our tuning code to follow Intel recommendations and use PIO on
 *	such devices.
 */
 
static int piix_faulty_dma0(ide_hwif_t *hwif)
{
	switch(hwif->pci_dev->device)
	{
		case PCI_DEVICE_ID_INTEL_82801AA_1:	/* ICH */
		case PCI_DEVICE_ID_INTEL_82801AB_1:	/* ICH0 */
		case PCI_DEVICE_ID_INTEL_82801BA_8:	/* ICH2 */
		case PCI_DEVICE_ID_INTEL_82801BA_9:	/* ICH2 */
			return 1;
	}
	return 0;
}

/**
/**
 *	piix_config_drive_for_dma	-	configure drive for DMA
 *	piix_config_drive_for_dma	-	configure drive for DMA
 *	@drive: IDE drive to configure
 *	@drive: IDE drive to configure
@@ -392,10 +365,6 @@ static int piix_config_drive_for_dma (ide_drive_t *drive)
{
{
	u8 speed = ide_dma_speed(drive, piix_ratemask(drive));
	u8 speed = ide_dma_speed(drive, piix_ratemask(drive));


	/* Some ICH devices cannot support DMA mode 0 */
	if(speed == XFER_MW_DMA_0 && piix_faulty_dma0(HWIF(drive)))
		speed = 0;

	/* If no DMA speed was available or the chipset has DMA bugs
	/* If no DMA speed was available or the chipset has DMA bugs
	   then disable DMA and use PIO */
	   then disable DMA and use PIO */