Re: Unable to read memory mapped PCI memory the second time == freezeup..

Klaus Nielsen (jimbo@zorland.dk)
Sat, 10 Jul 1999 20:24:13 +0200


On Sat, 10 Jul 1999, B. James Phillippe wrote:
> On Sat, 10 Jul 1999, Klaus Nielsen wrote:
>
> I don't know what the problem is, but I couldn't help noticing these lines
> of code look deliberately un-64bit-clean. Is there a reason for this?

uh-no, its just the first time I have done any coding for a platform
that is actually known to be portable to some extent :-)
I have got some nice suggestions, including yours, that I will make
good use of.

> BTW, just for sanity check, where did these addresses "global_pci_memaddr"
> come from? They were read using pcibios_read_config_dword, right?
>
> > I have tried changing compiler (to gcc 2.7.2.3), changing the
> > modem board with one that works with my WinNT driver, adding
> > udelay(60) between accesses, using readb() instead of direct access -
> > no change.
>
> Silly question, but as Jeff suggested, when you tried readb you also tried
> writeb, yes? :-)

Yup :)

After a few talks Jeff suggested to try using mb(); and wmb();

Doing this removed my problem. However I do not understand
completely. If the CPU just rarranged the order of the instructions
it would not freeze, just produce wrong results. So - did the
processor put two instructions - one dependent of the other into each
their pipeline, ignoring their relation, or what? That's a very odd
thing to do... BTW, I am using an AMD K6-III.

I have got several good suggestions of how to make the code more
platform independent that I will make good use of, as I plan to make
this driver the skeleton for future drivers as well.

I enjoy Linux a great deal after having spent some time in NDIS Hell
-a place I will never return to.

Thanks guys.

--
                      Best regards, Klaus.
----------------------------------------------------
     Klaus J. O. Nielsen
 System Engineer, COCOM A/S, www.cocom.dk
 Personal web: http://www.zorland.dk/jimbo
 PGP public key: http://www.zorland.dk/jimbo/kjn.asc

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/