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

Commit 2b0460b5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (33 commits)
  amd74xx: remove /proc/ide/amd74xx
  amd74xx/via82cxxx: don't initialize drive->dn
  sis5513: remove /proc/ide/sis
  ide: remove CONFIG_IDEDMA_ONLYDISK
  ide: add "hdx=nodma" kernel parameter
  ide: remove hwif->autodma and drive->autodma
  ide: remove "idex=dma" kernel parameter
  ide: remove CONFIG_BLK_DEV_IDEDMA_FORCED
  ide: use PCI_VDEVICE() macro
  sis5513: clear prefetch and postwrite for ATAPI devices
  it8213/piix/slc90e66: "de-couple" PIO and UDMA modes
  ide: unexport noautodma
  ide: unexport ide_tune_dma
  ide: remove ->ide_dma_check (take 2)
  ide-pmac: add PIO autotune fallback to ->ide_dma_check
  ide-cris: add PIO autotune fallback to ->ide_dma_check
  sl82c105: add PIO autotune fallback to ->ide_dma_check
  cs5530/sc1200: add PIO autotune fallback to ->ide_dma_check
  ide: remove ide_use_fast_pio()
  ide: remove drive->init_speed zeroing
  ...
parents d91f5bb6 b02fcae0
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -242,6 +242,8 @@ Summary of ide driver parameters for kernel command line
			  and quite likely to cause trouble with
			  older/odd IDE drives.

 "hdx=nodma"		: disallow DMA

 "hdx=swapdata"		: when the drive is a disk, byte swap all data

 "hdx=bswap"		: same as above..........
@@ -279,8 +281,6 @@ Summary of ide driver parameters for kernel command line
			
 "idex=reset"		: reset interface after probe

 "idex=dma"		: automatically configure/use DMA if possible.

 "idex=ata66"		: informs the interface that it has an 80c cable
			  for chipsets that are ATA-66 capable, but the
			  ability to bit test for detection is currently
@@ -288,8 +288,6 @@ Summary of ide driver parameters for kernel command line

 "ide=reverse"		: formerly called to pci sub-system, but now local.

 "ide=nodma"		: disable DMA globally for the IDE subsystem.

The following are valid ONLY on ide0, which usually corresponds
to the first ATA interface found on the particular host, and the defaults for
the base,ctl ports must not be altered.
+0 −18
Original line number Diff line number Diff line
@@ -435,24 +435,6 @@ config BLK_DEV_IDEDMA_PCI
	bool
	select BLK_DEV_IDEPCI

config BLK_DEV_IDEDMA_FORCED
	bool "Force enable legacy 2.0.X HOSTS to use DMA"
	depends on BLK_DEV_IDEDMA_PCI
	help
	  This is an old piece of lost code from Linux 2.0 Kernels.

	  Generally say N here.

# TODO: remove it
config IDEDMA_ONLYDISK
	bool "Enable DMA only for disks "
	depends on BLK_DEV_IDEDMA_PCI
	help
	  This is used if you know your ATAPI Devices are going to fail DMA
	  Transfers.

	  Generally say N here.

config BLK_DEV_AEC62XX
	tristate "AEC62XX chipset support"
	select BLK_DEV_IDEDMA_PCI
+0 −17
Original line number Diff line number Diff line
@@ -309,14 +309,6 @@ static int icside_dma_on(ide_drive_t *drive)
	return 0;
}

static int icside_dma_check(ide_drive_t *drive)
{
	if (ide_tune_dma(drive))
		return 0;

	return -1;
}

static int icside_dma_end(ide_drive_t *drive)
{
	ide_hwif_t *hwif = HWIF(drive);
@@ -423,8 +415,6 @@ static void icside_dma_lost_irq(ide_drive_t *drive)

static void icside_dma_init(ide_hwif_t *hwif)
{
	printk("    %s: SG-DMA", hwif->name);

	hwif->atapi_dma		= 1;
	hwif->mwdma_mask	= 7; /* MW0..2 */
	hwif->swdma_mask	= 7; /* SW0..2 */
@@ -432,9 +422,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
	hwif->dmatable_cpu	= NULL;
	hwif->dmatable_dma	= 0;
	hwif->set_dma_mode	= icside_set_dma_mode;
	hwif->autodma		= 1;

	hwif->ide_dma_check	= icside_dma_check;
	hwif->dma_host_off	= icside_dma_host_off;
	hwif->dma_off_quietly	= icside_dma_off_quietly;
	hwif->dma_host_on	= icside_dma_host_on;
@@ -446,11 +434,6 @@ static void icside_dma_init(ide_hwif_t *hwif)
	hwif->ide_dma_test_irq	= icside_dma_test_irq;
	hwif->dma_timeout	= icside_dma_timeout;
	hwif->dma_lost_irq	= icside_dma_lost_irq;

	hwif->drives[0].autodma = hwif->autodma;
	hwif->drives[1].autodma = hwif->autodma;

	printk(" capable%s\n", hwif->autodma ? ", auto-enable" : "");
}
#else
#define icside_dma_init(hwif)	(0)
+2 −13
Original line number Diff line number Diff line
@@ -664,7 +664,6 @@ cris_ide_inb(unsigned long reg)
	return (unsigned char)cris_ide_inw(reg);
}

