diff mbox series

[5/5] gpu: host1x: fence: Disable timeout on pre-silicon

Message ID 20240425050238.2943404-5-cyndis@kapsi.fi
State New
Headers show
Series [1/5] gpu: host1x: Fix _writel function declarations | expand

Commit Message

Mikko Perttunen April 25, 2024, 5:02 a.m. UTC
From: Mikko Perttunen <mperttunen@nvidia.com>

Timing can be wonky on pre-silicon platforms, so disable fence timeouts
on pre-silicon platforms.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/gpu/host1x/fence.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Thierry Reding Aug. 29, 2024, 5:57 p.m. UTC | #1
On Thu, Apr 25, 2024 at 08:02:37AM GMT, Mikko Perttunen wrote:
> From: Mikko Perttunen <mperttunen@nvidia.com>
> 
> Timing can be wonky on pre-silicon platforms, so disable fence timeouts
> on pre-silicon platforms.
> 
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
>  drivers/gpu/host1x/fence.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

This fails to build if host1x is built as a module, so I've only applied
the first four patches for now. We'd first need a patch to export the
tegra_is_silicon() helper.

Thierry
diff mbox series

Patch

diff --git a/drivers/gpu/host1x/fence.c b/drivers/gpu/host1x/fence.c
index 139ad1afd935..711eeb93689e 100644
--- a/drivers/gpu/host1x/fence.c
+++ b/drivers/gpu/host1x/fence.c
@@ -11,6 +11,9 @@ 
 #include <linux/slab.h>
 #include <linux/sync_file.h>
 
+#include <soc/tegra/fuse.h>
+
+#include "dev.h"
 #include "fence.h"
 #include "intr.h"
 #include "syncpt.h"
@@ -127,6 +130,12 @@  struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold,
 {
 	struct host1x_syncpt_fence *fence;
 
+	if (!tegra_is_silicon()) {
+		dev_info_once(sp->host->dev,
+			"fence timeout disabled due to pre-silicon platform\n");
+		timeout = false;
+	}
+
 	fence = kzalloc(sizeof(*fence), GFP_KERNEL);
 	if (!fence)
 		return ERR_PTR(-ENOMEM);