Skip to content

Commit 89b3425

Browse files
thierryredingBen Skeggs
authored andcommitted
drm/nouveau/pmu/gm20b,gp10b: Fix Falcon bootstrapping
The low-level Falcon bootstrapping callbacks are expected to return 0 on success or a negative error code on failure. However, the implementation on Tegra returns the ID or mask of the Falcons that were bootstrapped on success, thus breaking the calling code, which treats this as failure. Fix this by making sure we only return 0 or a negative error code, just like the code for discrete GPUs does. Fixes: 86ce2a7 ("drm/nouveau/flcn/cmdq: move command generation to subdevs") Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Ben Skeggs <[email protected]>
1 parent afa3b96 commit 89b3425

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ gm20b_pmu_acr_bootstrap_falcon(struct nvkm_falcon *falcon,
5252
ret = nvkm_falcon_cmdq_send(pmu->hpq, &cmd.cmd.hdr,
5353
gm20b_pmu_acr_bootstrap_falcon_cb,
5454
&pmu->subdev, msecs_to_jiffies(1000));
55-
if (ret >= 0 && ret != cmd.falcon_id)
56-
ret = -EIO;
55+
if (ret >= 0) {
56+
if (ret != cmd.falcon_id)
57+
ret = -EIO;
58+
else
59+
ret = 0;
60+
}
61+
5762
return ret;
5863
}
5964

drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ gp10b_pmu_acr_bootstrap_multiple_falcons(struct nvkm_falcon *falcon, u32 mask)
5252
ret = nvkm_falcon_cmdq_send(pmu->hpq, &cmd.cmd.hdr,
5353
gp10b_pmu_acr_bootstrap_multiple_falcons_cb,
5454
&pmu->subdev, msecs_to_jiffies(1000));
55-
if (ret >= 0 && ret != cmd.falcon_mask)
56-
ret = -EIO;
55+
if (ret >= 0) {
56+
if (ret != cmd.falcon_mask)
57+
ret = -EIO;
58+
else
59+
ret = 0;
60+
}
61+
5762
return ret;
5863
}
5964

0 commit comments

Comments
 (0)