[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2fa3740a-9181-40bf-9b1a-eeb6ffc6f23f@loongson.cn>
Date: Thu, 8 May 2025 11:12:32 +0800
From: Binbin Zhou <zhoubinbin@...ngson.cn>
To: Liu Dalin <liudalin@...insec.com.cn>, alexandre.belloni@...tlin.com,
wangming01@...ngson.cn
Cc: chenhuacai@...nel.org, gaojuxin@...ngson.cn, git@...0n.name,
jiaxun.yang@...goat.com, keguang.zhang@...il.com, lixuefeng@...ngson.cn,
linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
zhoubb.aaron@...il.com
Subject: Re: [PATCH] rtc: loongson: Add missing alarm notifications for ACPI
RTC events
Hi Dalin:
Thanks for your patch.
On 2025/4/29 14:27, Liu Dalin wrote:
> When an application sets and enables an alarm on Loongson RTC devices,
> the alarm notification fails to propagate to userspace because the
> ACPI event handler omits calling rtc_update_irq().
>
> As a result, processes waiting via select() or poll() on RTC device
> files fail to receive alarm notifications.
>
> Fixes: 1b733a9ebc3d ("rtc: Add rtc driver for the Loongson family chips")
> Signed-off-by: Liu Dalin <liudalin@...insec.com.cn>
> ---
> drivers/rtc/rtc-loongson.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/rtc/rtc-loongson.c b/drivers/rtc/rtc-loongson.c
> index 97e5625c064c..0c573f198f63 100644
> --- a/drivers/rtc/rtc-loongson.c
> +++ b/drivers/rtc/rtc-loongson.c
> @@ -129,6 +129,8 @@ static u32 loongson_rtc_handler(void *id)
> {
> struct loongson_rtc_priv *priv = (struct loongson_rtc_priv *)id;
>
> + rtc_update_irq(priv->rtcdev, 1, RTC_AF | RTC_IRQF);
> +
While testing the patch, I noticed that interrupts are triggered
multiple times (/proc/interrupt), not sure if you have the same issue.
I think we need a similar operation to loongson_rtc_isr() to clear the
interrupt:
regmap_write(priv->regmap, TOY_MATCH0_REG, 0);
> spin_lock(&priv->lock);
> /* Disable RTC alarm wakeup and interrupt */
> writel(readl(priv->pm_base + PM1_EN_REG) & ~RTC_EN,
Thanks.
Binbin
Powered by blists - more mailing lists