summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/pmu
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2016-11-17 10:37:29 +0300
committerBen Skeggs <bskeggs@redhat.com>2017-03-07 10:05:11 +0300
commit485a20eff20a2cbc55c9061724356cae3df01781 (patch)
tree14d0e2c9053fc633bc8101a08b7bb00ff48b5d58 /drivers/gpu/drm/nouveau/nvkm/subdev/pmu
parentba735d061dcbbb061721f302f1ef519c547d5bab (diff)
downloadlinux-485a20eff20a2cbc55c9061724356cae3df01781.tar.xz
drm/nouveau/pmu: make sure the reset hook exists before running it
Some PMU implementations (in particular the ones managed by secure boot) may not have a reset() hook. Make sure we don't crash in that case. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/pmu')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
index a73f690eb4b5..ad4ac4e8b29e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
@@ -85,7 +85,8 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu)
);
/* Reset. */
- pmu->func->reset(pmu);
+ if (pmu->func->reset)
+ pmu->func->reset(pmu);
/* Wait for IMEM/DMEM scrubbing to be complete. */
nvkm_msec(device, 2000,