From: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 2/2] gr/gf100: do not assume a PMU is present
Date: Thu, 3 Sep 2015 15:32:35 +0900 [thread overview]
Message-ID: <1441261955-3577-3-git-send-email-acourbot@nvidia.com> (raw)
In-Reply-To: <1441261955-3577-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Some devices may not have a PMU. Avoid a NULL pointer dereference in
such cases.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drm/nouveau/nvkm/engine/gr/gf100.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/gr/gf100.c b/drm/nouveau/nvkm/engine/gr/gf100.c
index f1358a564e3e..f252fa2d7cf9 100644
--- a/drm/nouveau/nvkm/engine/gr/gf100.c
+++ b/drm/nouveau/nvkm/engine/gr/gf100.c
@@ -1499,7 +1499,8 @@ gf100_gr_oneinit(struct nvkm_gr *base)
struct nvkm_device *device = gr->base.engine.subdev.device;
int ret, i, j;
- nvkm_pmu_pgob(device->pmu, false);
+ if (device->pmu)
+ nvkm_pmu_pgob(device->pmu, false);
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, 0x1000, 256, false,
&gr->unk4188b4);
--
2.5.1
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2015-09-03 6:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-03 6:32 [PATCH 0/2] two trivial PMU fixes Alexandre Courbot
[not found] ` <1441261955-3577-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-09-03 6:32 ` [PATCH 1/2] pmu/gk20a: add dummy func Alexandre Courbot
[not found] ` <1441261955-3577-2-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-09-03 7:07 ` Ben Skeggs
[not found] ` <CACAvsv76bsij+UsXAe7-icM9NU9O9zBrjpT6h7e5E-8t847-Yg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-03 7:09 ` Alexandre Courbot
2015-09-03 6:32 ` Alexandre Courbot [this message]
[not found] ` <1441261955-3577-3-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-09-03 7:08 ` [PATCH 2/2] gr/gf100: do not assume a PMU is present Ben Skeggs
[not found] ` <CACAvsv4GYEy--Byi5zOphW1V2BLyJnfHMAnmXDkGPqks=63w7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-03 7:11 ` Alexandre Courbot
[not found] ` <CAAVeFu+y6XkTKNx+W+kxc_oe0XhFC-9FODck5fKTa=2GzOZuKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-03 7:16 ` Ben Skeggs
[not found] ` <CACAvsv70qg2ScfAhHAq-dcsXFoS+N_1JzMKP5Os5Br8gf3NWSg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-03 7:18 ` Alexandre Courbot
[not found] ` <CAAVeFuJZ3beF-9bY2L8Knd-qv6fCMHeA5A_8wCbJ29myEmiMJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-03 7:21 ` Ben Skeggs
2015-09-03 6:34 ` [PATCH 0/2] two trivial PMU fixes Alexandre Courbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441261955-3577-3-git-send-email-acourbot@nvidia.com \
--to=acourbot-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.