mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Syncpoint invalid value to ~0.
As qnx syncpoint's invalid value is ~0, change the code to handle this. Bug 200603716 Change-Id: I5ec79688cd9e60066725781f1effe57692ec0c27 Signed-off-by: Dinesh <dt@nvidia.com> (cherry picked from commit 705260565a75bc90683841c4c08e4c857bda39f0) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2331208 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -54,6 +54,7 @@
|
|||||||
#include <nvgpu/channel_user_syncpt.h>
|
#include <nvgpu/channel_user_syncpt.h>
|
||||||
#include <nvgpu/runlist.h>
|
#include <nvgpu/runlist.h>
|
||||||
#include <nvgpu/fifo/userd.h>
|
#include <nvgpu/fifo/userd.h>
|
||||||
|
#include <nvgpu/nvhost.h>
|
||||||
#include <nvgpu/fence.h>
|
#include <nvgpu/fence.h>
|
||||||
#include <nvgpu/preempt.h>
|
#include <nvgpu/preempt.h>
|
||||||
#include <nvgpu/static_analysis.h>
|
#include <nvgpu/static_analysis.h>
|
||||||
|
|||||||
@@ -354,7 +354,13 @@ nvgpu_channel_sync_syncpt_create(struct nvgpu_channel *c)
|
|||||||
sp->id = nvgpu_nvhost_get_syncpt_host_managed(sp->nvhost,
|
sp->id = nvgpu_nvhost_get_syncpt_host_managed(sp->nvhost,
|
||||||
c->chid, syncpt_name);
|
c->chid, syncpt_name);
|
||||||
|
|
||||||
if (sp->id == 0U) {
|
/**
|
||||||
|
* This is a WAR to handle invalid value of a syncpt.
|
||||||
|
* Once nvhost update the return value as NVGPU_INVALID_SYNCPT_ID,
|
||||||
|
* we can remove the zero check.
|
||||||
|
*/
|
||||||
|
if ((sp->id == 0U) ||
|
||||||
|
(sp->id == NVGPU_INVALID_SYNCPT_ID)) {
|
||||||
nvgpu_kfree(c->g, sp);
|
nvgpu_kfree(c->g, sp);
|
||||||
nvgpu_err(c->g, "failed to get free syncpt");
|
nvgpu_err(c->g, "failed to get free syncpt");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -88,7 +88,13 @@ nvgpu_channel_user_syncpt_create(struct nvgpu_channel *ch)
|
|||||||
s->syncpt_id = nvgpu_nvhost_get_syncpt_client_managed(s->nvhost,
|
s->syncpt_id = nvgpu_nvhost_get_syncpt_client_managed(s->nvhost,
|
||||||
syncpt_name);
|
syncpt_name);
|
||||||
|
|
||||||
if (s->syncpt_id == 0U) {
|
/**
|
||||||
|
* This is a WAR to handle invalid value of a syncpt.
|
||||||
|
* Once nvhost update the return value as NVGPU_INVALID_SYNCPT_ID,
|
||||||
|
* we can remove the zero check.
|
||||||
|
*/
|
||||||
|
if ((s->syncpt_id == 0U) ||
|
||||||
|
(s->syncpt_id == NVGPU_INVALID_SYNCPT_ID)) {
|
||||||
nvgpu_err(g, "failed to get free syncpt");
|
nvgpu_err(g, "failed to get free syncpt");
|
||||||
goto err_free;
|
goto err_free;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* Nvgpu Channel Synchronization Abstraction (Syncpoints)
|
* Nvgpu Channel Synchronization Abstraction (Syncpoints)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -29,10 +29,9 @@
|
|||||||
#include <nvgpu/types.h>
|
#include <nvgpu/types.h>
|
||||||
#include <nvgpu/utils.h>
|
#include <nvgpu/utils.h>
|
||||||
#include <nvgpu/nvgpu_mem.h>
|
#include <nvgpu/nvgpu_mem.h>
|
||||||
|
#include <nvgpu/nvhost.h>
|
||||||
#include <nvgpu/channel_sync.h>
|
#include <nvgpu/channel_sync.h>
|
||||||
|
|
||||||
#define NVGPU_INVALID_SYNCPT_ID (~U32(0U))
|
|
||||||
|
|
||||||
struct nvgpu_channel;
|
struct nvgpu_channel;
|
||||||
struct nvgpu_channel_sync_syncpt;
|
struct nvgpu_channel_sync_syncpt;
|
||||||
struct priv_cmd_entry;
|
struct priv_cmd_entry;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <nvgpu/types.h>
|
#include <nvgpu/types.h>
|
||||||
|
|
||||||
struct gk20a;
|
struct gk20a;
|
||||||
|
#define NVGPU_INVALID_SYNCPT_ID (~U32(0U))
|
||||||
|
|
||||||
#ifdef CONFIG_TEGRA_GK20A_NVHOST
|
#ifdef CONFIG_TEGRA_GK20A_NVHOST
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <nvgpu/bitops.h>
|
#include <nvgpu/bitops.h>
|
||||||
#include <nvgpu/kmem.h>
|
#include <nvgpu/kmem.h>
|
||||||
|
#include <nvgpu/nvhost.h>
|
||||||
#include <nvgpu/bug.h>
|
#include <nvgpu/bug.h>
|
||||||
#include <nvgpu/ptimer.h>
|
#include <nvgpu/ptimer.h>
|
||||||
#include <nvgpu/vidmem.h>
|
#include <nvgpu/vidmem.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user