diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index cdb28eaf6..b7444a9e3 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c @@ -141,6 +141,8 @@ static void nvgpu_init_pm_vars(struct gk20a *g) g->pmu.aelpg_param[2] = APCTRL_MINIMUM_TARGET_SAVING_DEFAULT_US; g->pmu.aelpg_param[3] = APCTRL_POWER_BREAKEVEN_DEFAULT_US; g->pmu.aelpg_param[4] = APCTRL_CYCLES_PER_SAMPLE_MAX_DEFAULT; + + __nvgpu_set_enabled(g, NVGPU_SUPPORT_ASPM, !platform->disable_aspm); } static void nvgpu_init_vbios_vars(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index a282110ac..f71a51fde 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -124,7 +124,6 @@ int gk20a_prepare_poweroff(struct gk20a *g) int gk20a_finalize_poweron(struct gk20a *g) { - struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); int err; #if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU) u32 nr_pages; @@ -312,7 +311,7 @@ int gk20a_finalize_poweron(struct gk20a *g) if (g->ops.xve.available_speeds) { u32 speed; - if (platform->disable_aspm && g->ops.xve.disable_aspm) + if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_ASPM) && g->ops.xve.disable_aspm) g->ops.xve.disable_aspm(g); g->ops.xve.available_speeds(g, &speed); diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 87449ccca..145954970 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -125,6 +125,8 @@ struct gk20a; /* whether to run PREOS binary on dGPUs */ #define NVGPU_PMU_RUN_PREOS 61 +/* set if ASPM is enabled; only makes sense for PCI */ +#define NVGPU_SUPPORT_ASPM 62 /* * Must be greater than the largest bit offset in the above list. */