Re: DMA mapping

From: Matthew Jacob (mjacob@feral.com)
Date: Tue Mar 07 2000 - 08:59:15 EST


> I have a nice piece of hardware, that manages state (32-bit handle)
> for me. It is just a shame that I will have to hack further state
> tracking on top.

I had the same problem for the Qlogic cards- they return, either in a
response queue entry or in two 16 bit registers, a 32 bit handle that
identifies a completing command. But this was always sorta busted for alpha &&
ultrasparc to try and figure out from this what the real address of the
original command block was, so I just began using the handle as an index into
a an array of pointers- turns out this is much cleaner and safer because a lot
of times the Qlogic f/w is confused and returns garbage instead of the correct
handle- it's much easier to detect this when you have an index in the range of
0 to 1024 rather than assume what you get back from the card is a valid
pointer.

Moral: it's a bad practice to take candy from strangers (i.e., trust
CPU pointers as returned out of I/O cards).

-
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/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:22 EST