Re: [PATCH resend 2/3] gpiolib: acpi: Rename honor_wakeup option to ignore_wake, add extra quirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 25, 2020 at 11:27:52AM +0100, Hans de Goede wrote:
> Commit aa23ca3d98f7 ("gpiolib: acpi: Add honor_wakeup module-option +
> quirk mechanism") was added to deal with spurious wakeups on one specific
> model of the HP x2 10 series. In the mean time I have learned that there
> are at least 3 variants of the HP x2 10 models:
> 
> Bay Trail SoC + AXP288 PMIC
> Cherry Trail SoC + AXP288 PMIC
> Cherry Trail SoC + TI PMIC
> 
> It turns out that the need to ignore wakeup on *all* ACPI GPIO event
> handlers is unique to the Cherry Trail SoC + TI PMIC variant for which
> the first quirk was added.
> 
> The 2 variants with the AXP288 PMIC only need to have wakeup disabled on
> the embedded-controller event handler. We want to e.g. keep wakeup on the
> event handler connected to the GPIO for the lid open/closed sensor.
> 
> Since the honor_wakeup option was added to be able to ignore wake events,
> the name was perhaps not the best, this commit renames it to ignore_wake,
> this version of the option has te following possible values:
> 
> values >= 0: a pin number on which to ignore wakeups, the ACPI wake flag
> will still be honored on all other pins
> value -1: auto: check for DMI quirk, otherwise honor the flag on all pins
> value -2: all:  ignore the flag on all pins
> value -3: none: honor wakeups on all pins
> 
> Note that it is possible for an ACPI table to request events on the same
> pin-number on multiple GPIO controllers, in that case if such a pin-number
> is used as ignore_wake value then wakeups will be ignored for that pin on
> all GPIO controllers.
> 
> The existing quirk for the Cherry Trail + TI PMIC models is changed to
> IGNORE_WAKE_ALL, keeping the current behavior; and a new quirk is added
> for the Bay Trail + AXP288 model, ignoring wakeups on the EC GPIO pin only.

In general I'm fine with this, but looking to the history of your changes I'm
afraid that in future it will require more than one pin to be listed or
something like this.

...

> +static int ignore_wake = IGNORE_WAKE_AUTO;
> +module_param(ignore_wake, int, 0444);
> +MODULE_PARM_DESC(ignore_wake,
> +	"Ignore ACPI wake flag: x=ignore-for-pin-x, -1=auto, -2=all, -3=none");

Perhaps we may take list of pins or a bitmap (see bitmap list parsers API).

...

> -static int honor_wakeup = -1;
> -module_param(honor_wakeup, int, 0444);
> -MODULE_PARM_DESC(honor_wakeup,
> -		 "Honor the ACPI wake-capable flag: 0=no, 1=yes, -1=auto");

Isn't it now a part of ABI? I don't think we may remove it, though we may ignore it.
Or do something else.

(One of the reasons why I hate module parameters)

> +			ignore_wake = (s16)(quirks & QUIRK_IGNORE_WAKE_MASK);

It's casted to signed because ..?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux