From 1b216d778a7938072aa2a68ebef38bb954418257 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Thu, 11 Aug 2016 16:56:01 +0530 Subject: gpu: nvgpu: Disable rail gating for dGPU Bug 200224907 Change-Id: I515bba1987e54fb5ab78efda85916b6f0d3a4297 Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1201233 (cherry picked from commit aa45908e77d451376728860cebe3938e765c4388) Reviewed-on: http://git-master/r/1201654 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/pci.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/pci.c b/drivers/gpu/nvgpu/pci.c index 5165c715..5d058ed9 100644 --- a/drivers/gpu/nvgpu/pci.c +++ b/drivers/gpu/nvgpu/pci.c @@ -47,6 +47,7 @@ static struct gk20a_platform nvgpu_pci_device = { /* power management configuration */ .railgate_delay = 500, + .can_railgate = false, .can_elpg = false, /* power management callbacks */ @@ -165,17 +166,21 @@ static int nvgpu_pci_pm_init(struct device *dev) #ifdef CONFIG_PM struct gk20a_platform *platform = gk20a_get_platform(dev); - if (platform->railgate_delay) - pm_runtime_set_autosuspend_delay(dev, - platform->railgate_delay); - - /* - * Runtime PM for PCI devices is disabled by default, - * so we need to enable it first - */ - pm_runtime_use_autosuspend(dev); - pm_runtime_put_noidle(dev); - pm_runtime_allow(dev); + if (!platform->can_railgate) { + pm_runtime_disable(dev); + } else { + if (platform->railgate_delay) + pm_runtime_set_autosuspend_delay(dev, + platform->railgate_delay); + + /* + * Runtime PM for PCI devices is disabled by default, + * so we need to enable it first + */ + pm_runtime_use_autosuspend(dev); + pm_runtime_put_noidle(dev); + pm_runtime_allow(dev); + } #endif return 0; } -- cgit v1.2.2