All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Enrico Granata <egranata@google.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Gwendal Grignou <gwendal@chromium.org>,
	Dmitry Torokhov <dtor@chromium.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Brian Norris <briannorris@chromium.org>,
	Enrico Granata <egranata@chromium.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH] driver: platform: Add support for GpioInt() ACPI to platform_get_irq()
Date: Thu, 7 Feb 2019 22:18:05 +0200	[thread overview]
Message-ID: <CAHp75Ve5Q0d0PCmQ6KZdcyuLd-XFfVjYqyujjM9SSbyBG+Hrmg@mail.gmail.com> (raw)
In-Reply-To: <CAPR809vnpuh8nOjU3QMCh6YJUKmtX92+bnHSUKGiAXAp6NwCHQ@mail.gmail.com>

On Thu, Feb 7, 2019 at 9:45 PM Enrico Granata <egranata@google.com> wrote:
> On Thu, Feb 7, 2019 at 11:39 AM Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>> On Thu, Feb 7, 2019 at 9:04 PM Rafael J. Wysocki <rafael@kernel.org> wrote:

>> > > This is not currently done for the platform drivers, as platform_get_irq()
>> > > does not try to parse GpioInt() resources.
>>
>> And why is this a problem?

> In ChromeOS, we have a driver (cros_ec_lpc) which can run either on systems that directly expose the interrupt,
> or systems where the interrupt goes through a GPIO controller. On the former, firmware provides an Interrupt resource
> and platform_get_irq() finds it. On the latter, firmware provides a GpioInt resource and platform_get_irq does not
> find it. We could work around this in the driver by probing both paths, but since other subsystems seem to directly
> look for GpioInt resources, it seemed to us to make more sense to extend platform_get_irq() instead.

Looking briefly into the driver I found third scenario — no resource at all.
So, you already have a quirk for that. Now it's the question either
you go for global quirk (trying to find an IRQ via iterating over
GpioInt() resources like in this patch, but in the driver), or use DMI
table for more stricter rules.

Either way you choose, I don't see a necessity to put this to the
driver core for now since it would be the only (let's assume properly
written ACPI tables) driver needs such.

> Do you have a suggestion as to how to write ACPI tables to avoid the issue?

1. Allocate new ID and use it (perhaps not the best path).
2. Use GPE(s).

--
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2019-02-07 20:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-07 18:59 [PATCH] driver: platform: Add support for GpioInt() ACPI to platform_get_irq() egranata
2019-02-07 19:02 ` Rafael J. Wysocki
2019-02-07 19:39   ` Andy Shevchenko
2019-02-07 19:45     ` Andy Shevchenko
2019-02-07 19:55     ` Enrico Granata
     [not found]     ` <CAPR809vnpuh8nOjU3QMCh6YJUKmtX92+bnHSUKGiAXAp6NwCHQ@mail.gmail.com>
2019-02-07 20:18       ` Andy Shevchenko [this message]
2019-02-07 20:29         ` Dmitry Torokhov
2019-02-11 10:30           ` Mika Westerberg
2019-02-11 15:42             ` Hans de Goede
2019-02-11 19:01 ` [PATCH v2] driver: platform: Support parsing GpioInt 0 in platform_get_irq() egranata
2019-02-11 19:25   ` Dmitry Torokhov
2019-02-12  7:29   ` Hans de Goede
2019-02-12  9:08   ` Mika Westerberg
2019-02-12  9:18   ` Rafael J. Wysocki
2019-02-12 12:46   ` Andy Shevchenko
2019-02-20 18:05   ` Brian Norris
2019-02-21 18:58     ` Enrico Granata
2019-02-21 19:34     ` [PATCH v3] " egranata
2019-02-22  9:03       ` Rafael J. Wysocki
2019-02-22 17:06         ` Brian Norris
2019-02-24 19:34   ` [PATCH v2] " Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2019-02-07 18:50 [PATCH] driver: platform: Add support for GpioInt() ACPI to platform_get_irq() egranata
2019-02-07 18:57 ` Rafael J. Wysocki

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=CAHp75Ve5Q0d0PCmQ6KZdcyuLd-XFfVjYqyujjM9SSbyBG+Hrmg@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=briannorris@chromium.org \
    --cc=dtor@chromium.org \
    --cc=egranata@chromium.org \
    --cc=egranata@google.com \
    --cc=enric.balletbo@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gwendal@chromium.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.