mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: railgate returns early if no platform implementation
If platform didn't set railgate/unrailgate callbacks, it means it does not support railgate. It avoids vgpu calling tegra_fuse_clock_disable/enable. Bug 200436689 Jira EVLR-2983 Change-Id: I759dc23145429a59f40cec6e9c1de9536dcf43c4 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1821663 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
f4040bae95
commit
bf14c2a0fa
@@ -766,6 +766,10 @@ static int gk20a_pm_railgate(struct device *dev)
|
||||
int ret = 0;
|
||||
struct gk20a *g = get_gk20a(dev);
|
||||
|
||||
/* return early if platform didn't implement railgate */
|
||||
if (!platform->railgate)
|
||||
return 0;
|
||||
|
||||
/* if platform is already railgated, then just return */
|
||||
if (platform->is_railgated && platform->is_railgated(dev))
|
||||
return ret;
|
||||
@@ -780,7 +784,6 @@ static int gk20a_pm_railgate(struct device *dev)
|
||||
g->pstats.last_rail_ungate_complete);
|
||||
#endif
|
||||
|
||||
if (platform->railgate)
|
||||
ret = platform->railgate(dev);
|
||||
if (ret) {
|
||||
nvgpu_err(g, "failed to railgate platform, err=%d", ret);
|
||||
@@ -803,6 +806,10 @@ static int gk20a_pm_unrailgate(struct device *dev)
|
||||
int ret = 0;
|
||||
struct gk20a *g = get_gk20a(dev);
|
||||
|
||||
/* return early if platform didn't implement unrailgate */
|
||||
if (!platform->unrailgate)
|
||||
return 0;
|
||||
|
||||
ret = tegra_fuse_clock_enable();
|
||||
if (ret) {
|
||||
nvgpu_err(g, "failed to enable tegra fuse clock, err=%d", ret);
|
||||
@@ -821,11 +828,9 @@ static int gk20a_pm_unrailgate(struct device *dev)
|
||||
|
||||
trace_gk20a_pm_unrailgate(dev_name(dev));
|
||||
|
||||
if (platform->unrailgate) {
|
||||
nvgpu_mutex_acquire(&platform->railgate_lock);
|
||||
ret = platform->unrailgate(dev);
|
||||
nvgpu_mutex_release(&platform->railgate_lock);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
g->pstats.last_rail_ungate_complete = jiffies;
|
||||
|
||||
Reference in New Issue
Block a user