gpu: nvgpu: check for valid scaling profile data

Check for valid scaling profile private data before making
calls to bandwidth manager.

Bug 200423741

Change-Id: Iff12b4a26ff0dfb2c32248b325a07e97f2de4e98
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1763601
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
seshendra Gadagottu
2018-06-27 16:49:33 -07:00
committed by mobile promotions
parent 2a9c4ce2cc
commit 8fe918c8d2

View File

@@ -133,7 +133,7 @@ static void gp10b_tegra_scale_exit(struct device *dev)
struct gk20a_platform *platform = gk20a_get_platform(dev);
struct gk20a_scale_profile *profile = platform->g->scale_profile;
if (profile)
if (profile && profile->private_data)
tegra_bwmgr_unregister(
(struct tegra_bwmgr_client *)profile->private_data);
}
@@ -300,7 +300,8 @@ void gp10b_tegra_postscale(struct device *pdev,
unsigned long emc_rate;
nvgpu_log_fn(g, " ");
if (profile && !platform->is_railgated(pdev)) {
if (profile && profile->private_data &&
!platform->is_railgated(pdev)) {
unsigned long emc_scale;
if (freq <= gp10b_freq_table[0])