Skip to content

Commit

Permalink
drm/nouveau: Make clock gate support conditional
Browse files Browse the repository at this point in the history
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: b138eca ("drm/nouveau: Add support for basic clockgating on Kepler1")
Cc: Martin Peres <martin.peres@free.fr>
Cc: Lyude Paul <lyude@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Thierry Reding authored and Ben Skeggs committed Feb 16, 2018
1 parent b515483 commit 9225626
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9225626

Please sign in to comment.