mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: linux-kernel@vger.kernel.org, a.zummo@towertech.it,
	rtc-linux@googlegroups.com
Subject: Re: [PATCH] rtc: core: Prevent repeated calling of alarm_irq_enable().
Date: Wed, 6 Feb 2013 13:12:25 -0800	[thread overview]
Message-ID: <20130206131225.83a118fe.akpm@linux-foundation.org> (raw)
In-Reply-To: <1360149765-19565-1-git-send-email-jonghwa3.lee@samsung.com>

On Wed, 06 Feb 2013 20:22:45 +0900
Jonghwa Lee <jonghwa3.lee@samsung.com> wrote:

> This patch removes repeated execution of disabling alarm in
> rtc_alarm_irq_enable() of rtc core interface. It made useless
> call even all alarm had been disabled from rtc_timer_remove().
> We'd better to skip disabling alarm when timer queue is empty.
> 

I fear that patch does more than that.

> --- a/drivers/rtc/interface.c
> +++ b/drivers/rtc/interface.c
> @@ -428,7 +428,7 @@ int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled)
>  			rtc_timer_remove(rtc, &rtc->aie_timer);
>  	}
>  
> -	if (err)
> +	if (err || !rtc->timerqueue.next)
>  		/* nothing */;
>  	else if (!rtc->ops)
>  		err = -ENODEV;

This will prevent the irq from being *enabled*, as well as disabled.

To match your description, we'd need to also check that enabled==0?

      reply	other threads:[~2013-02-06 21:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 11:22 Jonghwa Lee
2013-02-06 21:12 ` Andrew Morton [this message]

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=20130206131225.83a118fe.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.zummo@towertech.it \
    --cc=jonghwa3.lee@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /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

Powered by JetHome