[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYzbAIloJ9k28thL@google.com>
Date: Thu, 28 Dec 2023 10:18:40 +0800
From: Tzung-Bi Shih <tzungbi@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Mark Hasemeyer <markhas@...omium.org>,
LKML <linux-kernel@...r.kernel.org>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Rob Herring <robh@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Sudeep Holla <sudeep.holla@....com>,
Raul Rangel <rrangel@...omium.org>,
Benson Leung <bleung@...omium.org>,
Bhanu Prakash Maiya <bhanumaiya@...omium.org>,
Chen-Yu Tsai <wenst@...omium.org>,
Guenter Roeck <groeck@...omium.org>, Lee Jones <lee@...nel.org>,
Prashant Malani <pmalani@...omium.org>,
Rob Barnes <robbarnes@...gle.com>,
Stephen Boyd <swboyd@...omium.org>, chrome-platform@...ts.linux.dev
Subject: Re: [PATCH v3 24/24] platform/chrome: cros_ec: Use PM subsystem to
manage wakeirq
On Wed, Dec 27, 2023 at 07:34:58PM +0200, Andy Shevchenko wrote:
> On Tue, Dec 26, 2023 at 12:21:28PM -0700, Mark Hasemeyer wrote:
> > - irq = platform_get_irq_optional(pdev, 0);
> > - if (irq > 0)
> > + irq = platform_get_irq_resource_optional(pdev, 0, &irqres);
> > + if (irq > 0) {
> > ec_dev->irq = irq;
> > - else if (irq != -ENXIO) {
> > + if (should_force_irq_wake_capable())
> > + ec_dev->irq_wake = true;
> > + else
> > + ec_dev->irq_wake = irqres.flags & IORESOURCE_IRQ_WAKECAPABLE;
> > + } else if (irq != -ENXIO) {
> > dev_err(dev, "couldn't retrieve IRQ number (%d)\n", irq);
> > return irq;
> > }
>
> Still I do not like ambiguity behind irq > 0 vs. irqres.start.
>
> For this, and if needed others, return plain error.
> Seems I gave the tag for the previous patch, consider
> that tag conditional (it seems I missed this).
On a related note, I was confusing a while because of the differences:
platform_get_irq_optional() and platform_get_irq_resource_optional():
Return: non-zero IRQ number on success, negative error number on failure.
acpi_dev_get_gpio_irq_resource():
Return: 0 on success, negative errno on failure.
acpi_dev_gpio_irq_get():
Return: Linux IRQ number (> %0) on success, negative errno on failure.
How about let platform_get_irq_resource_optional():
- Return 0 on success and negative errno on failure.
- The callee needs to retrieve the IRQ number from irqres.start.
?
Powered by blists - more mailing lists