Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
Linus Torvalds committed Oct 16, 2007
2 parents d91f5bb + b02fcae commit 2b0460b
Show file tree
Hide file tree
Showing 48 changed files with 449 additions and 1,699 deletions.
6 changes: 2 additions & 4 deletions Documentation/ide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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..........
Expand Down Expand Up @@ -278,8 +280,6 @@ Summary of ide driver parameters for kernel command line
"idex=four" : four drives on idex and ide(x^1) share same ports

"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
Expand All @@ -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.
Expand Down
18 changes: 0 additions & 18 deletions drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -423,18 +415,14 @@ 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 */

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;
Expand All @@ -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)
Expand Down
15 changes: 2 additions & 13 deletions drivers/ide/cris/ide-cris.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down
77 changes: 45 additions & 32 deletions drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,35 +338,30 @@ 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;
/*
* Enable DMA on any drive that has mode2 DMA
* (multi or single) enabled
*/
if (id->field_valid & 2) /* regular DMA */
if ((id->dma_mword & 0x404) == 0x404 ||
(id->dma_1word & 0x404) == 0x404)
return 0;

/* Consult the list of known "good" drives */
if (ide_dma_good_drive(drive))
return 0;
}
/*
* 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 1;

/*
* Enable DMA on any drive that has mode2 DMA
* (multi or single) enabled
*/
if (id->field_valid & 2) /* regular DMA */
if ((id->dma_mword & 0x404) == 0x404 ||
(id->dma_1word & 0x404) == 0x404)
return 1;

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

return -1;
return 0;
}

/**
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
{
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request *

case ide_pm_restore_dma: /* Resume step 3 (restore DMA) */
/*
* Right now, all we do is call hwif->ide_dma_check(drive),
* Right now, all we do is call ide_set_dma(drive),
* we could be smarter and check for current xfer_speed
* in struct drive etc...
*/
if (drive->hwif->ide_dma_check == NULL)
if (drive->hwif->ide_dma_on == NULL)
break;
drive->hwif->dma_off_quietly(drive);
/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
// msleep(50);

#ifdef CONFIG_BLK_DEV_IDEDMA
if (hwif->ide_dma_check) /* check if host supports DMA */
if (hwif->ide_dma_on) /* check if host supports DMA */
hwif->dma_host_off(drive);
#endif

Expand Down Expand Up @@ -830,7 +830,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
#ifdef CONFIG_BLK_DEV_IDEDMA
if (speed >= XFER_SW_DMA_0)
hwif->dma_host_on(drive);
else if (hwif->ide_dma_check) /* check if host supports DMA */
else if (hwif->ide_dma_on) /* check if host supports DMA */
hwif->dma_off_quietly(drive);
#endif

Expand Down
15 changes: 0 additions & 15 deletions drivers/ide/ide-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,6 @@ static u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
return min(speed, mode);
}

int ide_use_fast_pio(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;

if ((id->capability & 1) && drive->autodma)
return 1;

if ((id->capability & 8) || (id->field_valid & 2))
return 1;

return 0;
}

EXPORT_SYMBOL_GPL(ide_use_fast_pio);

/*
* Standard (generic) timings for PIO modes, from ATA2 specification.
* These timings are for access to the IDE data port register *only*.
Expand Down
16 changes: 2 additions & 14 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,27 +835,15 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))

drive->nice1 = 1;

/*
* MAJOR HACK BARF :-/
*
* FIXME: chipsets own this cruft!
*/
/*
* Move here to prevent module loading clashing.
*/
// drive->autodma = hwif->autodma;
if (hwif->ide_dma_check) {
if (hwif->ide_dma_on) {
/*
* Force DMAing for the beginning of the check.
* Some chipsets appear to do interesting
* things, if not checked and cleared.
* PARANOIA!!!
*/
hwif->dma_off_quietly(drive);
#ifdef CONFIG_IDEDMA_ONLYDISK
if (drive->media == ide_disk)
#endif
ide_set_dma(drive);
ide_set_dma(drive);
}
}
}
Expand Down
Loading

0 comments on commit 2b0460b

Please sign in to comment.