2022-05-03 11:44:57

by kernel test robot

[permalink] [raw]
Subject: [RFC PATCH pdx86-platform-drivers-x86] platform/x86: thinkpad_acpi: quirk_btusb_bug can be static

drivers/platform/x86/thinkpad_acpi.c:317:20: warning: symbol 'quirk_btusb_bug' was not declared. Should it be static?

Fixes: 25eecc2ff6cc ("platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---
drivers/platform/x86/thinkpad_acpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index aed17d32ed84b..eefa22e86ae10 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -314,7 +314,7 @@ struct quirk_entry {
bool btusb_bug;
};

-struct quirk_entry quirk_btusb_bug = {
+static struct quirk_entry quirk_btusb_bug = {
.btusb_bug = true,
};


2022-05-03 20:40:37

by Mario Limonciello

[permalink] [raw]
Subject: RE: [RFC PATCH pdx86-platform-drivers-x86] platform/x86: thinkpad_acpi: quirk_btusb_bug can be static

[Public]



> -----Original Message-----
> From: kernel test robot <[email protected]>
> Sent: Tuesday, May 3, 2022 06:18
> To: Limonciello, Mario <[email protected]>
> Cc: [email protected]; Andy Shevchenko
> <[email protected]>; Hans de Goede
> <[email protected]>; [email protected]
> Subject: [RFC PATCH pdx86-platform-drivers-x86] platform/x86:
> thinkpad_acpi: quirk_btusb_bug can be static
>
> drivers/platform/x86/thinkpad_acpi.c:317:20: warning: symbol
> 'quirk_btusb_bug' was not declared. Should it be static?
>
> Fixes: 25eecc2ff6cc ("platform/x86: thinkpad_acpi: Convert btusb DMI list to
> quirks")
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>

Reviewed-by: Mario Limonciello <[email protected]>

> ---
> drivers/platform/x86/thinkpad_acpi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c
> b/drivers/platform/x86/thinkpad_acpi.c
> index aed17d32ed84b..eefa22e86ae10 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -314,7 +314,7 @@ struct quirk_entry {
> bool btusb_bug;
> };
>
> -struct quirk_entry quirk_btusb_bug = {
> +static struct quirk_entry quirk_btusb_bug = {
> .btusb_bug = true,
> };
>

2022-05-07 18:11:09

by Hans de Goede

[permalink] [raw]
Subject: Re: [RFC PATCH pdx86-platform-drivers-x86] platform/x86: thinkpad_acpi: quirk_btusb_bug can be static

Hi,

On 5/6/22 12:09, Hans de Goede wrote:
> Hi,
>
> On 5/3/22 15:07, Limonciello, Mario wrote:
>> [Public]
>>
>>
>>
>>> -----Original Message-----
>>> From: kernel test robot <[email protected]>
>>> Sent: Tuesday, May 3, 2022 06:18
>>> To: Limonciello, Mario <[email protected]>
>>> Cc: [email protected]; Andy Shevchenko
>>> <[email protected]>; Hans de Goede
>>> <[email protected]>; [email protected]
>>> Subject: [RFC PATCH pdx86-platform-drivers-x86] platform/x86:
>>> thinkpad_acpi: quirk_btusb_bug can be static
>>>
>>> drivers/platform/x86/thinkpad_acpi.c:317:20: warning: symbol
>>> 'quirk_btusb_bug' was not declared. Should it be static?
>>>
>>> Fixes: 25eecc2ff6cc ("platform/x86: thinkpad_acpi: Convert btusb DMI list to
>>> quirks")
>>> Reported-by: kernel test robot <[email protected]>
>>> Signed-off-by: kernel test robot <[email protected]>
>>
>> Reviewed-by: Mario Limonciello <[email protected]>
>
> Thanks, since the original patch was still in my review-hans
> branch (and not yet in for-next) I've squashed this fix into
> the original patch.

I've just realized there is another issue with this
("platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks")

Patch, it only sets tp_features.quirks after bluetooth_init()
has already run, so the:

if (tp_features.quirks && tp_features.quirks->btusb_bug && ...

check will never be true since tp_features.quirks is being set
too late.

I'll squash in a change moving the:

dmi_id = dmi_first_match(fwbug_list);
if (dmi_id)
tp_features.quirks = dmi_id->driver_data;

to higher inside thinkpad_acpi_module_init() to fix this,
while keeping the:

#ifdef CONFIG_SUSPEND
if (tp_features.quirks && tp_features.quirks->s2idle_bug_mmio) {
if (!acpi_register_lps0_dev(&thinkpad_acpi_s2idle_dev_ops))
pr_info("Using s2idle quirk to avoid %s platform firmware bug\n",
(dmi_id && dmi_id->ident) ? dmi_id->ident : "");
}
#endif

block at then end of thinkpad_acpi_module_init() so as to not change
the ordering wrt registering the lps0_dev.

Regards,

Hans





>
> Regards,
>
> Hans
>
>
>
>
>
>>
>>> ---
>>> drivers/platform/x86/thinkpad_acpi.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/platform/x86/thinkpad_acpi.c
>>> b/drivers/platform/x86/thinkpad_acpi.c
>>> index aed17d32ed84b..eefa22e86ae10 100644
>>> --- a/drivers/platform/x86/thinkpad_acpi.c
>>> +++ b/drivers/platform/x86/thinkpad_acpi.c
>>> @@ -314,7 +314,7 @@ struct quirk_entry {
>>> bool btusb_bug;
>>> };
>>>
>>> -struct quirk_entry quirk_btusb_bug = {
>>> +static struct quirk_entry quirk_btusb_bug = {
>>> .btusb_bug = true,
>>> };
>>>
>>


2022-05-09 05:58:51

by Hans de Goede

[permalink] [raw]
Subject: Re: [RFC PATCH pdx86-platform-drivers-x86] platform/x86: thinkpad_acpi: quirk_btusb_bug can be static

Hi,

On 5/3/22 15:07, Limonciello, Mario wrote:
> [Public]
>
>
>
>> -----Original Message-----
>> From: kernel test robot <[email protected]>
>> Sent: Tuesday, May 3, 2022 06:18
>> To: Limonciello, Mario <[email protected]>
>> Cc: [email protected]; Andy Shevchenko
>> <[email protected]>; Hans de Goede
>> <[email protected]>; [email protected]
>> Subject: [RFC PATCH pdx86-platform-drivers-x86] platform/x86:
>> thinkpad_acpi: quirk_btusb_bug can be static
>>
>> drivers/platform/x86/thinkpad_acpi.c:317:20: warning: symbol
>> 'quirk_btusb_bug' was not declared. Should it be static?
>>
>> Fixes: 25eecc2ff6cc ("platform/x86: thinkpad_acpi: Convert btusb DMI list to
>> quirks")
>> Reported-by: kernel test robot <[email protected]>
>> Signed-off-by: kernel test robot <[email protected]>
>
> Reviewed-by: Mario Limonciello <[email protected]>

Thanks, since the original patch was still in my review-hans
branch (and not yet in for-next) I've squashed this fix into
the original patch.

Regards,

Hans





>
>> ---
>> drivers/platform/x86/thinkpad_acpi.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/platform/x86/thinkpad_acpi.c
>> b/drivers/platform/x86/thinkpad_acpi.c
>> index aed17d32ed84b..eefa22e86ae10 100644
>> --- a/drivers/platform/x86/thinkpad_acpi.c
>> +++ b/drivers/platform/x86/thinkpad_acpi.c
>> @@ -314,7 +314,7 @@ struct quirk_entry {
>> bool btusb_bug;
>> };
>>
>> -struct quirk_entry quirk_btusb_bug = {
>> +static struct quirk_entry quirk_btusb_bug = {
>> .btusb_bug = true,
>> };
>>
>