mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
Currently, in nvgpu_aperture_mask_raw function, if NVGPU_MM_HONORS_APERTURE flag is disabled, invalid or junk aperture input is changed to APERTURE_VIDMEM instead of raising a warning.To resolve this bug, need to check if input aperture is APERTURE_INVALID or undefined. This patch adds APERTURE_MAX_ENUM to nvgpu_aperture structure which gives upperbound of nvgpu_aperture types. This patch also adds condition in nvgpu_aperture_mask_raw function to check for invalid or undefined aperture input. For invalid inputs, function will BUG(). Jira NVGPU-2933 Change-Id: Ic9d260250e3083d693f025c6e32657f6a863aafb Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2034281 Reviewed-by: Philip Elcan <pelcan@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>