habanalabs: MMU invalidation h/w is per device
authorOded Gabbay <ogabbay@kernel.org>
Mon, 5 Sep 2022 14:14:45 +0000 (17:14 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 19 Sep 2022 12:08:39 +0000 (15:08 +0300)
commit82736b063fde67ea2a9b16ef5acf3d5db03e2deb
treed0ddfb95f9eeef1e6e83da5a8e85fefc960d7123
parent6f0818c9fc9b81d8a303a8d3fb1826d71777f7ed
habanalabs: MMU invalidation h/w is per device

The code used the mmu mutex to protect access to the context's page
tables and invalidation of the MMU cache. Because pgt are per
context, the mmu mutex was a member of the context object.

The problem is that the device has a single MMU invalidation h/w
(per MMU). Therefore, the mmu mutex should not be a property of the
context but a property of the device.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_buffer.c
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/common/memory.c
drivers/misc/habanalabs/common/mmu/mmu.c
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/gaudi2/gaudi2.c