mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +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;
|
int ret = 0;
|
||||||
struct gk20a *g = get_gk20a(dev);
|
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 already railgated, then just return */
|
||||||
if (platform->is_railgated && platform->is_railgated(dev))
|
if (platform->is_railgated && platform->is_railgated(dev))
|
||||||
return ret;
|
return ret;
|
||||||
@@ -780,7 +784,6 @@ static int gk20a_pm_railgate(struct device *dev)
|
|||||||
g->pstats.last_rail_ungate_complete);
|
g->pstats.last_rail_ungate_complete);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (platform->railgate)
|
|
||||||
ret = platform->railgate(dev);
|
ret = platform->railgate(dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
nvgpu_err(g, "failed to railgate platform, err=%d", 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;
|
int ret = 0;
|
||||||
struct gk20a *g = get_gk20a(dev);
|
struct gk20a *g = get_gk20a(dev);
|
||||||
|
|
||||||
|
/* return early if platform didn't implement unrailgate */
|
||||||
|
if (!platform->unrailgate)
|
||||||
|
return 0;
|
||||||
|
|
||||||
ret = tegra_fuse_clock_enable();
|
ret = tegra_fuse_clock_enable();
|
||||||
if (ret) {
|
if (ret) {
|
||||||
nvgpu_err(g, "failed to enable tegra fuse clock, err=%d", 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));
|
trace_gk20a_pm_unrailgate(dev_name(dev));
|
||||||
|
|
||||||
if (platform->unrailgate) {
|
|
||||||
nvgpu_mutex_acquire(&platform->railgate_lock);
|
nvgpu_mutex_acquire(&platform->railgate_lock);
|
||||||
ret = platform->unrailgate(dev);
|
ret = platform->unrailgate(dev);
|
||||||
nvgpu_mutex_release(&platform->railgate_lock);
|
nvgpu_mutex_release(&platform->railgate_lock);
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
g->pstats.last_rail_ungate_complete = jiffies;
|
g->pstats.last_rail_ungate_complete = jiffies;
|
||||||
|
|||||||
Reference in New Issue
Block a user