Re: PCI Express support for 2.4 kernel

Richard B. Johnson
2003-12-17T00:09:17Z

On Wed, 17 Dec 2003, Vladimir Kondratiev wrote:

> Arjan van de Ven wrote:
>
> >>>+ /* dummy read to flush PCI write */
> >>>+ readb(addr);
> >>>
> >>>
> >>This is going to choke some hardware, I guarantee.
> >>
> >>You always want to make sure your flush is of the same size at the
> >>write. Reading a byte from an address that the hardware defines as
> >>"32-bit writes only" can get ugly real quick ;-)
> >>
> >>
> >
> >also reading back addr might not be the best choice in case some
> >registers have side effects on reading, it's probably better to read
> >back an address that is known to be ok to read (like the vendor ID
> >field)
> >
> >
> >
> Good idea!

You should not abitrarily flush all the writes with a read
after each write. The PCI/Bus is a FIFO, stuff will get to
the hardware in the order written. If you "flush" every write,
you will seriously hurt the performance. I don't like that
MACRO/Function, whatever it is with the switch shown previously.
All that code just for a "@(*^&$(*^(" write will screw up
performance. I've looked at the result of some the the MACRO
expansions, in particular the get_user, put_user, and copy_to/from
macros where there is a switch. It is not pre-processed out.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.