From 7fae0977896d9e549486e2f85365310a70a4139d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 4 Feb 2004 20:39:37 -0800 Subject: [PATCH] [PATCH] remove ide_dma_queued_* ops from ide_hwif_t TCQ code is host independent so remove redundant ide_dma_queued_* ops from ide_hwif_t. If we ever decide to bring back TCQ support this will fix OOPS in ide-disk driver with CONFIG_BLK_DEV_IDE_TCQ_DEFAULT=y and icside/sgiioc4 host drivers (it will also enable TCQ support for these host drivers). Acked by Jens. --- drivers/ide/ide-disk.c | 20 +++++++++----------- drivers/ide/ide-dma.c | 23 +++-------------------- drivers/ide/ide-taskfile.c | 6 ++++-- drivers/ide/ide-tcq.c | 4 ++-- drivers/ide/ide.c | 7 ------- drivers/ide/ppc/pmac.c | 7 ------- include/linux/ide.h | 23 ----------------------- 7 files changed, 18 insertions(+), 72 deletions(-) diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index ac2a3ec078ec0..cc767670a038d 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -470,9 +470,10 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector } if (rq_data_dir(rq) == READ) { +#ifdef CONFIG_BLK_DEV_IDE_TCQ if (blk_rq_tagged(rq)) - return hwif->ide_dma_queued_read(drive); - + return __ide_dma_queued_read(drive); +#endif if (drive->using_dma && !hwif->ide_dma_read(drive)) return ide_started; @@ -483,10 +484,10 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector return ide_started; } else if (rq_data_dir(rq) == WRITE) { ide_startstop_t startstop; - +#ifdef CONFIG_BLK_DEV_IDE_TCQ if (blk_rq_tagged(rq)) - return hwif->ide_dma_queued_write(drive); - + return __ide_dma_queued_write(drive); +#endif if (drive->using_dma && !(HWIF(drive)->ide_dma_write(drive))) return ide_started; @@ -1400,13 +1401,10 @@ static int set_acoustic (ide_drive_t *drive, int arg) #ifdef CONFIG_BLK_DEV_IDE_TCQ static int set_using_tcq(ide_drive_t *drive, int arg) { - ide_hwif_t *hwif = HWIF(drive); int ret; if (!drive->driver) return -EPERM; - if (!hwif->ide_dma_queued_on || !hwif->ide_dma_queued_off) - return -ENXIO; if (arg == drive->queue_depth && drive->using_tcq) return 0; @@ -1420,9 +1418,9 @@ static int set_using_tcq(ide_drive_t *drive, int arg) } if (arg) - ret = HWIF(drive)->ide_dma_queued_on(drive); + ret = __ide_dma_queued_on(drive); else - ret = HWIF(drive)->ide_dma_queued_off(drive); + ret = __ide_dma_queued_off(drive); return ret ? -EIO : 0; } @@ -1673,7 +1671,7 @@ static void idedisk_setup (ide_drive_t *drive) #ifdef CONFIG_BLK_DEV_IDE_TCQ_DEFAULT if (drive->using_dma) - HWIF(drive)->ide_dma_queued_on(drive); + __ide_dma_queued_on(drive); #endif } diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 09c7b47a968f0..acf29b5c430a5 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -512,9 +512,9 @@ int __ide_dma_off_quietly (ide_drive_t *drive) if (HWIF(drive)->ide_dma_host_off(drive)) return 1; - - HWIF(drive)->ide_dma_queued_off(drive); - +#ifdef CONFIG_BLK_DEV_IDE_TCQ + __ide_dma_queued_off(drive); +#endif return 0; } @@ -1091,23 +1091,6 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p if (!hwif->ide_dma_lostirq) hwif->ide_dma_lostirq = &__ide_dma_lostirq; - /* - * dma queued ops. if tcq isn't set, queued on and off are just - * dummy functions. cuts down on ifdef hell - */ - if (!hwif->ide_dma_queued_on) - hwif->ide_dma_queued_on = __ide_dma_queued_on; - if (!hwif->ide_dma_queued_off) - hwif->ide_dma_queued_off = __ide_dma_queued_off; -#ifdef CONFIG_BLK_DEV_IDE_TCQ - if (!hwif->ide_dma_queued_read) - hwif->ide_dma_queued_read = __ide_dma_queued_read; - if (!hwif->ide_dma_queued_write) - hwif->ide_dma_queued_write = __ide_dma_queued_write; - if (!hwif->ide_dma_queued_start) - hwif->ide_dma_queued_start = __ide_dma_queued_start; -#endif - if (hwif->chipset != ide_trm290) { u8 dma_stat = hwif->INB(hwif->dma_status); printk(", BIOS settings: %s:%s, %s:%s", diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 44dc1e03ad3e7..eb16f6ec6e280 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -200,12 +200,14 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) if (!hwif->ide_dma_read(drive)) return ide_started; break; +#ifdef CONFIG_BLK_DEV_IDE_TCQ case WIN_READDMA_QUEUED: case WIN_READDMA_QUEUED_EXT: - return hwif->ide_dma_queued_read(drive); + return __ide_dma_queued_read(drive); case WIN_WRITEDMA_QUEUED: case WIN_WRITEDMA_QUEUED_EXT: - return hwif->ide_dma_queued_write(drive); + return __ide_dma_queued_write(drive); +#endif default: if (task->handler == NULL) return ide_stopped; diff --git a/drivers/ide/ide-tcq.c b/drivers/ide/ide-tcq.c index ecf528a45edf8..6a432b5a3aeea 100644 --- a/drivers/ide/ide-tcq.c +++ b/drivers/ide/ide-tcq.c @@ -353,7 +353,7 @@ ide_startstop_t ide_service(ide_drive_t *drive) */ TCQ_PRINTK("ide_service: starting command, stat=%x\n", stat); spin_unlock_irqrestore(&ide_lock, flags); - return HWIF(drive)->ide_dma_queued_start(drive); + return __ide_dma_queued_start(drive); } printk(KERN_ERR "ide_service: missing request for tag %d\n", tag); @@ -729,7 +729,7 @@ static ide_startstop_t ide_dma_queued_rw(ide_drive_t *drive, u8 command) feat = hwif->INB(IDE_NSECTOR_REG); if (!(feat & REL)) { TCQ_PRINTK("IMMED in queued_start, feat=%x\n", feat); - return hwif->ide_dma_queued_start(drive); + return __ide_dma_queued_start(drive); } /* diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 031e2863d8940..8ffdd45a15c4b 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -848,13 +848,6 @@ void ide_unregister (unsigned int index) hwif->ide_dma_verbose = old_hwif.ide_dma_verbose; hwif->ide_dma_lostirq = old_hwif.ide_dma_lostirq; hwif->ide_dma_timeout = old_hwif.ide_dma_timeout; - hwif->ide_dma_queued_on = old_hwif.ide_dma_queued_on; - hwif->ide_dma_queued_off = old_hwif.ide_dma_queued_off; -#ifdef CONFIG_BLK_DEV_IDE_TCQ - hwif->ide_dma_queued_read = old_hwif.ide_dma_queued_read; - hwif->ide_dma_queued_write = old_hwif.ide_dma_queued_write; - hwif->ide_dma_queued_start = old_hwif.ide_dma_queued_start; -#endif #endif #if 0 diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 60706f7471515..8612c8d2bc04c 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -2030,13 +2030,6 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) hwif->ide_dma_verbose = &__ide_dma_verbose; hwif->ide_dma_timeout = &__ide_dma_timeout; hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq; - hwif->ide_dma_queued_on = &__ide_dma_queued_on; - hwif->ide_dma_queued_off = &__ide_dma_queued_off; -#ifdef CONFIG_BLK_DEV_IDE_TCQ - hwif->ide_dma_queued_read = __ide_dma_queued_read; - hwif->ide_dma_queued_write = __ide_dma_queued_write; - hwif->ide_dma_queued_start = __ide_dma_queued_start; -#endif #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO if (!noautodma) diff --git a/include/linux/ide.h b/include/linux/ide.h index 98fe2db57d24d..f5ee5b62adeef 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -801,12 +801,6 @@ typedef struct ide_dma_ops_s { int (*ide_dma_verbose)(ide_drive_t *drive); int (*ide_dma_lostirq)(ide_drive_t *drive); int (*ide_dma_timeout)(ide_drive_t *drive); - /* dma queued operations */ - int (*ide_dma_queued_on)(ide_drive_t *drive); - int (*ide_dma_queued_off)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_read)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_write)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_start)(ide_drive_t *drive); } ide_dma_ops_t; /* @@ -947,13 +941,6 @@ typedef struct hwif_s { int (*ide_dma_lostirq)(ide_drive_t *drive); int (*ide_dma_timeout)(ide_drive_t *drive); - /* dma queued operations */ - int (*ide_dma_queued_on)(ide_drive_t *drive); - int (*ide_dma_queued_off)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_read)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_write)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_start)(ide_drive_t *drive); - void (*OUTB)(u8 addr, unsigned long port); void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); void (*OUTW)(u16 addr, unsigned long port); @@ -1644,16 +1631,6 @@ extern int __ide_dma_queued_off(ide_drive_t *drive); extern ide_startstop_t __ide_dma_queued_read(ide_drive_t *drive); extern ide_startstop_t __ide_dma_queued_write(ide_drive_t *drive); extern ide_startstop_t __ide_dma_queued_start(ide_drive_t *drive); -#else -static inline int __ide_dma_queued_on(ide_drive_t *drive) -{ - return 1; -} - -static inline int __ide_dma_queued_off(ide_drive_t *drive) -{ - return 1; -} #endif #else -- 2.53.0