gpu: nvgpu: fix emulate mode enable

The emulate mode support is determined after chip detect and is flagged
by using NVGPU_SUPPORT_EMULATE_MODE flag. The present logic prevents
user from configuring the emulate mode sysfs knobs if this flag is not
set, however the emulate mode usecase requires the user to configure the
syfs knob prior to power-on, hence defer emulate mode check to a later
stage after chip detect.

Bug 3621460

Change-Id: If522527542fa8d7e95ccbcff43b74adbb9e976e6
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2703953
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Mayur Poojary <mpoojary@nvidia.com>
Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: David Li <davli@nvidia.com>
This commit is contained in:
Antony Clince Alex
2022-04-28 02:28:43 +00:00
committed by mobile promotions
parent e3ed309d35
commit 61ae0b7642
3 changed files with 8 additions and 6 deletions

View File

@@ -1327,10 +1327,6 @@ static ssize_t emulate_mode_store(struct device *dev,
if (kstrtoul(buf, 10, &val) < 0)
return -EINVAL;
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_EMULATE_MODE)) {
nvgpu_err(g, "Emulate mode not supported");
return -EINVAL;
}
if (nvgpu_is_powered_on(g)) {
nvgpu_err(g, "GPU is powered on already, emulate mode "
"cannot be enabled");