linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Naveen Krishna Ch <naveenkrishna.ch@gmail.com>,
	Naveen Krishna Chatradhi <nchatrad@amd.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: amd_energy: match for supported models
Date: Mon, 6 Jul 2020 14:54:12 -0700	[thread overview]
Message-ID: <913b00cc-10ae-911c-e7a1-a660c692a298@roeck-us.net> (raw)
In-Reply-To: <CAHfPSqDfWs+LiYo7KdVKKQ6fP0hDyCHtVhwHMiG3Sn7=aHhLBQ@mail.gmail.com>

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
>>
> 
> 


  reply	other threads:[~2020-07-06 21:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-07-07  3:55   ` Guenter Roeck
2020-07-07  6:24     ` Naveen Krishna Ch
2020-07-07 14:16 ` Guenter Roeck

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=913b00cc-10ae-911c-e7a1-a660c692a298@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=naveenkrishna.ch@gmail.com \
    --cc=nchatrad@amd.com \
    /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 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).