Skip to contentSkip to conversation

drm/nouveau: Make clock gate support conditional

PATCH In review Thierry Reding 2 participants 2 messages Feb 7, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: Make clock gate support conditional

From: Thierry Reding <[email protected]>

The recently introduced clock gate support breaks on Tegra chips because no thermal support is enabled for those devices. Conditionalize the code on the existence of thermal support to fix this.

Fixes b138eca661cc ("drm/nouveau: Add support for basic clockgating on Kepler1")
Cc Martin Peres <[email protected]>
Cc Lyude Paul <[email protected]>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +3 -3
index bf62303571b3..3695cde669f8 100644
@@ -301,7 +301,7 @@ nvkm_therm_attr_set(struct nvkm_therm *therm,
 void
 nvkm_therm_clkgate_enable(struct nvkm_therm *therm)
 {
-	if (!therm->func->clkgate_enable || !therm->clkgating_enabled)
+	if (!therm || !therm->func->clkgate_enable || !therm->clkgating_enabled)
 		return;
 
 	nvkm_debug(&therm->subdev,
@@ -312,7 +312,7 @@ nvkm_therm_clkgate_enable(struct nvkm_therm *therm)
 void
 nvkm_therm_clkgate_fini(struct nvkm_therm *therm, bool suspend)
 {
-	if (!therm->func->clkgate_fini || !therm->clkgating_enabled)
+	if (!therm || !therm->func->clkgate_fini || !therm->clkgating_enabled)
 		return;
 
 	nvkm_debug(&therm->subdev,
@@ -395,7 +395,7 @@ void
 nvkm_therm_clkgate_init(struct nvkm_therm *therm,
 			const struct nvkm_therm_clkgate_pack *p)
 {
-	if (!therm->func->clkgate_init || !therm->clkgating_enabled)
+	if (!therm || !therm->func->clkgate_init || !therm->clkgating_enabled)
 		return;
 
 	therm->func->clkgate_init(therm, p);
Signature · 6 lines
2.15.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 50 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The recently introduced clock gate support breaks on Tegra chips because no thermal support is enabled for those devices. Conditionalize the code on the existence of thermal support to fix this.

Fixes b138eca661cc ("drm/nouveau: Add support for basic clockgating on

Kepler1")

Cc Martin Peres <[email protected]>
Cc Lyude Paul <[email protected]>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +1 -1
index bf62303571b3..3695cde669f8 100644
@@ -301,7 +301,7 @@ nvkm_therm_attr_set(struct nvkm_therm *therm,
 void
 nvkm_therm_clkgate_enable(struct nvkm_therm *therm)
 {
-	if (!therm->func->clkgate_enable || !therm->clkgating_enabled)
+	if (!therm || !therm->func->clkgate_enable || !therm-
 >clkgating_enabled)
 		return;
 
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +1 -1
 	nvkm_debug(&therm->subdev,
@@ -312,7 +312,7 @@ nvkm_therm_clkgate_enable(struct nvkm_therm *therm)
 void
 nvkm_therm_clkgate_fini(struct nvkm_therm *therm, bool suspend)
 {
-	if (!therm->func->clkgate_fini || !therm->clkgating_enabled)
+	if (!therm || !therm->func->clkgate_fini || !therm-
 >clkgating_enabled)
 		return;
 
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +1 -1
 	nvkm_debug(&therm->subdev,
@@ -395,7 +395,7 @@ void
 nvkm_therm_clkgate_init(struct nvkm_therm *therm,
 			const struct nvkm_therm_clkgate_pack *p)
 {
-	if (!therm->func->clkgate_init || !therm->clkgating_enabled)
+	if (!therm || !therm->func->clkgate_init || !therm-
 >clkgating_enabled)
 		return;
 

therm->func->clkgate_init(therm, p);

Signature · 6 lines
Cheers,
	Lyude Paul
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel