[openib-general] FW: Mstflint - not working on ppc64 andwhendriver is not loaded on AMD

Michael S. Tsirkin mst at mellanox.co.il
Wed Sep 27 23:03:48 PDT 2006


Quoting r. Tseng-Hui (Frank) Lin <thlin at us.ibm.com>:
> On some ppc64 and x86_64 machines, the I/O memory mapped by mmap() is
> not accessable (return 0xFFFFFFFF) unless the kernel code (usually the
> device driver) does an ioremap. This is why mmap resource0 does not work
> on these machines.

Let's be exact here: ioremap *only* does not work if driver is not loaded.
Is that right? If yes, the typical and safe thing for the user is to have
driver loaded and do
-d /sys/class/infiniband/mthca0/device/resource0
without playing with lspci and other low level hacks,
and I would rather you told users to do *that*
(by the way, would it help if you could use "-d mthca0")?

> There is no way I am aware of can do ioremap from
> user space code like mstflint. The only thing I can think of is to fall
> back to use the config space file in /proc/bus/pci/.

How about write/read to/from resource0? Does that work?

> The (big) patch I made checks if the faster way (mmap resource0) works.
> It it doesn't, the patch tries other slower ways and use the fastest
> working way it can find. That's all the patch does. It does not make big
> fix. It just save the users trouble of trying all possible ways of
> opening a devices manually.

I don't reject that approach, not on principle.
This is absolutely something we can consider for trunk.
But let's fist try to make memory access work, even if
it's not with mmap.

-- 
MST




More information about the general mailing list