From: Lin.Cao <lincao12@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: haijun.chang@amd.com,
"Christian König" <christian.koenig@amd.com>,
zhenguo.yin@amd.com, lincao12@amd.com
Subject: [PATCH] drm/amd/pm set pp_dpm_*clk as read only for SRIOV one VF mode
Date: Fri, 15 Mar 2024 14:31:58 +0800 [thread overview]
Message-ID: <20240315063158.18105-1-lincao12@amd.com> (raw)
pp_dpm_*clk should be set as read only for SRIOV one VF mode, remove
S_IWUGO flag and _store function of these debugfs in one VF mode.
Signed-off-by: Lin.Cao <lincao12@amd.com>
---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index efc631bddf4a..2883a1d873ab 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2367,7 +2367,15 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
}
/* setting should not be allowed from VF if not in one VF mode */
- if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)) {
+ if (amdgpu_sriov_vf(adev) && (!amdgpu_sriov_is_pp_one_vf(adev) ||
+ DEVICE_ATTR_IS(pp_dpm_sclk) ||
+ DEVICE_ATTR_IS(pp_dpm_mclk) ||
+ DEVICE_ATTR_IS(pp_dpm_socclk) ||
+ DEVICE_ATTR_IS(pp_dpm_fclk) ||
+ DEVICE_ATTR_IS(pp_dpm_vclk) ||
+ DEVICE_ATTR_IS(pp_dpm_vclk1) ||
+ DEVICE_ATTR_IS(pp_dpm_dclk) ||
+ DEVICE_ATTR_IS(pp_dpm_dclk1))) {
dev_attr->attr.mode &= ~S_IWUGO;
dev_attr->store = NULL;
}
--
2.25.1
next reply other threads:[~2024-03-15 6:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 6:31 Lin.Cao [this message]
2024-03-19 7:09 ` [PATCH] drm/amd/pm set pp_dpm_*clk as read only for SRIOV one VF mode JingWen Chen
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=20240315063158.18105-1-lincao12@amd.com \
--to=lincao12@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=haijun.chang@amd.com \
--cc=zhenguo.yin@amd.com \
/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