gpu: nvgpu: add g->func_regs

rework nvgpu_func_* io accessors to use g->func_regs rather than use
g->regs. g->regs is invalid for VF.

Jira GVSCI-15732

Change-Id: I71e788ff135c5a286b273c151e1bd0a88e9d61e2
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2863429
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Richard Zhao
2023-01-11 22:35:48 -08:00
committed by mobile promotions
parent d50889585e
commit de0e1be1ed
4 changed files with 33 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
/*
* NVIDIA GPU HAL interface.
*
* Copyright (c) 2014-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2014-2023, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -143,5 +143,12 @@ int nvgpu_detect_chip(struct gk20a *g)
return err;
}
if (g->func_regs == 0U &&
g->ops.func.get_full_phys_offset != NULL) {
g->func_regs = nvgpu_safe_add_u64(g->regs,
g->ops.func.get_full_phys_offset(g));
g->func_regs_saved = g->func_regs;
}
return 0;
}