mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: linux: read current syncpt in set safe state
nvhost_syncpt_read_minval() only reads the min value that nvhost has cached. It makes sense for host managed syncpoints, but the user syncpoint that needs set_safe_state is client managed; its min and max values are not tracked internally. Use nvhost_syncpt_read_ext_check() to read the actual syncpoint value from HW and set the "safe state" (65536 increments) based on that. The safe state is analogous to "set min equal to max" when max is expected to be no more than the current value plus a big number. Using the cached min value would make this safe state lose its meaning when there could have been more than the big number of increments since the syncpoint was allocated. Jira NVGPU-4548 Change-Id: I395be75f1696e48e344f5503420864efeb3621de Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2323060 (cherry picked from commit ae571178ca63c4fa3e6bf70a4da0221393e975ee) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2326380 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
2d9b839f21
commit
32fae6acf4
@@ -178,7 +178,8 @@ u32 nvgpu_nvhost_syncpt_read_maxval(
|
||||
void nvgpu_nvhost_syncpt_set_safe_state(
|
||||
struct nvgpu_nvhost_dev *nvhost_dev, u32 id)
|
||||
{
|
||||
u32 val;
|
||||
u32 val = 0;
|
||||
int err;
|
||||
|
||||
/*
|
||||
* Add large number of increments to current value
|
||||
@@ -187,11 +188,16 @@ void nvgpu_nvhost_syncpt_set_safe_state(
|
||||
* We don't expect any case where more than 0x10000 increments
|
||||
* are pending
|
||||
*/
|
||||
val = nvhost_syncpt_read_minval(nvhost_dev->host1x_pdev, id);
|
||||
val += 0x10000;
|
||||
|
||||
nvhost_syncpt_set_minval(nvhost_dev->host1x_pdev, id, val);
|
||||
nvhost_syncpt_set_maxval(nvhost_dev->host1x_pdev, id, val);
|
||||
err = nvhost_syncpt_read_ext_check(nvhost_dev->host1x_pdev,
|
||||
id, &val);
|
||||
if (err != 0) {
|
||||
pr_err("%s: syncpt id read failed, cannot reset for safe state",
|
||||
__func__);
|
||||
} else {
|
||||
val += 0x10000;
|
||||
nvhost_syncpt_set_minval(nvhost_dev->host1x_pdev, id, val);
|
||||
nvhost_syncpt_set_maxval(nvhost_dev->host1x_pdev, id, val);
|
||||
}
|
||||
}
|
||||
|
||||
int nvgpu_nvhost_create_symlink(struct gk20a *g)
|
||||
|
||||
Reference in New Issue
Block a user