Linux RTC
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Prasanth R" <ragaprasanth@gmail.com>, linux-rtc@vger.kernel.org
Cc: imx@lists.linux.dev, Frank.Li@kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH 12/12] rtc: rv8803: clear the wake IRQ on unbind
Date: Wed, 25 Nov 2026 07:32:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-232807@kernel.org> (raw)
In-Reply-To: <20261125072026.2997493-13-prasanth.r@lineo.co.jp>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] rtc: rv8803: redundant devm wakeup cleanup in rv8803_probe()
--

commit 3a55bfc9ac0b1aa7bcd9e1d8fb75ae431e24df8c
Author: Prasanth R <ragaprasanth@gmail.com>

rtc: rv8803: clear the wake IRQ on unbind

This commit replaces device_init_wakeup() and dev_pm_set_wake_irq() in
rv8803_probe() with devm_device_init_wakeup() and devm_pm_set_wake_irq()
to release the wake IRQ and wakeup source on unbind.

> diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
> index 7445c81510560..9dbbaffcd489b 100644
> --- a/drivers/rtc/rtc-rv8803.c
> +++ b/drivers/rtc/rtc-rv8803.c
> @@ -700,14 +700,14 @@ static int rv8803_probe(struct i2c_client *client)
>  			dev_warn(&client->dev, "unable to request IRQ, alarms disabled\n");
>  			client->irq = 0;
>  		} else {
> -			device_init_wakeup(&client->dev, true);
> -			err = dev_pm_set_wake_irq(&client->dev, client->irq);
> +			devm_device_init_wakeup(&client->dev);
> +			err = devm_pm_set_wake_irq(&client->dev, client->irq);
>  			if (err)
>  				dev_err(&client->dev, "failed to set wake IRQ\n");
>  		}
>  	} else {
>  		if (device_property_read_bool(&client->dev, "wakeup-source"))
> -			device_init_wakeup(&client->dev, true);
> +			devm_device_init_wakeup(&client->dev);
>  		else
>  			clear_bit(RTC_FEATURE_ALARM, rv8803->rtc->features);
>  	}

[Severity: Medium]
Can unbinding rv8803 actually leave the wake IRQ or wakeup source behind?

i2c_bus_type uses i2c_device_remove() as its bus remove callback, which
runs unconditionally on unbind even when the i2c_driver has no .remove
callback (and i2c_device_probe() runs the same cleanup on probe failure):

drivers/i2c/i2c-core-base.c:i2c_device_remove() {
	...
	devres_release_group(&client->dev, client->devres_group_id);

	dev_pm_clear_wake_irq(&client->dev);
	device_init_wakeup(&client->dev, false);
	...
}

Switching to devm_device_init_wakeup() and devm_pm_set_wake_irq() only
registers redundant devres actions on top of what the I2C core already
tears down.

Note that if "wake irq already initialized" (-EEXIST) is seen during
probe, that happens on initial bind when I2C_CLIENT_WAKE is set (for
example, when "wakeup-source" is specified alongside an interrupt in DT),
because i2c_device_probe() already calls device_init_wakeup() and
dev_pm_set_wake_irq() before invoking the driver's probe callback.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125072026.2997493-1-prasanth.r@lineo.co.jp?part=12

  reply	other threads:[~2026-11-25  7:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  7:20 [PATCH 00/12] rtc: clear the wake IRQ on unbind Prasanth R
2026-11-25  7:20 ` [PATCH 01/12] rtc: snvs: " Prasanth R
2026-11-25  7:20 ` [PATCH 02/12] rtc: mxc: " Prasanth R
2026-11-25  7:20 ` [PATCH 03/12] rtc: mxc_v2: fix unbalanced clock disable on remove Prasanth R
2026-11-25  7:20 ` [PATCH 04/12] rtc: mxc_v2: clear the wake IRQ on unbind Prasanth R
2026-11-25  7:25   ` sashiko-bot
2026-11-25  7:20 ` [PATCH 05/12] rtc: imxdi: clear the wake IRQ on removal Prasanth R
2026-11-25  7:20 ` [PATCH 06/12] rtc: da9063: clear the wake IRQ on unbind Prasanth R
2026-11-25  7:20 ` [PATCH 07/12] rtc: fsl-ftm-alarm: " Prasanth R
2026-11-25  7:20 ` [PATCH 08/12] rtc: jz4740: " Prasanth R
2026-11-25  7:20 ` [PATCH 09/12] rtc: atcrtc100: " Prasanth R
2026-11-25  7:20 ` [PATCH 10/12] rtc: pcf8523: " Prasanth R
2026-11-25  7:33   ` sashiko-bot
2026-11-25  7:20 ` [PATCH 11/12] rtc: pcf85063: " Prasanth R
2026-11-25  7:29   ` sashiko-bot
2026-11-25  7:20 ` [PATCH 12/12] rtc: rv8803: " Prasanth R
2026-11-25  7:32   ` sashiko-bot [this message]
2026-11-25  7:33 ` [PATCH 00/12] rtc: " sashiko-bot
2026-11-25  7:58   ` Prasanth Ramesh

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=sashiko-outbox-232807@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-rtc@vger.kernel.org \
    --cc=ragaprasanth@gmail.com \
    --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