All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kaustabh Chakraborty" <kauschluss@disroot.org>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v7 04/10] mfd: sec: add support for S2MU005 PMIC
Date: Fri, 15 May 2026 22:25:08 +0000	[thread overview]
Message-ID: <20260515222508.BF4ADC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260516-s2mu005-pmic-v7-4-73f9702fb461@disroot.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing `.use_ack = true` in `s2mu005_irq_chip` causes an infinite interrupt storm.
--

commit 6e3b1141ae78b94854e84436a682b1574f6933ac
Author: Kaustabh Chakraborty <kauschluss@disroot.org>

mfd: sec: add support for S2MU005 PMIC

This commit adds support for Samsung's S2MU005 PMIC. It introduces a new
device type and handles its specific revision register fetching, as well
as providing its interrupt chips and child cell definitions.

> diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
> index 133188391f7c2..42862807be1a0 100644
> --- a/drivers/mfd/sec-irq.c
> +++ b/drivers/mfd/sec-irq.c

[ ... ]

> @@ -337,6 +397,16 @@ static const struct regmap_irq_chip s2mpu05_irq_chip = {
>  	.ack_base = S2MPU05_REG_INT1,
>  };
>  
> +static const struct regmap_irq_chip s2mu005_irq_chip = {
> +	.name = "s2mu005",
> +	.irqs = s2mu005_irqs,
> +	.num_irqs = ARRAY_SIZE(s2mu005_irqs),
> +	.num_regs = 4,
> +	.status_base = S2MU005_REG_CHGR_INT1,
> +	.mask_base = S2MU005_REG_CHGR_INT1M,
> +	.get_irq_reg = s2mu005_irq_get_reg,
> +};

Does this structure need .use_ack = true?

In s2mu005_irq_chip, .ack_base is not explicitly set, so it implicitly
initializes to 0. The .status_base is set to S2MU005_REG_CHGR_INT1, which is
the first enumerator in s2mu005_reg and thus equals 0.

The regmap-irq core framework relies on the condition if (chip->ack_base ||
chip->use_ack) to determine if it should write back to the hardware registers
to acknowledge and clear the interrupts. Because both evaluate to 0 (false),
regmap-irq assumes the chip is clear-on-read and completely skips the ACK
execution.

Since Samsung PMICs require a Write-1-to-Clear sequence to clear interrupt
status registers, without the ACK write, the hardware PMIC continuously
asserts the physical IRQ line.

As the interrupt uses IRQF_ONESHOT, the moment the threaded handler completes
and unmasks the interrupt at the controller, the still-asserted hardware line
will immediately re-trigger the interrupt.

Could this loop cause an infinite interrupt storm, starving the CPU and
leading to a hard lockup?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260516-s2mu005-pmic-v7-0-73f9702fb461@disroot.org?part=4

  reply	other threads:[~2026-05-15 22:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 21:38 [PATCH v7 00/10] Support for Samsung S2MU005 PMIC and its sub-devices Kaustabh Chakraborty
2026-05-15 21:38 ` [PATCH v7 01/10] dt-bindings: leds: document Samsung S2M series PMIC flash LED device Kaustabh Chakraborty
2026-05-15 21:38 ` [PATCH v7 02/10] dt-bindings: extcon: document Samsung S2M series PMIC extcon device Kaustabh Chakraborty
2026-05-15 21:38 ` [PATCH v7 03/10] dt-bindings: mfd: add documentation for S2MU005 PMIC Kaustabh Chakraborty
2026-05-15 21:38 ` [PATCH v7 04/10] mfd: sec: add support " Kaustabh Chakraborty
2026-05-15 22:25   ` sashiko-bot [this message]
2026-05-15 21:38 ` [PATCH v7 05/10] mfd: sec: set DMA coherent mask Kaustabh Chakraborty
2026-05-15 22:24   ` sashiko-bot
2026-05-15 21:38 ` [PATCH v7 06/10] leds: flash: add support for Samsung S2M series PMIC flash LED device Kaustabh Chakraborty
2026-05-15 22:15   ` sashiko-bot
2026-05-15 21:38 ` [PATCH v7 07/10] leds: rgb: add support for Samsung S2M series PMIC RGB " Kaustabh Chakraborty
2026-05-15 22:10   ` sashiko-bot
2026-05-15 21:38 ` [PATCH v7 08/10] Documentation: leds: document pattern behavior of Samsung S2M series PMIC RGB LEDs Kaustabh Chakraborty
2026-05-15 21:38 ` [PATCH v7 09/10] extcon: add support for Samsung S2M series PMIC extcon devices Kaustabh Chakraborty
2026-05-15 22:10   ` sashiko-bot
2026-05-15 21:38 ` [PATCH v7 10/10] power: supply: add support for Samsung S2M series PMIC charger device Kaustabh Chakraborty
2026-05-15 22:22   ` 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=20260515222508.BF4ADC2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kauschluss@disroot.org \
    --cc=krzk+dt@kernel.org \
    --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.