IB/mthca: Fix data corruption after FMR unmap on Sinai
commit608d8268be392444f825b4fc8fc7c8b509627129
authorMichael S. Tsirkin <mst@dev.mellanox.co.il>
Mon, 16 Apr 2007 14:04:55 +0000 (16 17:04 +0300)
committerRoland Dreier <rolandd@cisco.com>
Mon, 16 Apr 2007 21:10:55 +0000 (16 14:10 -0700)
treee6e61a54f55a75ac216e4a48171dc4d6d42ac32d
parent94a05509a9e11806acd797153d03019706e466f1
IB/mthca: Fix data corruption after FMR unmap on Sinai

In mthca_arbel_fmr_unmap(), the high bits of the key are masked off.
This gets rid of the effect of adjust_key(), which makes sure that
bits 3 and 23 of the key are equal when the Sinai throughput
optimization is enabled, and so it may happen that an FMR will end up
with bits 3 and 23 in the key being different.  This causes data
corruption, because when enabling the throughput optimization, the
driver promises the HCA firmware that bits 3 and 23 of all memory keys
will always be equal.

Fix by re-applying adjust_key() after masking the key.

Thanks to Or Gerlitz for reproducing the problem, and Ariel Shahar for
help in debug.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_mr.c