ide-pmac: remove pmac_ide_do_setfeature() (take 2)
PATCH 11/11 ide-pmac: remove pmac_ide_do_setfeature() (take 2)
Use ide_config_drive_speed() instead of pmac_ide_do_setfeature() and remove the latter, also ide-iops.c::__ide_wait_stat() could be static again.
Since for IDE PMAC host driver IDE_CONTROL_REG is always true, device's ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than the only changes in behavior are:
* if PIO mode is set then ->dma_off_queitly is called to disable DMA
* if setting transfer mode fails ide_dump_status() is called to dump status
v2:
* IDE PMAC controllers allow separate PIO and DMA timings and PPC userland depends on this fact, and calls "hdparm -p" without calling "hdparm -d".
Therefore to compensate for DMA being disabled by ide_config_drive_speed() for PIO modes:
- add IDE_HFLAG_SET_PIO_MODE_KEEP_DMA flag and set it in PMAC host driver
- add handling of the new flag to ide-io.c::do_special()
--- drivers/ide/ide-io.c | 10 +++++- drivers/ide/ide-iops.c | 2 - drivers/ide/ppc/pmac.c | 80 +------------------------------------------------ include/linux/ide.h | 6 +++ 4 files changed, 18 insertions(+), 80 deletions(-)
drivers/ide/ide-io.c +9 -1
@@ -836,9 +836,17 @@ static ide_startstop_t do_special (ide_dif (set_pio_mode_abuse (drive->hwif, req_pio)) {if (hwif->set_pio_mode) hwif->set_pio_mode (drive, req_pio); - }else + }else { +int keep_dma = drive->using_dma; +ide_set_pio (drive, req_pio); +if (hwif->host_flags &IDE_HFLAG_SET_PIO_MODE_KEEP_DMA ) { +if (keep_dma) + hwif->ide_dma_on (drive); + } + } +return ide_stopped; }else {if (drive->media == ide_disk)
drivers/ide/ide-iops.c +1 -1
@@ -483,7 +483,7 @@ EXPORT_SYMBOL(drive_is_ready);* setting a timer to wake up at half second intervals thereafter, * until timeout is achieved, before timing out. */ -int __ide_wait_stat (ide_drive_t *drive,u8 good,u8 bad,unsigned long timeout,u8 *rstat) +static int __ide_wait_stat (ide_drive_t *drive,u8 good,u8 bad,unsigned long timeout,u8 *rstat) {ide_hwif_t *hwif = drive->hwif;unsigned long flags;
drivers/ide/ppc/pmac.c +3 -77
104 lines not on this page · raw message
include/linux/ide.h +5 -1
@@ -1152,7 +1152,6 @@ extern void SELECT_MASK(ide_drive_t *, iextern void QUIRK_LIST (ide_drive_t *);extern int drive_is_ready (ide_drive_t *); -int __ide_wait_stat (ide_drive_t *,u8 ,u8 ,unsigned long );/* * taskfile io for disks for now...and builds request from ide_ioctl
@@ -1252,6 +1251,11 @@ enum {IDE_HFLAG_ABUSE_FAST_DEVSEL = (1 <<5 ),/* use 100-102 and 200-202 PIO values to set DMA modes */ IDE_HFLAG_ABUSE_DMA_MODES = (1 <<6 ), +/* +* keep DMA setting when programming PIO mode, may be used only +* for hosts which have separate PIO and DMA timings (ie. PMAC) +*/ + IDE_HFLAG_SET_PIO_MODE_KEEP_DMA = (1 << 7), }; typedef struct ide_pci_device_s {
Quoted 10 lines · Bartlomiej Zolnierkiewicz
Use
ide_config_drive_speed()instead ofpmac_ide_do_setfeature()and remove the latter, also ide-iops.c::__ide_wait_stat() could be static again.Since for IDE PMAC host driver
IDE_CONTROL_REGis always true, device's ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than the only changes in behavior are:* if PIO mode is set then ->dma_off_queitly is called to disable DMA
* if setting transfer mode fails
ide_dump_status()is called to dump status
I'll test that today.
Cheers,
Ben.
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 7 lines · Bartlomiej Zolnierkiewicz
Use
ide_config_drive_speed()instead ofpmac_ide_do_setfeature()and remove the latter, also ide-iops.c::__ide_wait_stat() could be static again.Since for IDE PMAC host driver
IDE_CONTROL_REGis always true, device's ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than the only changes in behavior are:
Quoted 5 lines
Quoted 3 lines
* if PIO mode is set then ->dma_off_queitly is called to disable DMA
* if setting transfer mode fails
ide_dump_status()is called to dump statusI'll test that today.
ping?
Quoted 9 lines · Bartlomiej Zolnierkiewicz
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 7 lines · Bartlomiej Zolnierkiewicz
Use
ide_config_drive_speed()instead ofpmac_ide_do_setfeature()and remove the latter, also ide-iops.c::__ide_wait_stat() could be static again.Since for IDE PMAC host driver
IDE_CONTROL_REGis always true, device's ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than the only changes in behavior are:
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
* if PIO mode is set then ->dma_off_queitly is called to disable DMA
* if setting transfer mode fails
ide_dump_status()is called to dump statusI'll test that today.
ping?
Oops, sorry, got delayed by urgent work things among others. I'll get back to that today or next week, not sure yet.
BTW. It might make my life easier if you could email me a tarball of your full current quilt serie :-)
Cheers,
Ben.