All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/amdgpu: hide voltage and power sensors on SI and KV parts
@ 2019-08-28  8:27 Jean Delvare
  2019-08-28 20:22 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2019-08-28  8:27 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Alex Deucher, David (ChunMing) Zhou, Christian König,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

The driver does not support these sensors yet and there is no point in
creating sysfs attributes which will always return an error.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
---
This works for me however I couldn't seen any other place in the driver
where adev->family is tested directly like that, so I'm not sure if
this is the right way to perform the test?

 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- linux-5.2.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c	2019-08-28 09:38:11.245376539 +0200
+++ linux-5.2/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c	2019-08-28 09:58:59.896314948 +0200
@@ -2150,7 +2150,9 @@ static umode_t hwmon_attributes_visible(
 			effective_mode &= ~S_IWUSR;
 	}
 
-	if ((adev->flags & AMD_IS_APU) &&
+	if (((adev->flags & AMD_IS_APU) ||
+	     adev->family == AMDGPU_FAMILY_SI ||	/* not implemented yet */
+	     adev->family == AMDGPU_FAMILY_KV) &&	/* not implemented yet */
 	    (attr == &sensor_dev_attr_power1_average.dev_attr.attr ||
 	     attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
 	     attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr||
@@ -2174,6 +2176,12 @@ static umode_t hwmon_attributes_visible(
 			return 0;
 	}
 
+	if ((adev->family == AMDGPU_FAMILY_SI ||	/* not implemented yet */
+	     adev->family == AMDGPU_FAMILY_KV) &&	/* not implemented yet */
+	    (attr == &sensor_dev_attr_in0_input.dev_attr.attr ||
+	     attr == &sensor_dev_attr_in0_label.dev_attr.attr))
+		return 0;
+
 	/* only APUs have vddnb */
 	if (!(adev->flags & AMD_IS_APU) &&
 	    (attr == &sensor_dev_attr_in1_input.dev_attr.attr ||


-- 
Jean Delvare
SUSE L3 Support
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/amdgpu: hide voltage and power sensors on SI and KV parts
  2019-08-28  8:27 [PATCH] drm/amd/amdgpu: hide voltage and power sensors on SI and KV parts Jean Delvare
@ 2019-08-28 20:22 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2019-08-28 20:22 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Alex Deucher, David (ChunMing) Zhou,
	Maling list - DRI developers, Christian König, amd-gfx list

On Wed, Aug 28, 2019 at 4:32 AM Jean Delvare <jdelvare@suse.de> wrote:
>
> The driver does not support these sensors yet and there is no point in
> creating sysfs attributes which will always return an error.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
> ---
> This works for me however I couldn't seen any other place in the driver
> where adev->family is tested directly like that, so I'm not sure if
> this is the right way to perform the test?

That's fine.  Applied.  Thanks!

Alex

>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> --- linux-5.2.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c       2019-08-28 09:38:11.245376539 +0200
> +++ linux-5.2/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c    2019-08-28 09:58:59.896314948 +0200
> @@ -2150,7 +2150,9 @@ static umode_t hwmon_attributes_visible(
>                         effective_mode &= ~S_IWUSR;
>         }
>
> -       if ((adev->flags & AMD_IS_APU) &&
> +       if (((adev->flags & AMD_IS_APU) ||
> +            adev->family == AMDGPU_FAMILY_SI ||        /* not implemented yet */
> +            adev->family == AMDGPU_FAMILY_KV) &&       /* not implemented yet */
>             (attr == &sensor_dev_attr_power1_average.dev_attr.attr ||
>              attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
>              attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr||
> @@ -2174,6 +2176,12 @@ static umode_t hwmon_attributes_visible(
>                         return 0;
>         }
>
> +       if ((adev->family == AMDGPU_FAMILY_SI ||        /* not implemented yet */
> +            adev->family == AMDGPU_FAMILY_KV) &&       /* not implemented yet */
> +           (attr == &sensor_dev_attr_in0_input.dev_attr.attr ||
> +            attr == &sensor_dev_attr_in0_label.dev_attr.attr))
> +               return 0;
> +
>         /* only APUs have vddnb */
>         if (!(adev->flags & AMD_IS_APU) &&
>             (attr == &sensor_dev_attr_in1_input.dev_attr.attr ||
>
>
> --
> Jean Delvare
> SUSE L3 Support
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-08-28 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28  8:27 [PATCH] drm/amd/amdgpu: hide voltage and power sensors on SI and KV parts Jean Delvare
2019-08-28 20:22 ` Alex Deucher

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.