IB/mthca: Fix access to MTT and MPT tables on non-cache-coherent CPUs
authorMichael S. Tsirkin <mst@mellanox.co.il>
Sat, 10 Feb 2007 21:15:08 +0000 (23:15 +0200)
committerRoland Dreier <rolandd@cisco.com>
Tue, 13 Feb 2007 00:16:29 +0000 (16:16 -0800)
commit391e4dea7189eef32b0c2d121e7e047110c1b83c
tree99cfb7f912837fb6f37ae290c9f1345d218eab06
parent1d1f19cfce7687b557cebdc41bf8a5eeba8a9882
IB/mthca: Fix access to MTT and MPT tables on non-cache-coherent CPUs

We allocate the MTT table with alloc_pages() and then do pci_map_sg(),
so we must call pci_dma_sync_sg() after the CPU writes to the MTT
table.  This works since the device will never write MTTs on mem-free
HCAs, once we get rid of the use of the WRITE_MTT firmware command.
This change is needed to make that work, and is an improvement for
now, since it gives FMRs a chance at working.

For MPTs, both the device and CPU might write there, so we must
allocate DMA coherent memory for these.

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