Commit 20ddfc00 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] remove _P/_p delaying iops

Lets kill these off for good.

o Remove OUT_BYTE/IN_BYTE and variants. We defaulted to the fast ones
  even before

o Add read barrier for ppc, it needs it
parent 6cd5b33c
......@@ -32,135 +32,156 @@
#include <asm/bitops.h>
static inline u8 ide_inb (u32 port)
static u8 ide_inb (u32 port)
{
return (u8) IN_BYTE(port);
return (u8) inb(port);
}
static inline u8 ide_inb_p (u32 port)
static u16 ide_inw (u32 port)
{
return (u8) IN_BYTE_P(port);
return (u16) inw(port);
}
static inline u16 ide_inw (u32 port)
static void ide_insw (u32 port, void *addr, u32 count)
{
return (u16) IN_WORD(port);
return insw(port, addr, count);
}
static inline u16 ide_inw_p (u32 port)
static u32 ide_inl (u32 port)
{
return (u16) IN_WORD_P(port);
return (u32) inl(port);
}
static inline void ide_insw (u32 port, void *addr, u32 count)
static void ide_insl (u32 port, void *addr, u32 count)
{
while (count--) { *(u16 *)addr = IN_WORD(port); addr += 2; }
insl(port, addr, count);
}
static inline void ide_insw_p (u32 port, void *addr, u32 count)
static void ide_outb (u8 addr, u32 port)
{
while (count--) { *(u16 *)addr = IN_WORD_P(port); addr += 2; }
outb(addr, port);
}
static inline u32 ide_inl (u32 port)
static void ide_outw (u16 addr, u32 port)
{
return (u32) IN_LONG(port);
outw(addr, port);
}
static inline u32 ide_inl_p (u32 port)
static void ide_outsw (u32 port, void *addr, u32 count)
{
return (u32) IN_LONG_P(port);
outsw(port, addr, count);
}
static inline void ide_insl (u32 port, void *addr, u32 count)
static void ide_outl (u32 addr, u32 port)
{
ide_insw(port, addr, (count)<<1);
// while (count--) { *(u32 *)addr = IN_LONG(port); addr += 4; }
outl(addr, port);
}
static inline void ide_insl_p (u32 port, void *addr, u32 count)
static void ide_outsl (u32 port, void *addr, u32 count)
{
ide_insw_p(port, addr, (count)<<1);
// while (count--) { *(u32 *)addr = IN_LONG(port); addr += 4; }
return outsl(port, addr, count);
}
static inline void ide_outb (u8 addr, u32 port)
void default_hwif_iops (ide_hwif_t *hwif)
{
OUT_BYTE(addr, port);
hwif->OUTB = ide_outb;
hwif->OUTW = ide_outw;
hwif->OUTL = ide_outl;
hwif->OUTSW = ide_outsw;
hwif->OUTSL = ide_outsl;
hwif->INB = ide_inb;
hwif->INW = ide_inw;
hwif->INL = ide_inl;
hwif->INSW = ide_insw;
hwif->INSL = ide_insl;
}
static inline void ide_outb_p (u8 addr, u32 port)
EXPORT_SYMBOL(default_hwif_iops);
static u8 ide_mm_inb (u32 port)
{
OUT_BYTE_P(addr, port);
return (u8) readb(port);
}
static inline void ide_outw (u16 addr, u32 port)
static u16 ide_mm_inw (u32 port)
{
OUT_WORD(addr, port);
return (u16) readw(port);
}
static inline void ide_outw_p (u16 addr, u32 port)
static void ide_mm_insw (u32 port, void *addr, u32 count)
{
OUT_WORD_P(addr, port);
#ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */
while (count--) { *(u16 *)addr = __raw_readw(port); iobarrier_r(); addr += 2; }
#else /* everything else is sane benh */
while (count--) { *(u16 *)addr = readw(port); addr += 2; }
#endif
}
static inline void ide_outsw (u32 port, void *addr, u32 count)
static u32 ide_mm_inl (u32 port)
{
while (count--) { OUT_WORD(*(u16 *)addr, port); addr += 2; }
return (u32) readl(port);
}
static inline void ide_outsw_p (u32 port, void *addr, u32 count)
static void ide_mm_insl (u32 port, void *addr, u32 count)
{
while (count--) { OUT_WORD_P(*(u16 *)addr, port); addr += 2; }
#ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */
while (count--) { *(u32 *)addr = __raw_readl(port); iobarrier_r(); addr += 4; }
#else /* everything else is sane benh */
while (count--) { *(u32 *)addr = readl(port); addr += 4; }
#endif
}
static inline void ide_outl (u32 addr, u32 port)
static void ide_mm_outb (u8 value, u32 port)
{
OUT_LONG(addr, port);
writeb(value, port);
}
static inline void ide_outl_p (u32 addr, u32 port)
static void ide_mm_outw (u16 value, u32 port)
{
OUT_LONG_P(addr, port);
writew(value, port);
}
static inline void ide_outsl (u32 port, void *addr, u32 count)
static void ide_mm_outsw (u32 port, void *addr, u32 count)
{
ide_outsw(port, addr, (count)<<1);
// while (count--) { OUT_LONG(*(u32 *)addr, port); addr += 4; }
#ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */
while (count--) { __raw_writew(*(u16 *)addr, port); iobarrier_w(); addr += 2; }
#else /* everything else is sane benh */
while (count--) { writew(*(u16 *)addr, port); addr += 2; }
#endif
}
static inline void ide_outsl_p (u32 port, void *addr, u32 count)
static void ide_mm_outl (u32 value, u32 port)
{
ide_outsw_p(port, addr, (count)<<1);
// while (count--) { OUT_LONG_P(*(u32 *)addr, port); addr += 4; }
writel(value, port);
}
void default_hwif_iops (ide_hwif_t *hwif)
static void ide_mm_outsl (u32 port, void *addr, u32 count)
{
hwif->OUTB = ide_outb;
hwif->OUTBP = ide_outb_p;
hwif->OUTW = ide_outw;
hwif->OUTWP = ide_outw_p;
hwif->OUTL = ide_outl;
hwif->OUTLP = ide_outl_p;
hwif->OUTSW = ide_outsw;
hwif->OUTSWP = ide_outsw_p;
hwif->OUTSL = ide_outsl;
hwif->OUTSLP = ide_outsl_p;
hwif->INB = ide_inb;
hwif->INBP = ide_inb_p;
hwif->INW = ide_inw;
hwif->INWP = ide_inw_p;
hwif->INL = ide_inl;
hwif->INLP = ide_inl_p;
hwif->INSW = ide_insw;
hwif->INSWP = ide_insw_p;
hwif->INSL = ide_insl;
hwif->INSLP = ide_insl_p;
#ifdef CONFIG_PPC
while (count--) { __raw_writel(*(u32 *)addr, port); iobarrier_w(); addr += 4; }
#else /* everything else is sane benh */
while (count--) { writel(*(u32 *)addr, port); addr += 4; }
#endif
}
EXPORT_SYMBOL(default_hwif_iops);
void default_hwif_mmiops (ide_hwif_t *hwif)
{
hwif->OUTB = ide_mm_outb;
hwif->OUTW = ide_mm_outw;
hwif->OUTL = ide_mm_outl;
hwif->OUTSW = ide_mm_outsw;
hwif->OUTSL = ide_mm_outsl;
hwif->INB = ide_mm_inb;
hwif->INW = ide_mm_inw;
hwif->INL = ide_mm_inl;
hwif->INSW = ide_mm_insw;
hwif->INSL = ide_mm_insl;
}
EXPORT_SYMBOL(default_hwif_mmiops);
void default_hwif_transport (ide_hwif_t *hwif)
{
......@@ -217,7 +238,6 @@ void QUIRK_LIST (ide_drive_t *drive)
EXPORT_SYMBOL(QUIRK_LIST);
#if SUPPORT_VLB_SYNC
/*
* Some localbus EIDE interfaces require a special access sequence
* when using 32-bit I/O instructions to transfer data. We call this
......@@ -233,7 +253,6 @@ void ata_vlb_sync (ide_drive_t *drive, ide_ioreg_t port)
}
EXPORT_SYMBOL(ata_vlb_sync);
#endif /* SUPPORT_VLB_SYNC */
/*
* This is used for most PIO data transfers *from* the IDE interface
......@@ -244,7 +263,6 @@ void ata_input_data (ide_drive_t *drive, void *buffer, u32 wcount)
u8 io_32bit = drive->io_32bit;
if (io_32bit) {
#if SUPPORT_VLB_SYNC
if (io_32bit & 2) {
unsigned long flags;
local_irq_save(flags);
......@@ -252,18 +270,8 @@ void ata_input_data (ide_drive_t *drive, void *buffer, u32 wcount)
hwif->INSL(IDE_DATA_REG, buffer, wcount);
local_irq_restore(flags);
} else
#endif /* SUPPORT_VLB_SYNC */
hwif->INSL(IDE_DATA_REG, buffer, wcount);
} else {
#if SUPPORT_SLOW_DATA_PORTS
if (drive->slow) {
u16 *ptr = (u16 *) buffer;
while (wcount--) {
*ptr++ = hwif->INWP(IDE_DATA_REG);
*ptr++ = hwif->INWP(IDE_DATA_REG);
}
} else
#endif /* SUPPORT_SLOW_DATA_PORTS */
hwif->INSW(IDE_DATA_REG, buffer, wcount<<1);
}
}
......@@ -279,7 +287,6 @@ void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount)
u8 io_32bit = drive->io_32bit;
if (io_32bit) {
#if SUPPORT_VLB_SYNC
if (io_32bit & 2) {
unsigned long flags;
local_irq_save(flags);
......@@ -287,18 +294,8 @@ void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount)
hwif->OUTSL(IDE_DATA_REG, buffer, wcount);
local_irq_restore(flags);
} else
#endif /* SUPPORT_VLB_SYNC */
hwif->OUTSL(IDE_DATA_REG, buffer, wcount);
} else {
#if SUPPORT_SLOW_DATA_PORTS
if (drive->slow) {
u16 *ptr = (u16 *) buffer;
while (wcount--) {
hwif->OUTWP(*ptr++, IDE_DATA_REG);
hwif->OUTWP(*ptr++, IDE_DATA_REG);
}
} else
#endif /* SUPPORT_SLOW_DATA_PORTS */
hwif->OUTSW(IDE_DATA_REG, buffer, wcount<<1);
}
}
......@@ -312,6 +309,7 @@ EXPORT_SYMBOL(ata_output_data);
* so if an odd bytecount is specified, be sure that there's at least one
* extra byte allocated for the buffer.
*/
void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
{
ide_hwif_t *hwif = HWIF(drive);
......
......@@ -1945,24 +1945,14 @@ void ide_unregister (unsigned int index)
hwif->OUTB = old_hwif.OUTB;
hwif->OUTW = old_hwif.OUTW;
hwif->OUTL = old_hwif.OUTL;
hwif->OUTBP = old_hwif.OUTBP;
hwif->OUTWP = old_hwif.OUTWP;
hwif->OUTLP = old_hwif.OUTLP;
hwif->OUTSW = old_hwif.OUTSW;
hwif->OUTSWP = old_hwif.OUTSWP;
hwif->OUTSL = old_hwif.OUTSL;
hwif->OUTSLP = old_hwif.OUTSLP;
hwif->INB = old_hwif.INB;
hwif->INW = old_hwif.INW;
hwif->INL = old_hwif.INL;
hwif->INBP = old_hwif.INBP;
hwif->INWP = old_hwif.INWP;
hwif->INLP = old_hwif.INLP;
hwif->INSW = old_hwif.INSW;
hwif->INSWP = old_hwif.INSWP;
hwif->INSL = old_hwif.INSL;
hwif->INSLP = old_hwif.INSLP;
#endif
hwif->mmio = old_hwif.mmio;
......
......@@ -302,24 +302,14 @@ typedef struct ide_io_ops_s {
void (*OUTB)(u8 addr, u32 port);
void (*OUTW)(u16 addr, u32 port);
void (*OUTL)(u32 addr, u32 port);
void (*OUTBP)(u8 addr, u32 port);
void (*OUTWP)(u16 addr, u32 port);
void (*OUTLP)(u32 addr, u32 port);
void (*OUTSW)(u32 port, void *addr, u32 count);
void (*OUTSWP)(u32 port, void *addr, u32 count);
void (*OUTSL)(u32 port, void *addr, u32 count);
void (*OUTSLP)(u32 port, void *addr, u32 count);
u8 (*INB)(u32 port);
u16 (*INW)(u32 port);
u32 (*INL)(u32 port);
u8 (*INBP)(u32 port);
u16 (*INWP)(u32 port);
u32 (*INLP)(u32 port);
void (*INSW)(u32 port, void *addr, u32 count);
void (*INSWP)(u32 port, void *addr, u32 count);
void (*INSL)(u32 port, void *addr, u32 count);
void (*INSLP)(u32 port, void *addr, u32 count);
} ide_io_ops_t;
/*
......@@ -374,41 +364,6 @@ extern int ide_irq_lock;
# define ide_get_lock(lock, hdlr, data) do {} while (0)
#endif /* IDE_ARCH_LOCK */
/*
* If the arch-dependant ide.h did not declare/define any OUT_BYTE
* or IN_BYTE functions, we make some defaults here.
*/
#ifndef HAVE_ARCH_OUT_BYTE
# ifdef REALLY_FAST_IO
# define OUT_BYTE(b,p) outb((b),(p))
# define OUT_WORD(w,p) outw((w),(p))
# define OUT_LONG(l,p) outl((l),(p))
# else
# define OUT_BYTE(b,p) outb_p((b),(p))
# define OUT_WORD(w,p) outw_p((w),(p))
# define OUT_LONG(l,p) outl_p((l),(p))
# endif
# define OUT_BYTE_P(b,p) outb_p((b),(p))
# define OUT_WORD_P(w,p) outw_p((w),(p))
# define OUT_LONG_P(l,p) outl_p((l),(p))
#endif
#ifndef HAVE_ARCH_IN_BYTE
# ifdef REALLY_FAST_IO
# define IN_BYTE(p) (u8) inb(p)
# define IN_WORD(p) (u16) inw(p)
# define IN_LONG(p) (u32) inl(p)
# else
# define IN_BYTE(p) (u8) inb_p(p)
# define IN_WORD(p) (u16) inw_p(p)
# define IN_LONG(p) (u32) inl_p(p)
# endif
# define IN_BYTE_P(p) (u8) inb_p(p)
# define IN_WORD_P(p) (u16) inw_p(p)
# define IN_LONG_P(p) (u32) inl_p(p)
#endif
/*
* Now for the data we need to maintain per-drive: ide_drive_t
*/
......@@ -1011,24 +966,14 @@ typedef struct hwif_s {
void (*OUTB)(u8 addr, u32 port);
void (*OUTW)(u16 addr, u32 port);
void (*OUTL)(u32 addr, u32 port);
void (*OUTBP)(u8 addr, u32 port);
void (*OUTWP)(u16 addr, u32 port);
void (*OUTLP)(u32 addr, u32 port);
void (*OUTSW)(u32 port, void *addr, u32 count);
void (*OUTSWP)(u32 port, void *addr, u32 count);
void (*OUTSL)(u32 port, void *addr, u32 count);
void (*OUTSLP)(u32 port, void *addr, u32 count);
u8 (*INB)(u32 port);
u16 (*INW)(u32 port);
u32 (*INL)(u32 port);
u8 (*INBP)(u32 port);
u16 (*INWP)(u32 port);
u32 (*INLP)(u32 port);
void (*INSW)(u32 port, void *addr, u32 count);
void (*INSWP)(u32 port, void *addr, u32 count);
void (*INSL)(u32 port, void *addr, u32 count);
void (*INSLP)(u32 port, void *addr, u32 count);
#endif
/* dma physical region descriptor table (cpu view) */
......
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