All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: amd_energy: match for supported models
@ 2020-07-06 17:17 Naveen Krishna Chatradhi
  2020-07-06 17:20 ` Naveen Krishna Ch
  2020-07-07 14:16 ` Guenter Roeck
  0 siblings, 2 replies; 6+ messages in thread
From: Naveen Krishna Chatradhi @ 2020-07-06 17:17 UTC (permalink / raw)
  To: linux-hwmon; +Cc: linux, naveenkrishna.ch, Naveen Krishna Chatradhi

The energy counters of certain models seems to be reporting
inconsisten values. Hence, match for the supported models.

Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
---
 drivers/hwmon/amd_energy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
index e95b7426106e..29603742c858 100644
--- a/drivers/hwmon/amd_energy.c
+++ b/drivers/hwmon/amd_energy.c
@@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = {
 static struct platform_device *amd_energy_platdev;
 
 static const struct x86_cpu_id cpu_ids[] __initconst = {
-	X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
+	X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
 	{}
 };
 MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
-- 
2.17.1


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

* Re: [PATCH] hwmon: amd_energy: match for supported models
  2020-07-06 17:17 [PATCH] hwmon: amd_energy: match for supported models Naveen Krishna Chatradhi
@ 2020-07-06 17:20 ` Naveen Krishna Ch
  2020-07-06 21:54   ` Guenter Roeck
  2020-07-07  3:55   ` Guenter Roeck
  2020-07-07 14:16 ` Guenter Roeck
  1 sibling, 2 replies; 6+ messages in thread
From: Naveen Krishna Ch @ 2020-07-06 17:20 UTC (permalink / raw)
  To: Naveen Krishna Chatradhi; +Cc: linux-hwmon, linux

Hi Guenter,

On Mon, 6 Jul 2020 at 22:47, Naveen Krishna Chatradhi <nchatrad@amd.com> wrote:
>
> The energy counters of certain models seems to be reporting
> inconsisten values. Hence, match for the supported models.
Actually, the supported models could be of family 0x17 in a range
between 0x30 ~ 0x3f. I did not find any macro or usage for a range
of models. Could you suggest to me if i've missed an existing way to
provide a range for models.

>
> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
> ---
>  drivers/hwmon/amd_energy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
> index e95b7426106e..29603742c858 100644
> --- a/drivers/hwmon/amd_energy.c
> +++ b/drivers/hwmon/amd_energy.c
> @@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = {
>  static struct platform_device *amd_energy_platdev;
>
>  static const struct x86_cpu_id cpu_ids[] __initconst = {
> -       X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
> +       X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
>         {}
>  };
>  MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
> --
> 2.17.1
>


-- 
Shine bright,
(: Nav :)

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

* Re: [PATCH] hwmon: amd_energy: match for supported models
  2020-07-06 17:20 ` Naveen Krishna Ch
@ 2020-07-06 21:54   ` Guenter Roeck
  2020-07-07  3:55   ` Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2020-07-06 21:54 UTC (permalink / raw)
  To: Naveen Krishna Ch, Naveen Krishna Chatradhi; +Cc: linux-hwmon

On 7/6/20 10:20 AM, Naveen Krishna Ch wrote:
> Hi Guenter,
> 
> On Mon, 6 Jul 2020 at 22:47, Naveen Krishna Chatradhi <nchatrad@amd.com> wrote:
>>
>> The energy counters of certain models seems to be reporting
>> inconsisten values. Hence, match for the supported models.
> Actually, the supported models could be of family 0x17 in a range
> between 0x30 ~ 0x3f. I did not find any macro or usage for a range
> of models. Could you suggest to me if i've missed an existing way to
> provide a range for models.
> 

I have no idea, sorry. Maybe match all of them, check for
actually supported models in the probe function, and return
-ENODEV if the model is not supported. Alternatively,
just list all models in the supported range.

Either case, how would you know that a future model in the presumably
supported range doesn't have a bug in the microcode that makes it
report bad data ? Assuming that this is a microcode bug, of course.

Guenter

>>
>> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
>> ---
>>  drivers/hwmon/amd_energy.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
>> index e95b7426106e..29603742c858 100644
>> --- a/drivers/hwmon/amd_energy.c
>> +++ b/drivers/hwmon/amd_energy.c
>> @@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = {
>>  static struct platform_device *amd_energy_platdev;
>>
>>  static const struct x86_cpu_id cpu_ids[] __initconst = {
>> -       X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
>> +       X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
>>         {}
>>  };
>>  MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
>> --
>> 2.17.1
>>
> 
> 


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

* Re: [PATCH] hwmon: amd_energy: match for supported models
  2020-07-06 17:20 ` Naveen Krishna Ch
  2020-07-06 21:54   ` Guenter Roeck
@ 2020-07-07  3:55   ` Guenter Roeck
  2020-07-07  6:24     ` Naveen Krishna Ch
  1 sibling, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2020-07-07  3:55 UTC (permalink / raw)
  To: Naveen Krishna Ch, Naveen Krishna Chatradhi; +Cc: linux-hwmon

On 7/6/20 10:20 AM, Naveen Krishna Ch wrote:
> Hi Guenter,
> 
> On Mon, 6 Jul 2020 at 22:47, Naveen Krishna Chatradhi <nchatrad@amd.com> wrote:
>>
>> The energy counters of certain models seems to be reporting
>> inconsisten values. Hence, match for the supported models.
> Actually, the supported models could be of family 0x17 in a range
> between 0x30 ~ 0x3f. I did not find any macro or usage for a range
> of models. Could you suggest to me if i've missed an existing way to
> provide a range for models.
> 
So, do you want me to apply the patch as-is, or are you going to send an
updated version ?

Thanks,
Guenter

>>
>> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
>> ---
>>  drivers/hwmon/amd_energy.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
>> index e95b7426106e..29603742c858 100644
>> --- a/drivers/hwmon/amd_energy.c
>> +++ b/drivers/hwmon/amd_energy.c
>> @@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = {
>>  static struct platform_device *amd_energy_platdev;
>>
>>  static const struct x86_cpu_id cpu_ids[] __initconst = {
>> -       X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
>> +       X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
>>         {}
>>  };
>>  MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
>> --
>> 2.17.1
>>
> 
> 


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

* Re: [PATCH] hwmon: amd_energy: match for supported models
  2020-07-07  3:55   ` Guenter Roeck
@ 2020-07-07  6:24     ` Naveen Krishna Ch
  0 siblings, 0 replies; 6+ messages in thread
From: Naveen Krishna Ch @ 2020-07-07  6:24 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Naveen Krishna Chatradhi, linux-hwmon

Hi Guenter

On Tue, 7 Jul 2020 at 09:25, Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 7/6/20 10:20 AM, Naveen Krishna Ch wrote:
> > Hi Guenter,
> >
> > On Mon, 6 Jul 2020 at 22:47, Naveen Krishna Chatradhi <nchatrad@amd.com> wrote:
> >>
> >> The energy counters of certain models seems to be reporting
> >> inconsisten values. Hence, match for the supported models.
> > Actually, the supported models could be of family 0x17 in a range
> > between 0x30 ~ 0x3f. I did not find any macro or usage for a range
> > of models. Could you suggest to me if i've missed an existing way to
> > provide a range for models.
> >
> So, do you want me to apply the patch as-is, or are you going to send an
> updated version ?
Please take this patch as-is, i will update the supported models when ever
i get a chance to test on them.
>
> Thanks,
> Guenter
>
> >>
> >> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
> >> ---
> >>  drivers/hwmon/amd_energy.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
> >> index e95b7426106e..29603742c858 100644
> >> --- a/drivers/hwmon/amd_energy.c
> >> +++ b/drivers/hwmon/amd_energy.c
> >> @@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = {
> >>  static struct platform_device *amd_energy_platdev;
> >>
> >>  static const struct x86_cpu_id cpu_ids[] __initconst = {
> >> -       X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
> >> +       X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
> >>         {}
> >>  };
> >>  MODULE_DEVICE_TABLE(x86cpu, cpu_ids);
> >> --
> >> 2.17.1
> >>
> >
> >
>


-- 
Shine bright,
(: Nav :)

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

* Re: [PATCH] hwmon: amd_energy: match for supported models
  2020-07-06 17:17 [PATCH] hwmon: amd_energy: match for supported models Naveen Krishna Chatradhi
  2020-07-06 17:20 ` Naveen Krishna Ch
@ 2020-07-07 14:16 ` Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2020-07-07 14:16 UTC (permalink / raw)
  To: Naveen Krishna Chatradhi; +Cc: linux-hwmon, naveenkrishna.ch

On Mon, Jul 06, 2020 at 10:47:15PM +0530, Naveen Krishna Chatradhi wrote:
> The energy counters of certain models seems to be reporting
> inconsisten values. Hence, match for the supported models.
> 
> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/amd_energy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c
> index e95b7426106e..29603742c858 100644
> --- a/drivers/hwmon/amd_energy.c
> +++ b/drivers/hwmon/amd_energy.c
> @@ -362,7 +362,7 @@ static struct platform_driver amd_energy_driver = {
>  static struct platform_device *amd_energy_platdev;
>  
>  static const struct x86_cpu_id cpu_ids[] __initconst = {
> -	X86_MATCH_VENDOR_FAM(AMD, 0x17, NULL),
> +	X86_MATCH_VENDOR_FAM_MODEL(AMD, 0x17, 0x31, NULL),
>  	{}
>  };
>  MODULE_DEVICE_TABLE(x86cpu, cpu_ids);

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

end of thread, other threads:[~2020-07-07 14:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 17:17 [PATCH] hwmon: amd_energy: match for supported models Naveen Krishna Chatradhi
2020-07-06 17:20 ` Naveen Krishna Ch
2020-07-06 21:54   ` Guenter Roeck
2020-07-07  3:55   ` Guenter Roeck
2020-07-07  6:24     ` Naveen Krishna Ch
2020-07-07 14:16 ` Guenter Roeck

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.