Re: Memory mapped IO vs Port IO

jw schultz
2003-09-12T01:39:16Z

On Thu, Sep 11, 2003 at 07:25:50PM +0200, Andi Kleen wrote:
> On Thu, 11 Sep 2003 18:12:05 +0100
> Jamie Lokier <jamie@shareable.org> wrote:
>
> > Andi Kleen wrote:
> > > Even a memory write is tens to hundres of cycles.
> >
> > Not from the CPU's perspective. It is done in parallel with other
> > instructions.
>
> Only when there are more instructions to execute. But device
> driver code often does a following read e.g. to check if it can submit
> another request to the hardware.
>
> My claim is basically:
>
> Change everybody who currently does
>
> #ifdef CONFIG_MMIO
> writel(... )
> readl(...)
> #else
> outl( ... )
> inl ( ...)
> #endif
>
> to
> if (dev->mmio) {
> writel();
> real();
> } else {
> outl();
> inl();
> }
>
> and you will have a hard time to benchmark the difference on any non ancient system
> in actual driver operation.

Shouldn't that be

dev->dev_ops->writel(...);
dev->dev_ops->readl(...);

with no conditionals?

--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw@pegasys.ws

Remember Cernan and Schmitt