Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Antoni Pokusinski" <apokusinski01@gmail.com>
Cc: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	conor+dt@kernel.org, linux-rtc@vger.kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 5/6] rtc: abx80x: create abx80x_i2c_probe()
Date: Wed, 22 Jul 2026 20:10:57 +0000	[thread overview]
Message-ID: <20260722201057.5CE841F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722195814.298552-6-apokusinski01@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] RV1805 hardware workarounds are skipped during auto-detection.
--

--- Patch [5]: [PATCH 5/6] rtc: abx80x: create abx80x_i2c_probe() ---
commit 0661079a8b8384fb14bc67f5100b45ebe0a01c3e
Author: Antoni Pokusinski <apokusinski01@gmail.com>

rtc: abx80x: create abx80x_i2c_probe()

Move the I2C-specific code from abx80x_probe() to the newly created
function. This is a preparation for introducing the support for
ABX81X RTCs which use SPI interface.

> diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c
> index 7761cb353994e..6e0c14695bdf1 100644
> --- a/drivers/rtc/rtc-abx80x.c
> +++ b/drivers/rtc/rtc-abx80x.c
[ ... ]
> @@ -855,7 +820,7 @@ static int abx80x_probe(struct i2c_client *client)
>  					ABX8XX_OUT_CTRL_EXDS,
>  					ABX8XX_OUT_CTRL_EXDS);
>  		if (err < 0) {
> -			dev_err(&client->dev,
> +			dev_err(dev,
>  				"Unable to write output control register\n");
>  			return -EIO;
>  		}
> @@ -867,26 +832,24 @@ static int abx80x_probe(struct i2c_client *client)
>  			if (partnumber == abx80x_caps[i].pn)
>  				break;
>  		if (abx80x_caps[i].pn == 0) {
> -			dev_err(&client->dev, "Unknown part: %04x\n",
> -				partnumber);
> +			dev_err(dev, "Unknown part: %04x\n", partnumber);
>  			return -EINVAL;
>  		}
>  		part = i;
>  	}

[Severity: High]
This is a pre-existing issue, but are the RV1805 hardware workarounds being
skipped during auto-detection?

Looking at abx80x_probe() in drivers/rtc/rtc-abx80x.c, the RV1805 specifics
are configured before the part auto-detection logic resolves the hardware type:

    /* Configure RV1805 specifics */
    if (part == RV1805) {
        ...
    }

    /* part autodetection */
    if (part == ABX80X) {
        for (i = 0; abx80x_caps[i].pn; i++)
            if (partnumber == abx80x_caps[i].pn)
                break;
        ...
        part = i;
    }

When the driver is bound using the generic "abracon,abx80x" compatible string
or I2C ID, the part argument is initialized to ABX80X. Because the workarounds
check if (part == RV1805) before part is updated to RV1805, they appear to be
silently bypassed.

Could this cause the RV1805 RTC to accidentally enter test mode and suffer
from extra power leakage?

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

  reply	other threads:[~2026-07-22 20:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 19:58 [PATCH 0/6] rtc: abx80x: add support for ABX81X Antoni Pokusinski
2026-07-22 19:58 ` [PATCH 1/6] dt-bindings: rtc: abx80x: document ABX81X RTCs Antoni Pokusinski
2026-07-22 20:09   ` sashiko-bot
2026-07-22 19:58 ` [PATCH 2/6] rtc: abx80x: add irq to struct abx80x_priv Antoni Pokusinski
2026-07-22 20:13   ` sashiko-bot
2026-07-22 19:58 ` [PATCH 3/6] rtc: abx80x: use regmap instead of I2C specific API Antoni Pokusinski
2026-07-22 20:16   ` sashiko-bot
2026-07-22 19:58 ` [PATCH 4/6] rtc: abx80x: replace read-modify-write pattern with regmap helpers Antoni Pokusinski
2026-07-22 20:11   ` sashiko-bot
2026-07-22 19:58 ` [PATCH 5/6] rtc: abx80x: create abx80x_i2c_probe() Antoni Pokusinski
2026-07-22 20:10   ` sashiko-bot [this message]
2026-07-22 19:58 ` [PATCH 6/6] rtc: abx80x: add support for ABX81X Antoni Pokusinski
2026-07-22 20:09   ` 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=20260722201057.5CE841F000E9@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