amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU
@ 2020-05-21 21:38 Alex Deucher
  2020-05-22  5:35 ` Quan, Evan
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2020-05-21 21:38 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

Reset the SUPPORTED attribute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---

This fixes multi-GPU, but I think we could still race without some sort
of locking around the attr array.

 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index e06fef6174e5..4c65444e9ef7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1790,6 +1790,8 @@ static int amdgpu_device_attr_create(struct amdgpu_device *adev,
 
 	BUG_ON(!attr);
 
+	attr->states = ATTR_STATE_SUPPORTED;
+
 	attr_update = attr->attr_update ? attr_update : default_attr_update;
 
 	ret = attr_update(adev, attr, mask);
-- 
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU
  2020-05-21 21:38 [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU Alex Deucher
@ 2020-05-22  5:35 ` Quan, Evan
  2020-05-22  5:53   ` Wang, Kevin(Yang)
  0 siblings, 1 reply; 3+ messages in thread
From: Quan, Evan @ 2020-05-22  5:35 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx; +Cc: Deucher, Alexander

[AMD Official Use Only - Internal Distribution Only]

Acked-by: Evan Quan <evan.quan@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Friday, May 22, 2020 5:38 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU

Reset the SUPPORTED attribute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---

This fixes multi-GPU, but I think we could still race without some sort of locking around the attr array.

 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index e06fef6174e5..4c65444e9ef7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1790,6 +1790,8 @@ static int amdgpu_device_attr_create(struct amdgpu_device *adev,

 BUG_ON(!attr);

+attr->states = ATTR_STATE_SUPPORTED;
+
 attr_update = attr->attr_update ? attr_update : default_attr_update;

 ret = attr_update(adev, attr, mask);
--
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C4f723e2ec23445c7cb1b08d7fdcf4618%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637256939010091750&amp;sdata=pZgnlqdAqOFNIX%2FfDKUiB1J%2FoOIFz72E3pEaTgpTg2I%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU
  2020-05-22  5:35 ` Quan, Evan
@ 2020-05-22  5:53   ` Wang, Kevin(Yang)
  0 siblings, 0 replies; 3+ messages in thread
From: Wang, Kevin(Yang) @ 2020-05-22  5:53 UTC (permalink / raw)
  To: Quan, Evan, Alex Deucher, amd-gfx; +Cc: Deucher, Alexander


[-- Attachment #1.1: Type: text/plain, Size: 3088 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Hi Alex,

the flag of "ATTR_STATE_[UN]SUPPORTED" should be binding to device not device attribute node,
when inserting two different video cards, the driver may be need to create different node according device type (vega, navi,...),
and when unload driver, the driver also need remove different node according device type and the state of ATTR_STATE_SUPPORTED.
so i think the ATTR_STATE_XXX is not work well on multi gpu, so we'd better revert previous patch.
thanks.

Best Regards,
Kevin

________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Quan, Evan <Evan.Quan@amd.com>
Sent: Friday, May 22, 2020 1:35 PM
To: Alex Deucher <alexdeucher@gmail.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: RE: [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU

[AMD Official Use Only - Internal Distribution Only]

[AMD Official Use Only - Internal Distribution Only]

Acked-by: Evan Quan <evan.quan@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Friday, May 22, 2020 5:38 AM
To: amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU

Reset the SUPPORTED attribute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---

This fixes multi-GPU, but I think we could still race without some sort of locking around the attr array.

 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index e06fef6174e5..4c65444e9ef7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1790,6 +1790,8 @@ static int amdgpu_device_attr_create(struct amdgpu_device *adev,

 BUG_ON(!attr);

+attr->states = ATTR_STATE_SUPPORTED;
+
 attr_update = attr->attr_update ? attr_update : default_attr_update;

 ret = attr_update(adev, attr, mask);
--
2.25.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CKevin1.Wang%40amd.com%7Cd86afa6ac5ab49bd75d208d7fe11ed8d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637257225315854026&amp;sdata=TMiKBdpSF4wPgkLgbRBtTloPLFBHyyLXuO%2BxSgSE%2BeY%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CKevin1.Wang%40amd.com%7Cd86afa6ac5ab49bd75d208d7fe11ed8d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637257225315864023&amp;sdata=MtypjxOmgqJhKwNEMH75r3Z%2F9M3Uv7qTpOjQo1yBSVk%3D&amp;reserved=0

[-- Attachment #1.2: Type: text/html, Size: 8313 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-05-22  5:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 21:38 [PATCH] drm/amdgpu: fix sysfs power controls with multi-GPU Alex Deucher
2020-05-22  5:35 ` Quan, Evan
2020-05-22  5:53   ` Wang, Kevin(Yang)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).