All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Linghui Wu" <linghui.wu@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 2/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ
Date: Thu, 12 Nov 2026 07:35:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-210616@kernel.org> (raw)
In-Reply-To: <20261112072009.3815276-3-linghui.wu@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] power: sequencing: missing wake IRQ trigger type in
  pwrseq_qcom_wcn_probe()
- [Low] power: sequencing: qcom-wcn: direct inclusion of
  linux/pm_wakeup.h
--

commit 832aa68ed4662747e202e91c3f57f19829c22253
Author: Linghui Wu <linghui.wu@oss.qualcomm.com>

power: sequencing: qcom-wcn: support SW_CTRL wake IRQ

This commit adds support for requesting the SW_CTRL GPIO and registering it
as a dedicated wake IRQ when the WCN PMU is marked as a wakeup source.

> diff --git a/drivers/power/sequencing/pwrseq-qcom-wcn.c b/drivers/power/sequencing/pwrseq-qcom-wcn.c
> index e51b655add01c..26b436df9b93e 100644
> --- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
> +++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
> @@ -11,6 +11,8 @@
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
> +#include <linux/pm_wakeirq.h>
> +#include <linux/pm_wakeup.h>

[Severity: Low]
include/linux/pm_wakeup.h forbids direct inclusion (#error "Please do not
include this file directly.") and is already included via <linux/device.h>.

[ ... ]

> @@ -525,6 +534,33 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev)
>  		return dev_err_probe(dev, PTR_ERR(ctx->bt_gpio),
>  				     "Failed to get the Bluetooth enable GPIO\n");
>  
> +	if (device_property_read_bool(dev, "wakeup-source")) {
> +		swctrl_gpio = devm_gpiod_get(dev, "swctrl", GPIOD_IN);
> +		if (IS_ERR(swctrl_gpio))
> +			return dev_err_probe(dev, PTR_ERR(swctrl_gpio),
> +					     "Failed to get the SW_CTRL GPIO\n");
> +
> +		wake_irq = gpiod_to_irq(swctrl_gpio);
> +		if (wake_irq < 0)
> +			return dev_err_probe(dev, wake_irq,
> +					     "Failed to get the SW_CTRL wake IRQ\n");
> +
> +		ret = devm_device_init_wakeup(dev);
> +		if (ret)
> +			return dev_err_probe(dev, ret,
> +					     "Failed to enable wakeup\n");
> +
> +		ret = dev_pm_set_dedicated_wake_irq(dev, wake_irq);

[Severity: High]
Does wake_irq ever get an interrupt trigger type configured?

gpiod_to_irq() maps the GPIO line with IRQ_TYPE_NONE, and
dev_pm_set_dedicated_wake_irq() calls request_threaded_irq() with only
IRQF_ONESHOT | IRQF_NO_AUTOEN.  Because neither supplies trigger flags,
__setup_irq() skips __irq_set_trigger().  On Qualcomm TLMM GPIOs,
msm_gpio_init() initializes the IRQ with IRQ_TYPE_NONE and handle_bad_irq,
relying on .irq_set_type to program hardware trigger registers and install
the real flow handler, so SW_CTRL wake interrupts will either fail to fire
or hit handle_bad_irq() instead of waking the system.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112072009.3815276-1-linghui.wu@oss.qualcomm.com?part=2

  reply	other threads:[~2026-11-12  7:35 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 12:19 [RFC PATCH 0/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Linghui Wu
2026-10-14 12:19 ` [RFC PATCH 1/3] dt-bindings: power: sequencing: qcom-wcn: document wakeup-source Linghui Wu
2026-10-16 12:35   ` Bartosz Golaszewski
2026-10-14 12:19 ` [RFC PATCH 2/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Linghui Wu
2026-10-14 12:19 ` [RFC PATCH 3/3] arm64: dts: qcom: shikra: enable WCN SW_CTRL wakeup Linghui Wu
2026-10-14 12:28   ` Konrad Dybcio
2026-10-14 13:07 ` [RFC PATCH 0/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Konrad Dybcio
2026-10-15  4:12 ` [RFC PATCH v2 " Linghui Wu
2026-10-15  4:12   ` [RFC PATCH v2 1/3] dt-bindings: power: sequencing: qcom-wcn: document wakeup-source Linghui Wu
2026-10-16  9:14     ` Konrad Dybcio
2026-10-15  4:12   ` [RFC PATCH v2 2/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Linghui Wu
2026-10-15  4:12   ` [RFC PATCH v2 3/3] arm64: dts: qcom: shikra: enable WCN SW_CTRL wakeup Linghui Wu
2026-10-16  9:12   ` [RFC PATCH v2 0/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Konrad Dybcio
2026-10-19  9:39 ` [PATCH v3 " Linghui Wu
2026-10-19  9:39   ` [PATCH v3 1/3] dt-bindings: regulator: qcom,wcn3990-pmu: document Linghui Wu
2026-10-20  7:48     ` Krzysztof Kozlowski
2026-10-19  9:39   ` [PATCH v3 2/3] power: sequencing: qcom-wcn: support SW_CTRL wake Linghui Wu
2026-10-19  9:51     ` sashiko-bot
2026-10-19  9:39   ` [PATCH v3 3/3] arm64: dts: qcom: shikra: enable WCN SW_CTRL Linghui Wu
2026-10-19  9:51     ` sashiko-bot
2026-10-20 13:13   ` [PATCH v3 0/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Bartosz Golaszewski
2026-10-20 13:40   ` Konrad Dybcio
2026-11-12  7:20   ` [PATCH v4 " Linghui Wu
2026-11-12  7:20     ` [PATCH v4 1/3] dt-bindings: regulator: qcom,wcn3990-pmu: document wakeup-source Linghui Wu
2026-11-12 22:55       ` Rob Herring (Arm)
2026-11-12  7:20     ` [PATCH v4 2/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Linghui Wu
2026-11-12  7:35       ` sashiko-bot [this message]
2026-11-12  7:20     ` [PATCH v4 3/3] arm64: dts: qcom: shikra: enable WCN SW_CTRL wakeup Linghui Wu
2026-11-12  7:35       ` sashiko-bot
2026-11-12 10:13     ` [PATCH v4 0/3] power: sequencing: qcom-wcn: support SW_CTRL wake IRQ Bartosz Golaszewski

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=sashiko-outbox-210616@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linghui.wu@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.