From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
dri-devel@lists.freedesktop.org, Ben Skeggs <bskeggs@redhat.com>,
Dinghao Liu <dinghao.liu@zju.edu.cn>
Subject: [PATCH AUTOSEL 4.19 171/206] drm/nouveau/debugfs: fix runtime pm imbalance on error
Date: Thu, 17 Sep 2020 22:07:27 -0400 [thread overview]
Message-ID: <20200918020802.2065198-171-sashal@kernel.org> (raw)
In-Reply-To: <20200918020802.2065198-1-sashal@kernel.org>
From: Dinghao Liu <dinghao.liu@zju.edu.cn>
[ Upstream commit 00583fbe8031f69bba8b0a9a861efb75fb7131af ]
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/nouveau/nouveau_debugfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 9635704a1d864..4561a786fab07 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -161,8 +161,11 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf,
}
ret = pm_runtime_get_sync(drm->dev);
- if (ret < 0 && ret != -EACCES)
+ if (ret < 0 && ret != -EACCES) {
+ pm_runtime_put_autosuspend(drm->dev);
return ret;
+ }
+
ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args));
pm_runtime_put_autosuspend(drm->dev);
if (ret < 0)
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-09-18 2:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200918020802.2065198-1-sashal@kernel.org>
2020-09-18 2:04 ` [PATCH AUTOSEL 4.19 003/206] dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling) Sasha Levin
2020-09-18 2:04 ` [PATCH AUTOSEL 4.19 009/206] gma/gma500: fix a memory disclosure bug due to uninitialized bytes Sasha Levin
2020-09-18 2:04 ` [PATCH AUTOSEL 4.19 019/206] drm/amdgpu/powerplay: fix AVFS handling with custom powerplay table Sasha Levin
2020-09-18 2:04 ` [PATCH AUTOSEL 4.19 022/206] drm/amdgpu/powerplay/smu7: " Sasha Levin
2020-09-18 2:05 ` [PATCH AUTOSEL 4.19 076/206] drm/omap: fix possible object reference leak Sasha Levin
2020-09-18 2:06 ` [PATCH AUTOSEL 4.19 090/206] drm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic Sasha Levin
2020-09-18 2:06 ` [PATCH AUTOSEL 4.19 100/206] drm/amdgpu: increase atombios cmd timeout Sasha Levin
2020-09-18 2:06 ` [PATCH AUTOSEL 4.19 101/206] drm/amd/display: Stop if retimer is not available Sasha Levin
2020-09-18 2:06 ` [PATCH AUTOSEL 4.19 115/206] drm/msm: fix leaks if initialization fails Sasha Levin
2020-09-18 2:06 ` [PATCH AUTOSEL 4.19 116/206] drm/msm/a5xx: Always set an OPP supported hardware value Sasha Levin
2020-09-18 2:06 ` [PATCH AUTOSEL 4.19 132/206] PCI: Use ioremap(), not phys_to_virt() for platform ROM Sasha Levin
2020-09-18 2:07 ` Sasha Levin [this message]
2020-09-18 2:07 ` [PATCH AUTOSEL 4.19 172/206] drm/nouveau: fix runtime pm imbalance on error Sasha Levin
2020-09-18 2:07 ` [PATCH AUTOSEL 4.19 173/206] drm/nouveau/dispnv50: " Sasha Levin
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=20200918020802.2065198-171-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bskeggs@redhat.com \
--cc=dinghao.liu@zju.edu.cn \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox