mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: Fixing issue with disabled NVGPU_MM_HONORS_APERTURE aperture
- Patch with SHA "23293fef" introduced an issue, if NVGPU_MM_HONORS_APERTURE is not enabled then we'll set aperture to VIDMEM and will miss any invalid apertures being passed in. JIRA NVGPU-6051 Change-Id: I7d5cf58bcd01c927b794c934be8d0341a61b8e34 Signed-off-by: srajum <srajum@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2415016 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> 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: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
@@ -41,6 +41,11 @@ u32 nvgpu_aperture_mask_raw(struct gk20a *g, enum nvgpu_aperture aperture,
|
||||
{
|
||||
u32 ret_mask = 0;
|
||||
|
||||
if ((aperture == APERTURE_INVALID) || (aperture >= APERTURE_MAX_ENUM)) {
|
||||
nvgpu_do_assert_print(g, "Bad aperture");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some iGPUs treat sysmem (i.e SoC DRAM) as vidmem. In these cases the
|
||||
* "sysmem" aperture should really be translated to VIDMEM.
|
||||
@@ -59,14 +64,6 @@ u32 nvgpu_aperture_mask_raw(struct gk20a *g, enum nvgpu_aperture aperture,
|
||||
case APERTURE_VIDMEM:
|
||||
ret_mask = vidmem_mask;
|
||||
break;
|
||||
case APERTURE_INVALID:
|
||||
nvgpu_do_assert_print(g, "Bad aperture");
|
||||
ret_mask = 0;
|
||||
break;
|
||||
case APERTURE_MAX_ENUM:
|
||||
nvgpu_do_assert_print(g, "Bad aperture");
|
||||
ret_mask = 0;
|
||||
break;
|
||||
default:
|
||||
nvgpu_do_assert_print(g, "Bad aperture");
|
||||
ret_mask = 0;
|
||||
|
||||
Reference in New Issue
Block a user