Devicetree
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>,
	devicetree@vger.kernel.org, mfd@lists.linux.dev,
	conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH 6/6] mfd: qcom-pm8008: Tolerate missing interrupt
Date: Mon, 21 Sep 2026 11:42:37 +0100	[thread overview]
Message-ID: <20260921104237.GB2348773@google.com> (raw)
In-Reply-To: <20260918165721.CA17C1F000FF@smtp.kernel.org>

On Fri, 18 Sep 2026, sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] mfd: qcom-pm8008: bogus IRQ mappings for child cells when client->irq is 0

Please review, explain or fix the Sashiko review(s).

If this is a set, this request includes the other patches too.

> --
> 
> commit 2c273914596163e5696becde808ceb33d98f0fe8
> Author: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> mfd: qcom-pm8008: Tolerate missing interrupt
> 
> This commit modifies pm8008_probe() to only register the IRQ infrastructure
> if the parent IRQ is present. This is intended to support devices like PM8010
> where the interrupt pin is tied to ground.
> 
> > diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
> > --- a/drivers/mfd/qcom-pm8008.c
> > +++ b/drivers/mfd/qcom-pm8008.c
> > @@ -233,7 +233,7 @@ static void devm_irq_domain_fwnode_release(void *data)
> >  
> >  static int pm8008_probe(struct i2c_client *client)
> >  {
> > -	struct regmap_irq_chip_data *irq_data;
> > +	struct regmap_irq_chip_data *irq_data = NULL;
> >  	const struct pm8008_match_data *data;
> 
> [ ... ]
> 
> > -	/* Needed by GPIO driver. */
> > -	dev_set_drvdata(dev, regmap_irq_get_domain(irq_data));
> > +		/* Needed by GPIO driver. */
> > +		dev_set_drvdata(dev, regmap_irq_get_domain(irq_data));
> > +	}
> >  
> >  	return devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, data->mfd_cells,
> > -				data->num_mfd_cells, NULL, 0,
> > -				regmap_irq_get_domain(irq_data));
> > +				    data->num_mfd_cells, NULL, 0,
> > +				    regmap_irq_get_domain(irq_data));
> 
> [Severity: Medium]
> Will this lead to bogus IRQ mappings for child cells when client->irq is 0?
> 
> When the device has no IRQ, irq_data remains NULL, and we pass a NULL domain
> to devm_mfd_add_devices() with an irq_base of 0.
> 
> The MFD cells (such as pm8008_temp_res for qpnp-temp-alarm) specify IRQ
> resources using DEFINE_RES_IRQ() with hardcoded offsets, for example:
> 
> static const struct resource pm8008_temp_res[] = {
> 	DEFINE_RES_MEM(PM8008_TEMP_ALARM_ADDR, 0x100),
> 	DEFINE_RES_IRQ(PM8008_IRQ_TEMP_ALARM),
> };
> 
> When mfd_add_device() processes these IRQ resources and the domain is NULL,
> it falls back to assigning the IRQ as irq_base + start. Since irq_base is 0,
> a child device like the temp alarm will be assigned a global physical Linux
> IRQ matching its offset (e.g., 0 + 5 = 5).
> 
> If a child driver requests this IRQ, could it steal an interrupt from another
> hardware device on the system, leading to unexpected behavior or resource
> conflicts? Should the driver dynamically strip or adjust the IRQ resources
> from the MFD cells when no parent IRQ is present?
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260918-pm8010_i2c_support-v1-0-de33d78fad9d@oss.qualcomm.com?part=6

-- 
Lee Jones

  reply	other threads:[~2026-09-21 10:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 16:42 [PATCH 0/6] mfd: qcom-pm8008: Add support for PM8010 over I2C Jishnu Prakash
2026-09-18 16:42 ` [PATCH 1/6] dt-bindings: mfd: pm8008: Add qcom,pm8010-i2c compatible Jishnu Prakash
2026-09-18 16:49   ` sashiko-bot
2026-09-28 19:48   ` Rob Herring (Arm)
2026-09-18 16:42 ` [PATCH 2/6] regulator: pm8008: Add PM8010 support Jishnu Prakash
2026-09-18 16:50   ` sashiko-bot
2026-09-18 16:42 ` [PATCH 3/6] regulator: qcom-pm8008: Add PM8010 mode support Jishnu Prakash
2026-09-18 16:52   ` sashiko-bot
2026-09-23 10:17     ` Jishnu Prakash
2026-09-18 16:42 ` [PATCH 4/6] mfd: qcom-pm8008: Add PM8010 support Jishnu Prakash
2026-09-18 16:51   ` sashiko-bot
2026-09-23 10:17     ` Jishnu Prakash
2026-09-21 13:33   ` Konrad Dybcio
2026-09-23 10:18     ` Jishnu Prakash
2026-10-01  8:29       ` Konrad Dybcio
2026-09-18 16:42 ` [PATCH 5/6] dt-bindings: mfd: pm8008: Make interrupts optional Jishnu Prakash
2026-09-18 16:50   ` sashiko-bot
2026-09-28 19:49   ` Rob Herring (Arm)
2026-09-18 16:42 ` [PATCH 6/6] mfd: qcom-pm8008: Tolerate missing interrupt Jishnu Prakash
2026-09-18 16:57   ` sashiko-bot
2026-09-21 10:42     ` Lee Jones [this message]
2026-09-23 10:17       ` Jishnu Prakash
2026-09-23 10:17     ` Jishnu Prakash
2026-09-19 13:01 ` [PATCH 0/6] mfd: qcom-pm8008: Add support for PM8010 over I2C Oleg Keri

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=20260921104237.GB2348773@google.com \
    --to=lee@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jishnu.prakash@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