From 6fffdddb7ad6527083cb165355afd2ebc7564690 Mon Sep 17 00:00:00 2001 From: Austin Tajiri Date: Mon, 9 Jan 2023 06:44:16 +0000 Subject: [PATCH] gpu: nvgpu: add priv_ring.intr_retrigger HAL Add a priv_ring.intr_retrigger HAL for chips that need to retrigger pending interrupts in the PRIV_RING ISR. Jira NVGPU-9217 Change-Id: I976f26a39d148a0ce1ad54b53d982dc0af58197b Signed-off-by: Austin Tajiri Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2839756 Reviewed-by: Rajesh Devaraj Reviewed-by: Seema Khowala Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert GVS: Gerrit_Virtual_Submit --- .../nvgpu/hal/priv_ring/priv_ring_gp10b_fusa.c | 6 +++++- .../gpu/nvgpu/include/nvgpu/gops/priv_ring.h | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/hal/priv_ring/priv_ring_gp10b_fusa.c b/drivers/gpu/nvgpu/hal/priv_ring/priv_ring_gp10b_fusa.c index 94f0a881d..cda569325 100644 --- a/drivers/gpu/nvgpu/hal/priv_ring/priv_ring_gp10b_fusa.c +++ b/drivers/gpu/nvgpu/hal/priv_ring/priv_ring_gp10b_fusa.c @@ -1,7 +1,7 @@ /* * GP10B priv ring * - * Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -240,4 +240,8 @@ void gp10b_priv_ring_isr(struct gk20a *g) if (retries == 0U) { nvgpu_err(g, "priv ringmaster intr ack failed"); } + + if (g->ops.priv_ring.intr_retrigger != NULL) { + g->ops.priv_ring.intr_retrigger(g); + } } diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops/priv_ring.h b/drivers/gpu/nvgpu/include/nvgpu/gops/priv_ring.h index 62030b6cd..1d55e9797 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gops/priv_ring.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gops/priv_ring.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -167,6 +167,21 @@ struct gops_priv_ring { void (*isr_handle_1)(struct gk20a *g, u32 status1); + /** + * @brief Writes the unit level INTR_RETRIGGER register. + * + * @param g [in] Pointer to GPU driver struct. + * + * This function writes the INTR_RETRIGGER register to handle the case + * in which an interrupt is triggered between reading the interrupt + * status register and clearing the interrupts. In this case, the rolled + * up OR of pending interrupts will not change from 0 to 1, so an + * interrupt message would not be sent to GIN. Writing to INTR_RETRIGGER + * ensures that a new message is sent to GIN. + */ + + void (*intr_retrigger)(struct gk20a *g); + /** * @brief Returns number of enumerated Level Two Cache (LTC) chiplets. *