]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/drm-nouveau-debugfs-fix-check-of-pm_runtime_get_sync.patch
autosel patches for 4.14
[thirdparty/kernel/stable-queue.git] / queue-4.14 / drm-nouveau-debugfs-fix-check-of-pm_runtime_get_sync.patch
1 From c0020353544144d6dd069a517b30fa76b04c9019 Mon Sep 17 00:00:00 2001
2 From: YueHaibing <yuehaibing@huawei.com>
3 Date: Thu, 28 Feb 2019 20:24:59 +0800
4 Subject: drm/nouveau/debugfs: Fix check of pm_runtime_get_sync failure
5
6 [ Upstream commit 909e9c9c428376e2a43d178ed4b0a2d5ba9cb7d3 ]
7
8 pm_runtime_get_sync returns negative on failure.
9
10 Fixes: eaeb9010bb4b ("drm/nouveau/debugfs: Wake up GPU before doing any reclocking")
11 Signed-off-by: YueHaibing <yuehaibing@huawei.com>
12 Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
13 Signed-off-by: Sasha Levin <sashal@kernel.org>
14 ---
15 drivers/gpu/drm/nouveau/nouveau_debugfs.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
19 index 9109b69cd052..9635704a1d86 100644
20 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
21 +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
22 @@ -161,7 +161,7 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf,
23 }
24
25 ret = pm_runtime_get_sync(drm->dev);
26 - if (IS_ERR_VALUE(ret) && ret != -EACCES)
27 + if (ret < 0 && ret != -EACCES)
28 return ret;
29 ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args));
30 pm_runtime_put_autosuspend(drm->dev);
31 --
32 2.19.1
33