All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Limonciello, Mario" <mario.limonciello@amd.com>
To: Mark Pearson <markpearson@lenovo.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>,
	"open list:X86 PLATFORM DRIVERS" 
	<platform-driver-x86@vger.kernel.org>
Subject: Re: [External] [PATCH] platform/x86: think-lmi: Fix issues with duplicate attributes
Date: Tue, 22 Jun 2021 14:58:38 -0500	[thread overview]
Message-ID: <5ccd181e-dcc0-2e80-51c2-11709f60e999@amd.com> (raw)
In-Reply-To: <97b375ca-6801-2872-33dd-5591cace578d@lenovo.com>

On 6/22/2021 14:55, Mark Pearson wrote:
> 
> On 2021-06-22 1:55 p.m., Mario Limonciello wrote:
>> On an AMD based Lenovo T14, I find that the module doesn't work at
>> all, and instead has a traceback with messages like:
>>
>> ```
>> sysfs: cannot create duplicate filename '/devices/virtual/firmware-attributes/thinklmi/attributes/Reserved'
>> ```
>>
>> Check for duplicates before adding any attributes.
>>
>> Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   drivers/platform/x86/think-lmi.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
>> index d2644230b91f..b029d4a5bc3c 100644
>> --- a/drivers/platform/x86/think-lmi.c
>> +++ b/drivers/platform/x86/think-lmi.c
>> @@ -691,6 +691,13 @@ static int tlmi_sysfs_init(void)
>>   		if (!tlmi_priv.setting[i])
>>   			continue;
>>   
>> +		/* check for duplicate */
>> +		if (kset_find_obj(tlmi_priv.attribute_kset, tlmi_priv.setting[i]->display_name)) {
>> +			pr_debug("duplicate attribute name found - %s\n",
>> +				tlmi_priv.setting[i]->display_name);
>> +			continue;
>> +		}
>> +
>>   		/* Build attribute */
>>   		tlmi_priv.setting[i]->kobj.kset = tlmi_priv.attribute_kset;
>>   		ret = kobject_init_and_add(&tlmi_priv.setting[i]->kobj, &tlmi_attr_setting_ktype,
>>
> Thanks Mario - I don't think I'd tested it on the T14 AMD yet.
> 
> Change looks good to me
> Mark
> 

In further testing this is causing problems on unload (or there was 
already another problem). So Hans please hold off, I'll work out what's 
happening and send a follow up v2.

Mark - something I'm wondering though what does "Reserved" even mean? 
Should that really be exported?  Or should it be part of a dis-allow list?



  reply	other threads:[~2021-06-22 19:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 17:55 [PATCH] platform/x86: think-lmi: Fix issues with duplicate attributes Mario Limonciello
2021-06-22 19:55 ` [External] " Mark Pearson
2021-06-22 19:58   ` Limonciello, Mario [this message]
2021-06-22 20:04     ` Mark Pearson

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=5ccd181e-dcc0-2e80-51c2-11709f60e999@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=markpearson@lenovo.com \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.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.