linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Coiby Xu <coiby.xu@gmail.com>
Subject: Re: [PATCH v4 3/9] gpiolib: acpi: Take into account debounce settings
Date: Mon, 9 Nov 2020 12:53:05 +0100	[thread overview]
Message-ID: <3658b0a1-f6e4-b904-cd7d-2b173403fb8b@redhat.com> (raw)
In-Reply-To: <20201109114511.GZ4077@smile.fi.intel.com>

Hi,

On 11/9/20 12:45 PM, Andy Shevchenko wrote:
> On Sun, Nov 08, 2020 at 10:31:32AM +0100, Hans de Goede wrote:
>> On 11/7/20 4:26 PM, Andy Shevchenko wrote:
>>> On Sat, Nov 7, 2020 at 4:49 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>>> On 11/6/20 8:22 PM, Andy Shevchenko wrote:
> 
> ...
> 
>>> Thank you very much for the testing! I remember that I fixed debounce
>>> for BayTrail, but it seems I have yet to fix Cherry Trail pin control
>>> as a prerequisite to this patch.
>>>
>>> And like I said this series is definitely not for backporting.
>>
>> Independent of fixing the CherryTrail pinctrl driver to support this,
>> I strongly believe that -ENOTSUPP should be ignored (treated as success)
>> by this patch. Remember ACPI is not only used on x86 but also on ARM
>> now a days. We simply cannot guarantee that all pinctrls will support
>> (let alone implement) debounce settings. E.g. I'm pretty sure that
>> the pinctrl on the popular Allwinner A64 does not support debouncing
>> and there are builts using a combination of uboot + EDK2 to boot!
>>
>> The documentation for gpiod_set_debounce even explicitly mentioned that
>> -ENOTSUPP is an error which one may expect (and thus treat specially).
>>
>> The same goes for the bias stuff too.
> 
> While for debounce I absolutely agree with you I don't think it applies to
> bias. ACPI table is coupled with a platform and setting bias == !PullNone
> implies that bias is supported.

What about PullDefault ? I can easily see DSDT writers using PullDefault
on platforms where bias setting is not supported.

> If we break something with this it means:
> - ACPI table is broken and we need a quirk

Broken ACPI tables are as common as rain in the Netherlands, where ever
possible we want to deal with these / workaround the brokenness
without requiring per device quirks. Requiring a per device quirk for
every broken ACPI table out there does not scale.

> - GPIO library is broken on architectural level and needs not to return
>   ENOTSUPP for the flags configuration.

Usually we handle features not being implemented gracefully. E.g chances
are good that whatever bias is required was already setup by the firmware
(or bootloader in the uboot + EDK2 case). Making bias set failures a
critical error will likely regress working platforms in various cases.

Keep in mind we have an existing userbase where things is working fine
without taking the bias settings into account now. So if we hit the
-ENOTSUPP case on any platform out there, then that is a regression
plain and simple and as you know regressions are a big red flag.

Since it is really easy to avoid the regression here we really
should avoid it IMHO. What about just printing a warning on ENOTSUPP
when setting the bias instead ?

Regards,

Hans


  reply	other threads:[~2020-11-09 11:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 19:22 [PATCH v4 0/9] gpiolib: acpi: pin configuration fixes Andy Shevchenko
2020-11-06 19:22 ` [PATCH v4 1/9] gpiolib: acpi: Respect bias settings for GpioInt() resource Andy Shevchenko
2020-11-06 19:22 ` [PATCH v4 2/9] gpiolib: acpi: Use named item for enum gpiod_flags variable Andy Shevchenko
2020-11-06 19:22 ` [PATCH v4 3/9] gpiolib: acpi: Take into account debounce settings Andy Shevchenko
2020-11-07 14:44   ` Hans de Goede
2020-11-07 15:26     ` Andy Shevchenko
2020-11-08  9:31       ` Hans de Goede
2020-11-08  9:31       ` Hans de Goede
2020-11-09 11:45         ` Andy Shevchenko
2020-11-09 11:53           ` Hans de Goede [this message]
2020-11-09 15:43             ` Andy Shevchenko
2020-11-06 19:22 ` [PATCH v4 4/9] gpiolib: acpi: Move acpi_gpio_to_gpiod_flags() upper in the code Andy Shevchenko
2020-11-06 19:23 ` [PATCH v4 5/9] gpiolib: acpi: Make acpi_gpio_to_gpiod_flags() usable for GpioInt() Andy Shevchenko
2020-11-06 19:23 ` [PATCH v4 6/9] gpiolib: acpi: Extract acpi_request_own_gpiod() helper Andy Shevchenko
2020-11-06 19:23 ` [PATCH v4 7/9] gpiolib: acpi: Convert pin_index to be u16 Andy Shevchenko
2020-11-06 19:23 ` [PATCH v4 8/9] gpiolib: acpi: Use BIT() macro to increase readability Andy Shevchenko
2020-11-06 19:23 ` [PATCH v4 9/9] gpiolib: acpi: Make Intel GPIO tree official for GPIO ACPI work Andy Shevchenko

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=3658b0a1-f6e4-b904-cd7d-2b173403fb8b@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=coiby.xu@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /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).