diff mbox series

[4/6] rtc: st-lpc: Fix initial enable_irq/disable_irq balance

Message ID 20241203-rtc-uie-irq-fixes-v1-4-01286ecd9f3f@geanix.com (mailing list archive)
State New
Headers show
Series rtc: Fix problems with missing UIE irqs | expand

Commit Message

Esben Haabendal Dec. 3, 2024, 10:45 a.m. UTC
Interrupts are automatically enabled when requested, so we need to
initialize irq_enabled accordingly to avoid causing an unbalanced enable
warning.

To: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Esben Haabendal <esben@geanix.com>
---
 drivers/rtc/rtc-st-lpc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexandre Belloni Dec. 3, 2024, 1:25 p.m. UTC | #1
On 03/12/2024 11:45:34+0100, Esben Haabendal wrote:
> Interrupts are automatically enabled when requested, so we need to
> initialize irq_enabled accordingly to avoid causing an unbalanced enable
> warning.
> 
> To: Patrice Chotard <patrice.chotard@foss.st.com>
> Signed-off-by: Esben Haabendal <esben@geanix.com>
> ---
>  drivers/rtc/rtc-st-lpc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
> index c6d4522411b312f94de2701ff4ff491e5323aa96..dbc2c23bca23f5de6de3fd4b39c9c67290bfd78d 100644
> --- a/drivers/rtc/rtc-st-lpc.c
> +++ b/drivers/rtc/rtc-st-lpc.c
> @@ -218,6 +218,7 @@ static int st_rtc_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  
> +	rtc->irq_enabled = true;
>  	ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler,
>  			       IRQF_NO_AUTOEN, pdev->name, rtc);

Seeing the IRQF_NO_AUTOEN here, I guess the patch is not correct.

>  	if (ret) {
> 
> -- 
> 2.47.1
>
Esben Haabendal Dec. 3, 2024, 1:37 p.m. UTC | #2
Alexandre Belloni <alexandre.belloni@bootlin.com> writes:

> On 03/12/2024 11:45:34+0100, Esben Haabendal wrote:
>> Interrupts are automatically enabled when requested, so we need to
>> initialize irq_enabled accordingly to avoid causing an unbalanced enable
>> warning.
>> 
>> To: Patrice Chotard <patrice.chotard@foss.st.com>
>> Signed-off-by: Esben Haabendal <esben@geanix.com>
>> ---
>>  drivers/rtc/rtc-st-lpc.c | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
>> index c6d4522411b312f94de2701ff4ff491e5323aa96..dbc2c23bca23f5de6de3fd4b39c9c67290bfd78d 100644
>> --- a/drivers/rtc/rtc-st-lpc.c
>> +++ b/drivers/rtc/rtc-st-lpc.c
>> @@ -218,6 +218,7 @@ static int st_rtc_probe(struct platform_device *pdev)
>>  		return -EINVAL;
>>  	}
>>  
>> +	rtc->irq_enabled = true;
>>  	ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler,
>>  			       IRQF_NO_AUTOEN, pdev->name, rtc);
>
> Seeing the IRQF_NO_AUTOEN here, I guess the patch is not correct.

I guess you are right :)
Sorry about that. I only have HW available for testing the rtc-isl12022
driver here.

This patch should be dropped.

>
>>  	if (ret) {
>> 
>> -- 
>> 2.47.1
>>
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
index c6d4522411b312f94de2701ff4ff491e5323aa96..dbc2c23bca23f5de6de3fd4b39c9c67290bfd78d 100644
--- a/drivers/rtc/rtc-st-lpc.c
+++ b/drivers/rtc/rtc-st-lpc.c
@@ -218,6 +218,7 @@  static int st_rtc_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	rtc->irq_enabled = true;
 	ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler,
 			       IRQF_NO_AUTOEN, pdev->name, rtc);
 	if (ret) {