static int cris_dma_check (ide_drive_t *drive);
static int cris_dma_end (ide_drive_t *drive);
static int cris_dma_setup (ide_drive_t *drive);
static void cris_dma_exec_cmd (ide_drive_t *drive, u8 command);
@@ -792,7 +791,6 @@ init_e100_ide (void)
		hwif->ata_output_data = &cris_ide_output_data;
		hwif->atapi_input_bytes = &cris_atapi_input_bytes;
		hwif->atapi_output_bytes = &cris_atapi_output_bytes;
		hwif->ide_dma_check = &cris_dma_check;
		hwif->ide_dma_end = &cris_dma_end;
		hwif->dma_setup = &cris_dma_setup;
		hwif->dma_exec_cmd = &cris_dma_exec_cmd;
@@ -808,11 +806,10 @@ init_e100_ide (void)
		hwif->dma_off_quietly = &cris_dma_off;
		hwif->cbl = ATA_CBL_PATA40;
		hwif->pio_mask = ATA_PIO4,
		hwif->drives[0].autotune = 1;
		hwif->drives[1].autotune = 1;
		hwif->ultra_mask = cris_ultra_mask;
		hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
		hwif->autodma = 1;
		hwif->drives[0].autodma = 1;
		hwif->drives[1].autodma = 1;
	}

	/* Reset pulse */
@@ -1018,14 +1015,6 @@ static ide_startstop_t cris_dma_intr (ide_drive_t *drive)
 * the caller should revert to PIO for the current request.
 */

static int cris_dma_check(ide_drive_t *drive)
{
	if (ide_tune_dma(drive))
		return 0;

	return -1;
}

static int cris_dma_end(ide_drive_t *drive)
{
	drive->waiting_for_dma = 0;
+45 −32
Original line number Diff line number Diff line
@@ -338,20 +338,16 @@ static int config_drive_for_dma (ide_drive_t *drive)
	ide_hwif_t *hwif = drive->hwif;
	struct hd_driveid *id = drive->id;

	/* consult the list of known "bad" drives */
	if (__ide_dma_bad_drive(drive))
		return -1;

	if (drive->media != ide_disk && hwif->atapi_dma == 0)
		return -1;
		return 0;

	if ((id->capability & 1) && drive->autodma) {
	/*
	 * Enable DMA on any drive that has
	 * UltraDMA (mode 0/1/2/3/4/5/6) enabled
	 */
	if ((id->field_valid & 4) && ((id->dma_ultra >> 8) & 0x7f))
			return 0;
		return 1;

	/*
	 * Enable DMA on any drive that has mode2 DMA
	 * (multi or single) enabled
@@ -359,14 +355,13 @@ static int config_drive_for_dma (ide_drive_t *drive)
	if (id->field_valid & 2)	/* regular DMA */
		if ((id->dma_mword & 0x404) == 0x404 ||
		    (id->dma_1word & 0x404) == 0x404)
				return 0;
			return 1;

	/* Consult the list of known "good" drives */
	if (ide_dma_good_drive(drive))
			return 0;
	}
		return 1;

	return -1;
	return 0;
}

/**
@@ -627,6 +622,8 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
			drive->name, __FUNCTION__);
	return 0;
}
#else
static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */

int __ide_dma_bad_drive (ide_drive_t *drive)
@@ -758,17 +755,20 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)

EXPORT_SYMBOL_GPL(ide_find_dma_mode);

int ide_tune_dma(ide_drive_t *drive)
static int ide_tune_dma(ide_drive_t *drive)
{
	u8 speed;

	if ((drive->id->capability & 1) == 0 || drive->autodma == 0)
	if (noautodma || drive->nodma || (drive->id->capability & 1) == 0)
		return 0;

	/* consult the list of known "bad" drives */
	if (__ide_dma_bad_drive(drive))
		return 0;

	if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
		return config_drive_for_dma(drive);

	speed = ide_max_dma_mode(drive);

	if (!speed)
@@ -783,7 +783,22 @@ int ide_tune_dma(ide_drive_t *drive)
	return 1;
}

EXPORT_SYMBOL_GPL(ide_tune_dma);
static int ide_dma_check(ide_drive_t *drive)
{
	ide_hwif_t *hwif = drive->hwif;
	int vdma = (hwif->host_flags & IDE_HFLAG_VDMA)? 1 : 0;

	if (!vdma && ide_tune_dma(drive))
		return 0;

	/* TODO: always do PIO fallback */
	if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
		return -1;

	ide_set_max_pio(drive);

	return vdma ? 0 : -1;
}

void ide_dma_verbose(ide_drive_t *drive)
{
@@ -842,7 +857,7 @@ int ide_set_dma(ide_drive_t *drive)
	ide_hwif_t *hwif = drive->hwif;
	int rc;

	rc = hwif->ide_dma_check(drive);
	rc = ide_dma_check(drive);

	switch(rc) {
	case -1: /* DMA needs to be disabled */
@@ -1019,8 +1034,6 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
		hwif->ide_dma_on = &__ide_dma_on;
	if (!hwif->dma_host_on)
		hwif->dma_host_on = &ide_dma_host_on;
	if (!hwif->ide_dma_check)
		hwif->ide_dma_check = &config_drive_for_dma;
	if (!hwif->dma_setup)
		hwif->dma_setup = &ide_dma_setup;
	if (!hwif->dma_exec_cmd)
Loading