1999-12-21 23:49:07

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [patch] read[bwl] and ioremap problem

Date: Sat, 18 Dec 1999 15:50:19 -0800 (PST)
From: Linus Torvalds <[email protected]>

THAT case is certainly a rather strong argument for using something
like "gsc_read[bwl]()" on HP-PA.

The other strong reason for doing gsc_read[bwl] on HP-PA is that some
PA-RISC boxes have both a GSC bus *and* a PCI bus, and you need to
access devices on both buses....

Something to consider is that for certain drivers, such as the serial
driver, I'm already having to do a serial_inp() which dispatches to the
proper {inb,readb,gsc_readb} already. Yes I take a overhead/performance
hit for doing this, but it's the only clean way to support both ISA and
PCI serial boards in a single i386 box, or to support multiple buses in
the HP-PA scenario.

We've historically said that this kind of thing is horrible for
performance reasons, and the SCO and NetBSD approaches of doing
parameterized I/O has been derided for that reason. However, it's
something that perhaps we should rethink; on modern CPU's, the extra
procedure activation/deactivation isn't *that* expensive, and it ends up
making the drivers much more portable and easier to support multiple
architectures. The alternative is that each driver author ends up
writing their own I/O dispatch routines, such as what's currently in the
serial driver. While this approach does have some advantages, in that
each driver author can decide whether or not he/she wishes to pay the
indirection overhead, it can mean code duplication and a delay before
certain devices get supported on non-mainline architectures.

Something to think about.

- Ted