* [PATCH] rtc: bd70528: properly enable wakeup
@ 2026-09-10 9:25 Andreas Kemnade
2026-09-10 9:35 ` sashiko-bot
2026-09-10 10:28 ` Matti Vaittinen
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Kemnade @ 2026-09-10 9:25 UTC (permalink / raw)
To: mazziesaccount, alexandre.belloni, linux-rtc, linux-kernel
Cc: Andreas Kemnade
Wakeup on RTC alarm now only accidentially works when wakeup for the power
button connected to the same PMIC is also enabled. Fix that by properly
specifying the wakeup irq.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/rtc/rtc-bd70528.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
index 482810b61495d..dc86882562abd 100644
--- a/drivers/rtc/rtc-bd70528.c
+++ b/drivers/rtc/rtc-bd70528.c
@@ -11,6 +11,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>
#include <linux/rtc.h>
@@ -320,6 +321,7 @@ static int bd70528_probe(struct platform_device *pdev)
device_set_wakeup_capable(&pdev->dev, true);
device_wakeup_enable(&pdev->dev);
+ devm_pm_set_wake_irq(&pdev->dev, irq);
rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc)) {
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] rtc: bd70528: properly enable wakeup
2026-09-10 9:25 [PATCH] rtc: bd70528: properly enable wakeup Andreas Kemnade
@ 2026-09-10 9:35 ` sashiko-bot
2026-09-10 10:28 ` Matti Vaittinen
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-10 9:35 UTC (permalink / raw)
To: Andreas Kemnade; +Cc: linux-rtc, Alexandre Belloni
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The return value of devm_pm_set_wake_irq() is ignored, which can result in a silent failure to enable wakeup.
--
commit 145fe15d42adcccef8370937c9cb325de30fe4ff
Author: Andreas Kemnade <andreas@kemnade.info>
rtc: bd70528: properly enable wakeup
This commit specifies the wakeup irq for the RTC alarm to ensure wakeup
works reliably, rather than relying on the power button's wakeup
configuration.
> diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
> index 482810b61495d..dc86882562abd 100644
> --- a/drivers/rtc/rtc-bd70528.c
> +++ b/drivers/rtc/rtc-bd70528.c
[ ... ]
> @@ -320,6 +321,7 @@ static int bd70528_probe(struct platform_device *pdev)
>
> device_set_wakeup_capable(&pdev->dev, true);
> device_wakeup_enable(&pdev->dev);
> + devm_pm_set_wake_irq(&pdev->dev, irq);
[Severity: Medium]
Is it safe to ignore the return value of devm_pm_set_wake_irq() here?
If this fails (for instance, due to -ENOMEM during the internal kzalloc() or
devm_add_action_or_reset() calls), the wakeup IRQ configuration will be
silently aborted.
The probe function would then continue and succeed, leaving the device
without wakeup capabilities. Should this return value be checked and
propagated to prevent a silent failure?
>
> rtc = devm_rtc_allocate_device(&pdev->dev);
> if (IS_ERR(rtc)) {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260910092558.1008998-1-andreas@kemnade.info?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rtc: bd70528: properly enable wakeup
2026-09-10 9:25 [PATCH] rtc: bd70528: properly enable wakeup Andreas Kemnade
2026-09-10 9:35 ` sashiko-bot
@ 2026-09-10 10:28 ` Matti Vaittinen
2026-09-10 14:23 ` Andreas Kemnade
1 sibling, 1 reply; 4+ messages in thread
From: Matti Vaittinen @ 2026-09-10 10:28 UTC (permalink / raw)
To: Andreas Kemnade, alexandre.belloni, linux-rtc, linux-kernel
On 10/09/2026 12:25, Andreas Kemnade wrote:
> Wakeup on RTC alarm now only accidentially works when wakeup for the power
> button connected to the same PMIC is also enabled. Fix that by properly
> specifying the wakeup irq.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Thanks!
By the way, I am not 100% sure all of the PMICs using this driver even
have a power button input. I suspect some doesn't (maybe bd71815). I
wouldn't be against Fixes -tag :)
> ---
> drivers/rtc/rtc-bd70528.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
> index 482810b61495d..dc86882562abd 100644
> --- a/drivers/rtc/rtc-bd70528.c
> +++ b/drivers/rtc/rtc-bd70528.c
> @@ -11,6 +11,7 @@
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/platform_device.h>
> +#include <linux/pm_wakeirq.h>
> #include <linux/regmap.h>
> #include <linux/rtc.h>
>
> @@ -320,6 +321,7 @@ static int bd70528_probe(struct platform_device *pdev)
>
> device_set_wakeup_capable(&pdev->dev, true);
> device_wakeup_enable(&pdev->dev);
> + devm_pm_set_wake_irq(&pdev->dev, irq);
>
> rtc = devm_rtc_allocate_device(&pdev->dev);
> if (IS_ERR(rtc)) {
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] rtc: bd70528: properly enable wakeup
2026-09-10 10:28 ` Matti Vaittinen
@ 2026-09-10 14:23 ` Andreas Kemnade
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Kemnade @ 2026-09-10 14:23 UTC (permalink / raw)
To: Matti Vaittinen; +Cc: alexandre.belloni, linux-rtc, linux-kernel
On Thu, 10 Sep 2026 13:28:23 +0300
Matti Vaittinen <mazziesaccount@gmail.com> wrote:
> On 10/09/2026 12:25, Andreas Kemnade wrote:
> > Wakeup on RTC alarm now only accidentially works when wakeup for the power
> > button connected to the same PMIC is also enabled. Fix that by properly
> > specifying the wakeup irq.
> >
> > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
>
> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
>
> Thanks!
>
> By the way, I am not 100% sure all of the PMICs using this driver even
> have a power button input. I suspect some doesn't (maybe bd71815). I
> wouldn't be against Fixes -tag :)
>
looking at mfd driver:
* BD71815 data-sheet does not list the power-button IRQ so we
* don't use it.
*/
button_irq = 0;
....
if (button_irq) {
ret = rohm_register_pwrbutton(&i2c->dev, button_irq,
"bd71828-pwrkey", true, irq_domain);
if (ret)
return ret;
}
....
so you are right about the power button.
Sashiko wants some error-checking there, so I'll send a
v2 with a fixes-tag and error checking.
Regards,
Andreas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-10 14:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10 9:25 [PATCH] rtc: bd70528: properly enable wakeup Andreas Kemnade
2026-09-10 9:35 ` sashiko-bot
2026-09-10 10:28 ` Matti Vaittinen
2026-09-10 14:23 ` Andreas Kemnade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox