Thierry Reding
2018-Feb-07 17:40 UTC
[Nouveau] [PATCH] drm/nouveau: Make clock gate support conditional
From: Thierry Reding <treding at nvidia.com> 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 <martin.peres at free.fr> Cc: Lyude Paul <lyude at redhat.com> Signed-off-by: Thierry Reding <treding at nvidia.com> --- drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c index bf62303571b3..3695cde669f8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c @@ -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); -- 2.15.1
Lyude Paul
2018-Feb-07 18:00 UTC
[Nouveau] [PATCH] drm/nouveau: Make clock gate support conditional
Reviewed-by: Lyude Paul <lyude at redhat.com> On Wed, 2018-02-07 at 18:40 +0100, Thierry Reding wrote:> From: Thierry Reding <treding at nvidia.com> > > 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 <martin.peres at free.fr> > Cc: Lyude Paul <lyude at redhat.com> > Signed-off-by: Thierry Reding <treding at nvidia.com> > --- > drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c > b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c > index bf62303571b3..3695cde669f8 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c > @@ -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);-- Cheers, Lyude Paul
Seemingly Similar Threads
- [RFC v2 1/4] drm/nouveau: Add support for basic clockgating on Kepler1
- [RFC v3 0/4] Implement full clockgating for Kepler1 and 2
- [RFC v4 0/5] Implement full clockgating for Kepler1 and 2
- [RFC v2 0/4] Implement full clockgating for Kepler1 and 2
- [RFC v5 0/5] Implement full clockgating for Kepler1 and 2