Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Antoni Pokusinski" <apokusinski01@gmail.com>
Cc: conor+dt@kernel.org, linux-rtc@vger.kernel.org,
	devicetree@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	robh@kernel.org
Subject: Re: [PATCH v2 2/8] rtc: abx80x: move part autodetection before RV1805 configuration
Date: Sat, 25 Jul 2026 15:07:52 +0000	[thread overview]
Message-ID: <20260725150753.325271F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260725145718.14733-3-apokusinski01@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch fails to resolve the issue it describes because part autodetection for the RV1805 incorrectly resolves to AB1805.
--

--- Patch [2]: [PATCH v2 2/8] rtc: abx80x: move part autodetection before RV1805 configuration ---
commit e37ea6c1257442ff3423e6bacb742916beb85bbb
Author: Antoni Pokusinski <apokusinski01@gmail.com>

rtc: abx80x: move part autodetection before RV1805 configuration

This commit moves the part autodetection logic before the RV1805
configuration block. The intention is to ensure the RV1805 specifics are
applied even when the driver is bound using a generic compatible string.

> diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c
> index 5486d9d0b1e5d..ca3af91c29977 100644
> --- a/drivers/rtc/rtc-abx80x.c
> +++ b/drivers/rtc/rtc-abx80x.c
> @@ -814,6 +814,25 @@ static int abx80x_probe(struct i2c_client *client)
>  		return -EIO;
>  	}
>  
> +	/* part autodetection */
> +	if (part == ABX80X) {
> +		for (i = 0; abx80x_caps[i].pn; i++)
> +			if (partnumber == abx80x_caps[i].pn)
> +				break;

[Severity: Medium]
Does this code introduce a regression by preventing the RV1805 configuration
from running during autodetection?

Since AB1805 and RV1805 share the same part number (0x1805), and AB1805
appears earlier in the abx80x_caps array, it appears this loop will always
match AB1805 first.

If the driver is bound using the generic abracon,abx80x compatible string,
part will be set to AB1805 instead of RV1805.

> +		if (abx80x_caps[i].pn == 0) {
> +			dev_err(&client->dev, "Unknown part: %04x\n",
> +				partnumber);
> +			return -EINVAL;
> +		}
> +		part = i;
> +	}
> +
> +	if (partnumber != abx80x_caps[part].pn) {
> +		dev_err(&client->dev, "partnumber mismatch %04x != %04x\n",
> +			partnumber, abx80x_caps[part].pn);
> +		return -EINVAL;
> +	}
> +
>  	/* Configure RV1805 specifics */
>  	if (part == RV1805) {

[Severity: Medium]
Will this check now evaluate to false due to the autodetection resolving to
AB1805 above?

If part is overwritten with AB1805 during autodetection, the RV1805 specifics
will continue to be silently skipped. This leaves the device vulnerable to
accidentally entering test mode and leaking extra power, meaning the patch
might not resolve the issue it describes.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260725145718.14733-1-apokusinski01@gmail.com?part=2

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

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25 14:57 [PATCH v2 0/8] rtc: abx80x: add support for abx81x Antoni Pokusinski
2026-07-25 14:57 ` [PATCH v2 1/8] dt-bindings: rtc: abx80x: document ABX81X RTCs Antoni Pokusinski
2026-07-25 15:04   ` Krzysztof Kozlowski
2026-07-25 15:11   ` sashiko-bot
2026-07-25 14:57 ` [PATCH v2 2/8] rtc: abx80x: move part autodetection before RV1805 configuration Antoni Pokusinski
2026-07-25 15:07   ` sashiko-bot [this message]
2026-07-25 14:57 ` [PATCH v2 3/8] rtc: abx80x: properly handle shared IRQs Antoni Pokusinski
2026-07-25 15:14   ` sashiko-bot
2026-07-25 14:57 ` [PATCH v2 4/8] rtc: abx80x: add irq to struct abx80x_priv Antoni Pokusinski
2026-07-25 15:12   ` sashiko-bot
2026-07-25 14:57 ` [PATCH v2 5/8] rtc: abx80x: use regmap instead of I2C specific API Antoni Pokusinski
2026-07-25 15:13   ` sashiko-bot
2026-07-25 14:57 ` [PATCH v2 6/8] rtc: abx80x: replace read-modify-write pattern with regmap helpers Antoni Pokusinski
2026-07-25 15:12   ` sashiko-bot
2026-07-25 14:57 ` [PATCH v2 7/8] rtc: abx80x: create abx80x_i2c_probe() Antoni Pokusinski
2026-07-25 15:13   ` sashiko-bot
2026-07-25 14:57 ` [PATCH v2 8/8] rtc: abx80x: add support for ABX81X Antoni Pokusinski
2026-07-25 15:30   ` 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=20260725150753.325271F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=apokusinski01@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-rtc@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox