Commit 7fae0977 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[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.
parent e1009878
......@@ -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
}
......
......@@ -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",
......
......@@ -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;
......
......@@ -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);
}
/*
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment