Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Manaf Meethalavalappu Pallikunhi" <manaf.pallikunhi@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org,
	linux-hwmon@vger.kernel.org, mfd@lists.linux.dev, lee@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v4 06/12] arm64: dts: qcom: pm7550ba-eliza: Enable BCL sensor node
Date: Mon, 05 Oct 2026 12:40:53 +0000	[thread overview]
Message-ID: <20261005124054.3B7F71F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261005-qcom-bcl-hwmon-v4-6-50b9a8c730b7@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] hwmon: qcom-bcl: leaked IRQ wake depth due to cleanup race on unbind
--

commit 5ea386ff99b613c8ed6f6b198a306fbc43b08172
Author: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@oss.qualcomm.com>

arm64: dts: qcom: pm7550ba-eliza: Enable BCL sensor node
    
This commit adds the Battery Current Limiting (BCL) hardware monitor node
for pm7550ba-eliza. The BCL node monitors battery voltage and current,
providing hardware interrupts when configurable thresholds are violated.

> diff --git a/arch/arm64/boot/dts/qcom/pm7550ba-eliza.dtsi b/arch/arm64/boot/dts/qcom/pm7550ba-eliza.dtsi
> index 18692893ca418..f0c252a386ee8 100644
> --- a/arch/arm64/boot/dts/qcom/pm7550ba-eliza.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm7550ba-eliza.dtsi
> @@ -50,6 +50,17 @@ pm7550ba_temp_alarm: temp-alarm@a00 {
>  			#thermal-sensor-cells = <0>;
>  		};
>  
> +		sensor@4700 {
> +			compatible = "qcom,pm7550ba-bcl";

[Severity: High]
Does enabling this sensor node expose an unbind race in the driver?

In drivers/hwmon/qcom-bcl-hwmon.c:bcl_alarm_irq_init(), the cleanup actions
are registered:

	ret = devm_add_action_or_reset(&pdev->dev, bcl_alarm_work_cleanup_action,
				       alarm);
	if (ret)
		return ret;

	if (!enable_irq_wake(irq_num))
		alarm->irq_wake_enabled = true;

	ret = devm_add_action_or_reset(&pdev->dev, bcl_alarm_wake_cleanup_action,
				       alarm);

If the driver is unbound before an active alarm clears, due to devm LIFO
ordering, bcl_alarm_wake_cleanup_action() executes first. If the IRQ handler
disabled the IRQ wake source and scheduled the poll work,
alarm->irq_wake_enabled is false, so the wake cleanup does nothing.

If the scheduled alarm_poll_work() executes next and sees the alarm cleared,
it successfully re-enables the IRQ wake source and sets
irq_wake_enabled = true.

Then bcl_alarm_work_cleanup_action() executes, cancelling the work but
failing to disable the newly re-enabled IRQ wake source. This leaves the
IRQ wake depth permanently unbalanced, preventing the system from entering
system suspend or deep idle states.

Could the actions be registered in a safe order, perhaps by registering the
wake cleanup first so it runs last, or by combining them into a single
ordered teardown action?

> +			reg = <0x4700>;
> +			interrupts = <0x7 0x47 0x0 IRQ_TYPE_EDGE_RISING>,
> +				     <0x7 0x47 0x1 IRQ_TYPE_EDGE_RISING>,
> +				     <0x7 0x47 0x2 IRQ_TYPE_EDGE_RISING>;
> +			interrupt-names = "max-min",
> +					  "critical",
> +					  "emergency";
> +		};

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261005-qcom-bcl-hwmon-v4-0-50b9a8c730b7@oss.qualcomm.com?part=6

  reply	other threads:[~2026-10-05 12:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 12:24 [PATCH v4 00/12] hwmon: Add Qualcomm SPMI BCL driver Manaf Meethalavalappu Pallikunhi
2026-10-05 12:24 ` [PATCH v4 01/12] dt-bindings: hwmon: Describe Qualcomm BCL hardware Manaf Meethalavalappu Pallikunhi
2026-10-05 12:32   ` sashiko-bot
2026-10-07 20:42   ` Rob Herring (Arm)
2026-10-05 12:24 ` [PATCH v4 02/12] hwmon: Add Qualcomm PMIC BCL driver Manaf Meethalavalappu Pallikunhi
2026-10-05 12:40   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 03/12] arm64: dts: qcom: hamoa-pmic: Enable BCL sensor node Manaf Meethalavalappu Pallikunhi
2026-10-05 12:31   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 04/12] arm64: dts: qcom: pm7250b: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:33   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 05/12] arm64: dts: qcom: pm7550-eliza: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:38   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 06/12] arm64: dts: qcom: pm7550ba-eliza: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:40   ` sashiko-bot [this message]
2026-10-05 12:24 ` [PATCH v4 07/12] arm64: dts: qcom: pm8350c: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:40   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 08/12] arm64: dts: qcom: pm8550: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:44   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 09/12] arm64: dts: qcom: pmh0101: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:42   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 10/12] arm64: dts: qcom: pmih0108-kaanapali: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:44   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 11/12] arm64: dts: qcom: pmih0108: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:44   ` sashiko-bot
2026-10-05 12:24 ` [PATCH v4 12/12] arm64: dts: qcom: smb2370: " Manaf Meethalavalappu Pallikunhi
2026-10-05 12:47   ` sashiko-bot

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=20261005124054.3B7F71F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=manaf.pallikunhi@oss.qualcomm.com \
    --cc=mfd@lists.linux.dev \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox