[parisc-linux] airo.c patch for hppa

Grant Grundler grundler@dsl2.external.hp.com
Wed, 4 Dec 2002 10:12:47 -0700


On Wed, Dec 04, 2002 at 02:44:54PM +0000, Matthew Wilcox wrote:
> Grant, I think this is a long-standing bug (Jan 2000!) in
> Dino's port IO macros.

It sounds like there is...

...
> That '& ~3' clears the bottom two bits of the address, so we always read
> from a 32-bit aligned address, even if we actually wanted to read the
> other 16-bit word or one of the other bytes.

The Dino ERS clearly says the AD[0:1] are used for IO Port space.

I gather IO_DATA behaves differently than MEM_DATA.
MEM_DATA definitely uses byte enables to manage subword bytes
and ignores the lower two bits of the address. The GSC byte enables
are forwarded to the PCI bus when doing subword MMIO reads.
Because MEM_DATA was added much later, it seems to have been implemented
with more insight into how GSC/PCI can interact.

> The PORT_OUT define doesn't mask that way:

Right.

...
> LaMont's doing a rebuild now to check it works, but this seems fairly
> obvious to me.  Thoughts?  (Can _anyone_ remember what they were thinking
> when they wrote code nearly three years ago?  ;-)

You are on the right track. And no, I don't remember.

thanks,
grant