lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vc1KV3i6Jp-t=cD5DjYDMPHA0Zz77RkN0kmrvb1WLj6gA@mail.gmail.com>
Date:   Mon, 2 Apr 2018 23:22:50 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Alexander Kappner <agk@...king.net>
Cc:     Henrique de Moraes Holschuh <ibm-acpi@....eng.br>,
        Darren Hart <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        ibm-acpi-devel@...ts.sourceforge.net,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Add Second Fan Support for Thinkpad P50

On Mon, Apr 2, 2018 at 9:27 PM, Alexander Kappner <agk@...king.net> wrote:
> The Thinkpad P50 has 2 fans. Add the 2FAN quirk so the tpacpi driver
> properly reports both fan speeds.
> Because the P50 doesn't report the version of its EC controller, we need to
> identify it by BIOS version (N1).
>
> Signed-off-by: Alexander Kappner <agk@...king.net>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index d5eaf3b1..ebdc300 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -8699,16 +8699,24 @@ static const struct attribute_group fan_attr_group = {
>           .ec = TPID(__id1, __id2),             \
>           .quirks = __quirks }
>
> +#define TPACPI_FAN_QL_BIOS(__id1, __id2, __quirks)     \

I would rather name it ..._QB() instead

Better of course to use three letters, though let's leave this when we
really have a need.

> +       { .vendor = PCI_VENDOR_ID_LENOVO,       \
> +         .bios = TPID(__id1, __id2),           \
> +         .ec = TPACPI_MATCH_ANY,               \
> +         .quirks = __quirks }
> +
>  static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
>         TPACPI_FAN_QI('1', 'Y', TPACPI_FAN_Q1),
>         TPACPI_FAN_QI('7', '8', TPACPI_FAN_Q1),
>         TPACPI_FAN_QI('7', '6', TPACPI_FAN_Q1),
>         TPACPI_FAN_QI('7', '0', TPACPI_FAN_Q1),
>         TPACPI_FAN_QL('7', 'M', TPACPI_FAN_2FAN),
> +       TPACPI_FAN_QL_BIOS('N', '1', TPACPI_FAN_2FAN) // Thinkpad P50 has 2 fans
>  };
>
>  #undef TPACPI_FAN_QL
>  #undef TPACPI_FAN_QI
> +#undef TPACPI_FAN_QL_BIOS
>
>  static int __init fan_init(struct ibm_init_struct *iibm)
>  {
> --
> 2.1.4
>



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