2008-08-07 13:41:24

by Andreas.Eversberg

[permalink] [raw]
Subject: AW: [PATCH 3/4] Fix remaining big endian issue of hfcmulti

please note that some cards require MEMIO. disabling it means disabling card types. if there are other future access modes and bridges, they can be implemented and then be selected by the vendor and device ids. read, write and fifo read, write are functions, assigned to pointers at runtime. also wrapping (slightly) different hardware access is possible in the future. i think we should leave it like it is.

also note: reading or writing fifos via PIO is optimized and almost as fast as MEMIO, since io-address byte never changes during fifo access. (auto-incemented after access).

-----Urspr?ngliche Nachricht-----
Von: Benjamin Herrenschmidt [mailto:[email protected]]
Gesendet: Mittwoch, 6. August 2008 02:34
An: Karsten Keil
Cc: Sean MacLennan; Linus Torvalds; Andreas.Eversberg; [email protected]; [email protected]
Betreff: Re: [PATCH 3/4] Fix remaining big endian issue of hfcmulti

On Wed, 2008-08-06 at 02:18 +0200, Karsten Keil wrote:
>
> For the xhfc this may be a differnt choice, to select the access method on
> compile time, because the chip is mainly used for embedded systems, so it
> do not need to have a generic driver, the kerne is usually configured
> exactly for the hardware. On the other side, if you look into the xhfc
> chip and documentation, it is not so different from the HFC 4/8S, so maybe
> it would be possible to integrate it in hfcmulti as well.
>
> And maybe here is a third way, to have a tristate CONFIG MEMIO,PIO,BOTH,
> which could be imlemented in the none indirect call version without
> overhead. I think I like this idea.

That's probably the best way. On powerpc, we have done a lot of work
to make it possible to have kernels support multiple platforms
even in the embedded space. You don't have to do it, but we found it
important to allow for it.

It forces to keep the code cleaner, but also makes it possible for
somebody release a range of products based on different designs to
support/release single binary images for the entire product range
(at least provided it's the same CPU core "family", we don't currently
support single binaries mixing for example 44x and 8xx processor
support). What to actually do at runtime being decided based on the
content of a "device-tree" passed to the kernel by the firmware or the
boot wrapper.

Thus, I find it a good idea to allow the option even for embedded
drivers to be built with runtime detection of access method.

Cheers,
Ben.


2008-08-07 13:46:44

by Karsten Keil

[permalink] [raw]
Subject: Re: [PATCH 3/4] Fix remaining big endian issue of hfcmulti

On Thu, Aug 07, 2008 at 01:01:38PM +0200, Andreas.Eversberg wrote:
> please note that some cards require MEMIO. disabling it means disabling
> card types. if there are other future access modes and bridges,
> they can be implemented and then be selected by the vendor and device ids.
> read, write and fifo read, write are functions,
> assigned to pointers at runtime. also wrapping (slightly) different hardware
> access is possible in the future. i think we should leave it like it is.
(Please break long lines)

No, disabling modes is a valid optimation for self compiled kernel versions,
which are for exact one hardware, yes for normal hardware you would not able
to meassure the difference, but for embedded systems it makes sense.
Of course this is nothing a distribution will use.

I think we should remove the indirect calls, they are not needed here, even if
here are other future access methods. Modern CPUs are lot better in optimation
conditional branches so this cost much less as a indirect call. Note on a
static call the cpu can prefetch the instructions for the call target as soon
it decodes the call itself - with a indirect call, it cannot start prefetching
until the address is calculated and loaded).

--
Karsten Keil
SuSE Labs
ISDN and VOIP development
SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg)