From: Omer Shpigelman Date: Sun, 17 May 2020 14:35:39 +0000 (+0300) Subject: habanalabs: improve MMU cache invalidation code X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=42d0b0b95f9822fc02440c0ae5f9192c0ebe54bf;p=linux.git habanalabs: improve MMU cache invalidation code A new sequence is introduced to invalidate the MMU cache in order to avoid timeouts. Signed-off-by: Omer Shpigelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index 4cb1f71dd4f1e..093384731f0d0 100644 --- a/drivers/misc/habanalabs/gaudi/gaudi.c +++ b/drivers/misc/habanalabs/gaudi/gaudi.c @@ -5982,16 +5982,18 @@ static void gaudi_mmu_invalidate_cache(struct hl_device *hdev, bool is_hard, timeout_usec = MMU_CONFIG_TIMEOUT_USEC; /* L0 & L1 invalidation */ - WREG32(mmSTLB_INV_ALL_START, 1); + WREG32(mmSTLB_INV_PS, 2); rc = hl_poll_timeout( hdev, - mmSTLB_INV_ALL_START, + mmSTLB_INV_PS, status, !status, 1000, timeout_usec); + WREG32(mmSTLB_INV_SET, 0); + if (rc) dev_notice_ratelimited(hdev->dev, "Timeout when waiting for MMU cache invalidation\n");