AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pm: enable pm sysfs write for one VF mode
@ 2022-01-24 10:01 Yiqing Yao
  2022-02-15  4:05 ` Yao, Yiqing(James)
  0 siblings, 1 reply; 2+ messages in thread
From: Yiqing Yao @ 2022-01-24 10:01 UTC (permalink / raw)
  To: amd-gfx; +Cc: jingwen.chen2, marina.nikolic, Yiqing Yao

[why]
pm sysfs should be writable in one VF mode as is in passthrough

[how]
do not remove write access on pm sysfs if device is in one VF mode

Fixes: 4436ea3c43a7 ("amdgpu/pm: Make sysfs pm attributes as read-only for VFs")
Signed-off-by: Yiqing Yao <yiqing.yao@amd.com>
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 837a31a46596..5250032a2ffb 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2006,8 +2006,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 		}
 	}
 
-	/* setting should not be allowed from VF */
-	if (amdgpu_sriov_vf(adev)) {
+	/* 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)) {
 		dev_attr->attr.mode &= ~S_IWUGO;
 		dev_attr->store = NULL;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/pm: enable pm sysfs write for one VF mode
  2022-01-24 10:01 [PATCH] drm/amd/pm: enable pm sysfs write for one VF mode Yiqing Yao
@ 2022-02-15  4:05 ` Yao, Yiqing(James)
  0 siblings, 0 replies; 2+ messages in thread
From: Yao, Yiqing(James) @ 2022-02-15  4:05 UTC (permalink / raw)
  To: Yiqing Yao, amd-gfx; +Cc: Monk.liu, marina.nikolic

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]


On 2/14/2022 10:54 AM, Liu, Monk wrote:

> [AMD Official Use Only]
>
> Reviewed-by: Monk.liu@amd.com
>
> Thanks
>
> -------------------------------------------------------------------
>
> Monk Liu | Cloud GPU & Virtualization Solution | AMD
>

On 1/24/2022 6:01 PM, Yiqing Yao wrote:
> [why]
> pm sysfs should be writable in one VF mode as is in passthrough
>
> [how]
> do not remove write access on pm sysfs if device is in one VF mode
>
> Fixes: 4436ea3c43a7 ("amdgpu/pm: Make sysfs pm attributes as read-only for VFs")
> Signed-off-by: Yiqing Yao<yiqing.yao@amd.com>
> ---
>   drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> index 837a31a46596..5250032a2ffb 100644
> --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
> @@ -2006,8 +2006,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
>   		}
>   	}
>   
> -	/* setting should not be allowed from VF */
> -	if (amdgpu_sriov_vf(adev)) {
> +	/* 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)) {
>   		dev_attr->attr.mode &= ~S_IWUGO;
>   		dev_attr->store = NULL;
>   	}

[-- Attachment #2: Type: text/html, Size: 5851 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-15  4:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-24 10:01 [PATCH] drm/amd/pm: enable pm sysfs write for one VF mode Yiqing Yao
2022-02-15  4:05 ` Yao, Yiqing(James)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox