linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Shawn Guo <shawn.guo@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] gpiolib: acpi: support override broken GPIO number in ACPI table
Date: Thu, 4 Mar 2021 20:32:14 +0100	[thread overview]
Message-ID: <2ed0d4dc-2756-9a55-3f54-1377732e35fc@redhat.com> (raw)
In-Reply-To: <YD9bQXBD+9k3Lf/4@smile.fi.intel.com>

Hi,

On 3/3/21 10:47 AM, Andy Shevchenko wrote:
> On Fri, Feb 26, 2021 at 11:39:19AM +0800, Shawn Guo wrote:
>> Running kernel with ACPI on Lenovo Flex 5G laptop, touchpad is just
>> not working.  That's because the GpioInt number of TSC2 node in ACPI
>> table is simply wrong, and the number even exceeds the maximum GPIO
>> lines.  As the touchpad works fine with Windows on the same machine,
>> presumably this is something Windows-ism.  Although it's obviously
>> a specification violation, believe of that Microsoft will fix this in
>> the near future is not really realistic.
>>
>> It adds the support of overriding broken GPIO number in ACPI table
>> on particular machines, which are matched using DMI info.  Such
>> mechanism for fixing up broken firmware and ACPI table is not uncommon
>> in kernel.  And hopefully it can be useful for other machines that get
>> broken GPIO number coded in ACPI table.
> 
> 
> +Cc: Hans.
> 
> Hans, would appreciate your opinion on this thread. Maybe I'm mistaken in my
> conclusions.

So I've read the entire thread here:
https://lore.kernel.org/linux-gpio/20210226033919.8871-1-shawn.guo@linaro.org/T/#u

And I agree wih Andy, this is not something which should be fixed up in the
generic gpiolib-acpi code.

Note that we have similar things going on on x86 platforms. There are cases
there where there are e.g. holes in the GPIO ranges advertised by the Intel
pinctrl drivers. And in the beginning as i2c (and thus GpioIRQ) HID devices
started to become more common there were also several rounds of work to make
sure that the GPIO numbering (per ACPI-device / island) exported to the rest
of the kernel (and thus to gpiolib-acpi) matched with the numbering which
the ACPI tables expected (so the numbering which the Windows driver use).

It seems to me, esp. in the light that there are a lot of "crazy high" GPIO
indexes in the DSDT of the Lenovo Flex 5G, that the right thing to do here
is to fix the qualcom pinctrl/GPIO driver to number its GPIOs in the way
expected by these ACPI tables. This will break use of existing devicetrees,
so it will likely need to detect if the main firmware of the system is ACPI
or DT based and then use 2 different numbering schemes depending on the
outcome of that check.

Please also do not try ti fix this with some quirks in e.g. the i2c-hid driver,
I will definitely NACK such attempts. From what we can see now any fix clearly
should be done inside the qualcom GPIO driver.

Regards,

Hans


  reply	other threads:[~2021-03-04 19:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26  3:39 [PATCH] gpiolib: acpi: support override broken GPIO number in ACPI table Shawn Guo
2021-02-26  9:12 ` Andy Shevchenko
2021-02-26  9:39   ` Shawn Guo
2021-02-26 10:57     ` Andy Shevchenko
2021-02-26 11:19       ` Andy Shevchenko
2021-02-27  3:19         ` Shawn Guo
2021-03-01 12:17           ` Andy Shevchenko
2021-03-02  0:27             ` Shawn Guo
2021-03-02 12:21               ` Andy Shevchenko
2021-03-03  5:02                 ` Jeffrey Hugo
2021-03-03  8:06                   ` Andy Shevchenko
2021-03-03  8:45                     ` Shawn Guo
2021-03-03  9:42                       ` Andy Shevchenko
2021-03-03 17:08                     ` Jeffrey Hugo
2021-03-03  9:43                   ` Shawn Guo
2021-03-03 15:10                     ` Jeffrey Hugo
2021-03-03 15:57                       ` Bjorn Andersson
2021-03-03 17:32                         ` Andy Shevchenko
2021-03-04  6:37                         ` Shawn Guo
2021-03-04  6:59                           ` Shawn Guo
2021-02-27  3:46       ` Shawn Guo
2021-03-01 12:19         ` Andy Shevchenko
2021-03-02  0:44           ` Shawn Guo
2021-03-02 10:36             ` Andy Shevchenko
2021-03-03  9:47 ` Andy Shevchenko
2021-03-04 19:32   ` Hans de Goede [this message]
2021-03-04 20:16     ` Andy Shevchenko
2021-03-05  1:14     ` Shawn Guo
2021-03-05  9:10       ` Hans de Goede
2021-03-05 10:08         ` Andy Shevchenko
2021-03-05 10:10           ` Andy Shevchenko
2021-03-05 11:26         ` Shawn Guo
2021-03-05 12:12           ` Hans de Goede

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=2ed0d4dc-2756-9a55-3f54-1377732e35fc@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=shawn.guo@linaro.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 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).