gpu: nvgpu: gsp sched: get device id from runlist pri base

Get the device id from runlist pri base instead of reading from
runlist structure which could be failing if the device node not
present inside the runlist struct.
This Change will call the get device id hal to get it from rlend_id
and runlist pri base.

NVGPU-8531

Change-Id: Ia81189a6c2281ed09ee52eb461f0cd87164c5fc4
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2791605
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
rmylavarapu
2022-10-13 16:41:42 +00:00
committed by mobile promotions
parent 2b69b9b264
commit c8429c5de9

View File

@@ -1376,20 +1376,16 @@ exit:
s32 nvgpu_runlist_get_device_id(struct gk20a *g, struct nvgpu_runlist *rl, u32 *device_id) s32 nvgpu_runlist_get_device_id(struct gk20a *g, struct nvgpu_runlist *rl, u32 *device_id)
{ {
u8 dev;
s32 err = 0; s32 err = 0;
u32 rleng_id = 0;
for (dev = 0; dev < (u8)(RLENG_PER_RUNLIST_SIZE); dev++) { if (g->ops.runlist.get_engine_id_from_rleng_id != NULL) {
u32 rl_pribase =rl->rl_dev_list[dev]->rl_pri_base; *device_id = g->ops.runlist.get_engine_id_from_rleng_id(g, rleng_id, rl->runlist_pri_base);
if (rl->runlist_pri_base == rl_pribase) { } else {
*device_id = rl->rl_dev_list[dev]->engine_id;
goto exit;
}
}
err = (s32)(-EINVAL); err = (s32)(-EINVAL);
nvgpu_err(g, "Get device ID failed:"); nvgpu_err(g, "Get device ID failed:");
exit: }
return err; return err;
} }