mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: add assert on number of SMs
HAL gops.gr.config.init_sm_id_table() initializes SM count in struct nvgpu_gr_config. It is almost impossible that SM count is detected as zero. Hence remove the error check and add an assert instead. This also helps with code coverage tests since it is difficult to simulate error condition of having zero SMs detected. Also, HAL gops.gr.config.init_sm_id_table() should always be defined for each platform. Hence remove unnecessary check. Jira NVGPU-4373 Change-Id: Ibd9b301b28d5bd2952367346a8f12fabcee2abd9 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2247845 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
4554b4654a
commit
04adc71304
@@ -105,17 +105,12 @@ int nvgpu_gr_fs_state_init(struct gk20a *g, struct nvgpu_gr_config *config)
|
||||
|
||||
g->ops.gr.init.fs_state(g);
|
||||
|
||||
if (g->ops.gr.config.init_sm_id_table != NULL) {
|
||||
err = g->ops.gr.config.init_sm_id_table(g, config);
|
||||
if (err != 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Is table empty ? */
|
||||
if (g->ops.gr.init.get_no_of_sm(g) == 0U) {
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
nvgpu_assert(g->ops.gr.init.get_no_of_sm(g) > 0U);
|
||||
|
||||
for (sm_id = 0; sm_id < g->ops.gr.init.get_no_of_sm(g);
|
||||
sm_id++) {
|
||||
|
||||
Reference in New Issue
Block a user