Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57526
b: refs/heads/master
c: 0380dad
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jun 8, 2007
1 parent 7c3b013 commit 95d3364
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1abb8a8b841354e7a09ba2009376f0a6368b5cec
refs/heads/master: 0380dad45e4f5a606025cc4df2a2cd26af08796b
12 changes: 6 additions & 6 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ EXPORT_SYMBOL_GPL(ide_undecoded_slave);
* This routine only knows how to look for drive units 0 and 1
* on an interface, so any setting of MAX_DRIVES > 2 won't work here.
*/
static void probe_hwif(ide_hwif_t *hwif)
static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
{
unsigned int unit;
unsigned long flags;
Expand Down Expand Up @@ -820,6 +820,9 @@ static void probe_hwif(ide_hwif_t *hwif)
return;
}

if (fixup)
fixup(hwif);

for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];

Expand Down Expand Up @@ -874,10 +877,7 @@ static int hwif_init(ide_hwif_t *hwif);

int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
{
probe_hwif(hwif);

if (fixup)
fixup(hwif);
probe_hwif(hwif, fixup);

if (!hwif_init(hwif)) {
printk(KERN_INFO "%s: failed to initialize IDE interface\n",
Expand Down Expand Up @@ -1404,7 +1404,7 @@ int ideprobe_init (void)

for (index = 0; index < MAX_HWIFS; ++index)
if (probe[index])
probe_hwif(&ide_hwifs[index]);
probe_hwif(&ide_hwifs[index], NULL);
for (index = 0; index < MAX_HWIFS; ++index)
if (probe[index])
hwif_init(&ide_hwifs[index]);
Expand Down
34 changes: 18 additions & 16 deletions trunk/drivers/ide/pci/it821x.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*
* linux/drivers/ide/pci/it821x.c Version 0.10 Mar 10 2007
* linux/drivers/ide/pci/it821x.c Version 0.15 Jun 2 2007
*
* Copyright (C) 2004 Red Hat <alan@redhat.com>
* Copyright (C) 2007 Bartlomiej Zolnierkiewicz
Expand Down Expand Up @@ -262,7 +262,7 @@ static int it821x_tunepio(ide_drive_t *drive, u8 set_pio)
}

if (itdev->smart)
goto set_drive_speed;
return 0;

/* We prefer 66Mhz clock for PIO 0-3, don't care for PIO4 */
itdev->want[unit][1] = pio_want[set_pio];
Expand All @@ -271,7 +271,6 @@ static int it821x_tunepio(ide_drive_t *drive, u8 set_pio)
it821x_clock_strategy(drive);
it821x_program(drive, itdev->pio[unit]);

set_drive_speed:
return ide_config_drive_speed(drive, XFER_PIO_0 + set_pio);
}

Expand Down Expand Up @@ -455,12 +454,12 @@ static int it821x_tune_chipset (ide_drive_t *drive, byte xferspeed)
default:
return 1;
}

return ide_config_drive_speed(drive, speed);
}
/*
* In smart mode the clocking is done by the host controller
* snooping the mode we picked. The rest of it is not our problem
*/
return ide_config_drive_speed(drive, speed);

/* don't touch anything in the smart mode */
return 0;
}

/**
Expand Down Expand Up @@ -559,17 +558,10 @@ static void __devinit it821x_fixups(ide_hwif_t *hwif)
if(idbits[129] != 1)
printk("(%dK stripe)", idbits[146]);
printk(".\n");
/* Now the core code will have wrongly decided no DMA
so we need to fix this */
hwif->dma_off_quietly(drive);
#ifdef CONFIG_IDEDMA_ONLYDISK
if (drive->media == ide_disk)
#endif
ide_set_dma(drive);
} else {
/* Non RAID volume. Fixups to stop the core code
doing unsupported things */
id->field_valid &= 1;
id->field_valid &= 3;
id->queue_depth = 0;
id->command_set_1 = 0;
id->command_set_2 &= 0xC400;
Expand All @@ -584,6 +576,16 @@ static void __devinit it821x_fixups(ide_hwif_t *hwif)
printk(KERN_INFO "%s: Performing identify fixups.\n",
drive->name);
}

/*
* Set MWDMA0 mode as enabled/support - just to tell
* IDE core that DMA is supported (it821x hardware
* takes care of DMA mode programming).
*/
if (id->capability & 1) {
id->dma_mword |= 0x0101;
drive->current_speed = XFER_MW_DMA_0;
}
}

}
Expand Down

0 comments on commit 95d3364

Please sign in to comment.