Patch "rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr()" has been added to the 6.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr()

to the 6.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rtc-loongson-clear-toy_match0_reg-in-loongson_rtc_is.patch
and it can be found in the queue-6.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 03be7c8bbcba35c17bf78c0362f6997f8c91f8ce
Author: Ming Wang <wangming01@xxxxxxxxxxx>
Date:   Thu Dec 5 19:43:07 2024 +0800

    rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr()
    
    [ Upstream commit 09471d8f5b390883eaf21b917c4bf3ced1b8a1df ]
    
    The TOY_MATCH0_REG should be cleared to 0 in the RTC interrupt handler,
    otherwise the interrupt cannot be cleared, which will cause the
    loongson_rtc_isr() to be triggered multiple times.
    
    The previous code cleared TOY_MATCH0_REG in the loongson_rtc_handler(),
    which is an ACPI interrupt. This did not prevent loongson_rtc_isr()
    from being triggered multiple times.
    
    This commit moves the clearing of TOY_MATCH0_REG to the
    loongson_rtc_isr() to ensure that the interrupt is properly cleared.
    
    Fixes: 1b733a9ebc3d ("rtc: Add rtc driver for the Loongson family chips")
    Signed-off-by: Ming Wang <wangming01@xxxxxxxxxxx>
    Reviewed-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
    Reviewed-by: Keguang Zhang <keguang.zhang@xxxxxxxxx> # on LS1B
    Tested-by: Keguang Zhang <keguang.zhang@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20241205114307.1891418-1-wangming01@xxxxxxxxxxx
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/rtc/rtc-loongson.c b/drivers/rtc/rtc-loongson.c
index 8d713e563d7c0..a0f7974e6a570 100644
--- a/drivers/rtc/rtc-loongson.c
+++ b/drivers/rtc/rtc-loongson.c
@@ -114,6 +114,13 @@ static irqreturn_t loongson_rtc_isr(int irq, void *id)
 	struct loongson_rtc_priv *priv = (struct loongson_rtc_priv *)id;
 
 	rtc_update_irq(priv->rtcdev, 1, RTC_AF | RTC_IRQF);
+
+	/*
+	 * The TOY_MATCH0_REG should be cleared 0 here,
+	 * otherwise the interrupt cannot be cleared.
+	 */
+	regmap_write(priv->regmap, TOY_MATCH0_REG, 0);
+
 	return IRQ_HANDLED;
 }
 
@@ -131,11 +138,7 @@ static u32 loongson_rtc_handler(void *id)
 	writel(RTC_STS, priv->pm_base + PM1_STS_REG);
 	spin_unlock(&priv->lock);
 
-	/*
-	 * The TOY_MATCH0_REG should be cleared 0 here,
-	 * otherwise the interrupt cannot be cleared.
-	 */
-	return regmap_write(priv->regmap, TOY_MATCH0_REG, 0);
+	return ACPI_INTERRUPT_HANDLED;
 }
 
 static int loongson_rtc_set_enabled(struct device *dev)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux