All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wang <kevwa-5C7GfCeVMHo@public.gmane.org>
To: "Quan, Evan" <Evan.Quan-5C7GfCeVMHo@public.gmane.org>,
	"Wang, Kevin(Yang)" <Kevin1.Wang-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 2/4] drm/amd/powerplay: expose supported clock domains only through sysfs
Date: Fri, 16 Aug 2019 08:24:34 +0000	[thread overview]
Message-ID: <cf5092ae-0e0b-5b86-871a-088ea8fd543b@amd.com> (raw)
In-Reply-To: <MN2PR12MB3344559C0257D2BB3DB68832E4AF0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>


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

sure, i know, I feel this is not a good way to do code when other asics have similar problems.
we'd better add a helper function to check which sysfs interface is supported for each asic.
or move these sysfs interface to asic file to create.

anyway, we can optimize this logic later.
Reviewed-by: Kevin Wang <kevin1.wang@amd.com><mailto:kevin1.wang@amd.com>

Best Regards,
Kevin

On 8/16/19 3:52 PM, Quan, Evan wrote:
Bascially, we should not expose the sysfs interface for those features not supported by the ASIC.
As, there are some tools/tests which judges whether the feature is supported by the existence of the file.
This can fix some test failure in rocm test suit.

Regards,
Evan
From: Wang, Kevin(Yang) <Kevin1.Wang@amd.com><mailto:Kevin1.Wang@amd.com>
Sent: Friday, August 16, 2019 3:16 PM
To: Quan, Evan <Evan.Quan@amd.com><mailto:Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/4] drm/amd/powerplay: expose supported clock domains only through sysfs

I don't recommend it. What's the problem if we keep it the way it is?
maybe other asic also has same problems, if do it, the other asic should  add a condition in there too.
eg: navi10 don't support sensor of  "pp_dpm_pcie".

Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org<mailto:amd-gfx-bounces@lists.freedesktop.org>> on behalf of Evan Quan <evan.quan@amd.com<mailto:evan.quan@amd.com>>
Sent: Friday, August 16, 2019 2:08 PM
To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> <amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>>
Cc: Quan, Evan <Evan.Quan@amd.com<mailto:Evan.Quan@amd.com>>
Subject: [PATCH 2/4] drm/amd/powerplay: expose supported clock domains only through sysfs

Do not expose those unsupported clock domains through sysfs on
Arcturus.

Change-Id: I526e7bd457fdcd8c79d4581bb9b77e5cb57f5844
Signed-off-by: Evan Quan <evan.quan@amd.com<mailto:evan.quan@amd.com>>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index c5642be9b44b..7accf2c7f8cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -2879,10 +2879,12 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
                         DRM_ERROR("failed to create device file pp_dpm_socclk\n");
                         return ret;
                 }
-               ret = device_create_file(adev->dev, &dev_attr_pp_dpm_dcefclk);
-               if (ret) {
-                       DRM_ERROR("failed to create device file pp_dpm_dcefclk\n");
-                       return ret;
+               if (adev->asic_type != CHIP_ARCTURUS) {
+                       ret = device_create_file(adev->dev, &dev_attr_pp_dpm_dcefclk);
+                       if (ret) {
+                               DRM_ERROR("failed to create device file pp_dpm_dcefclk\n");
+                               return ret;
+                       }
                 }
         }
         if (adev->asic_type >= CHIP_VEGA20) {
@@ -2892,10 +2894,12 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
                         return ret;
                 }
         }
-       ret = device_create_file(adev->dev, &dev_attr_pp_dpm_pcie);
-       if (ret) {
-               DRM_ERROR("failed to create device file pp_dpm_pcie\n");
-               return ret;
+       if (adev->asic_type != CHIP_ARCTURUS) {
+               ret = device_create_file(adev->dev, &dev_attr_pp_dpm_pcie);
+               if (ret) {
+                       DRM_ERROR("failed to create device file pp_dpm_pcie\n");
+                       return ret;
+               }
         }
         ret = device_create_file(adev->dev, &dev_attr_pp_sclk_od);
         if (ret) {
@@ -2999,9 +3003,11 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev)
         device_remove_file(adev->dev, &dev_attr_pp_dpm_mclk);
         if (adev->asic_type >= CHIP_VEGA10) {
                 device_remove_file(adev->dev, &dev_attr_pp_dpm_socclk);
-               device_remove_file(adev->dev, &dev_attr_pp_dpm_dcefclk);
+               if (adev->asic_type != CHIP_ARCTURUS)
+                       device_remove_file(adev->dev, &dev_attr_pp_dpm_dcefclk);
         }
-       device_remove_file(adev->dev, &dev_attr_pp_dpm_pcie);
+       if (adev->asic_type != CHIP_ARCTURUS)
+               device_remove_file(adev->dev, &dev_attr_pp_dpm_pcie);
         if (adev->asic_type >= CHIP_VEGA20)
                 device_remove_file(adev->dev, &dev_attr_pp_dpm_fclk);
         device_remove_file(adev->dev, &dev_attr_pp_sclk_od);
--
2.22.0

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

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

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

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

  parent reply	other threads:[~2019-08-16  8:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16  6:08 [PATCH 1/4] drm/amd/powerplay: update Arcturus smc fw and driver interface header Evan Quan
     [not found] ` <20190816060807.11922-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-08-16  6:08   ` [PATCH 2/4] drm/amd/powerplay: expose supported clock domains only through sysfs Evan Quan
     [not found]     ` <MN2PR12MB329617CB0EF329673FB44F77A2AF0@MN2PR12MB3296.namprd12.prod.outlook.com>
     [not found]       ` <MN2PR12MB329617CB0EF329673FB44F77A2AF0-rweVpJHSKTqAm9ToKNQgFgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-16  7:52         ` Quan, Evan
     [not found]           ` <MN2PR12MB3344559C0257D2BB3DB68832E4AF0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-16  8:24             ` Kevin Wang [this message]
2019-08-16  6:08   ` [PATCH 3/4] drm/amd/powerplay: get bootup fclk value Evan Quan
     [not found]     ` <20190816060807.11922-3-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-08-16  7:09       ` Wang, Kevin(Yang)
     [not found]         ` <MN2PR12MB3296E1EFA5B50EBA18CE1841A2AF0-rweVpJHSKTqAm9ToKNQgFgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-16  7:59           ` Quan, Evan
     [not found]             ` <MN2PR12MB3344896B119B12D504E130C8E4AF0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-20  2:09               ` Quan, Evan
     [not found]                 ` <MN2PR12MB33443B0D70F900195F611CD5E4AB0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-20  2:34                   ` Wang, Kevin(Yang)
2019-08-16  6:08   ` [PATCH 4/4] drm/amd/powerplay: set Arcturus default fclk as bootup value on dpm disabled Evan Quan
     [not found]     ` <20190816060807.11922-4-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-08-16  7:12       ` Wang, Kevin(Yang)
2019-08-16  6:50   ` [PATCH 1/4] drm/amd/powerplay: update Arcturus smc fw and driver interface header Wang, Kevin(Yang)

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=cf5092ae-0e0b-5b86-871a-088ea8fd543b@amd.com \
    --to=kevwa-5c7gfcevmho@public.gmane.org \
    --cc=Evan.Quan-5C7GfCeVMHo@public.gmane.org \
    --cc=Kevin1.Wang-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.