mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Opensource [Anthony Olech]" <anthony.olech.opensource@diasemi.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Support Opensource <support.opensource@diasemi.com>,
	<linux-kernel@vger.kernel.org>, <rtc-linux@googlegroups.com>,
	David Dajun Chen <david.chen@diasemi.com>
Subject: Re: [PATCH V1] drivers/rtc: da9052: ALARM causes interrupt storm
Date: Fri, 2 May 2014 13:09:42 -0700	[thread overview]
Message-ID: <20140502130942.490ca884c0a1f4a2c47de150@linux-foundation.org> (raw)
In-Reply-To: <201404021233.s32CXeco057975@swsrvapps-02.lan>

On Wed, 2 Apr 2014 12:45:38 +0100 "Opensource [Anthony Olech]" <anthony.olech.opensource@diasemi.com> wrote:

> Setting the alarm to a time not on a minute boundary results in repeated
> interrupts being generated by the DA9052/3 PMIC device until the kernel
> RTC core sees that the alarm has rung. Sometimes the number and frequency
> of interrupts can cause the kernel to disable the IRQ line used by the
> DA9052/3 PMIC with disasterous consequences. This patch fixes the problem.
> 
> Even though the DA9052/3 PMIC is capable generating periodic interrupts,
> ie TICKS, the method used to distinguish RTC_AF from RTC_PF events was
> flawed and can not work in conjunction with the regmap_irq kernel core.
> Thus that flawed detection has also been removed by the DA9052/3 PMIC RTC
> driver's irq handler, so that it no longer reports the wrong type of event
> to the kernel RTC core.
> 
> The internal static functions within the DA9052/3 PMIC RTC driver have
> been changed to pass the 'da9052_rtc' structure instead of the 'da9052'
> because there is no backwards pointer from the 'da9052' structure.
> 
> Signed-off-by: Anthony Olech <anthony.olech.opensource@diasemi.com>
> ---
> 
> This patch is relative to linux-next repository tag next-20140402
> 
> This patch fixes the three issues described above. The first is serious
> because usiing the RTC alarm set to a non minute boundary will eventually
> cause all component drivers that depend on the interrupt line to fail. The
> solution adopted is to round up to alarm time to the next highest minute.
> 
> The second bug, reporting a RTC_PF event instead of an RTC_AF event turns
> out to not matter with the current implementation of the kernel RTC core
> as it seems to ignore the event type. However, should that change in the
> future it is better to fix the issue now and not have 'problems waiting to
> happen'
> 
> The third set of changes are to make the da9052_rtc structure available
> to all the local internal functions in the driver. This was done during
> testing so that diagnostic data could be stored there. Should the solution
> to the first issue be found not acceptable, then the alternative of using
> the TICKS interrupt at the fixed one second interval in order to step to
> the exact second of the requested alarm requires an extra (alarm time)
> piece of data to be stored. In devices that use the alarm function to wake
> up from sleep, accuracy to the second will result in the device being
> awake for up to nearly a minute longer than expected.

The above three paragraphs contained important info which is
appropriate to the formal patch changelog.

>
> ...
>
> @@ -261,7 +271,7 @@ static struct platform_driver da9052_rtc_driver = {
>  
>  module_platform_driver(da9052_rtc_driver);
>  
> -MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
> +MODULE_AUTHOR("Anthony Olech <Anthony.Olech@diasemi.com>");
>  MODULE_DESCRIPTION("RTC driver for Dialog DA9052 PMIC");
>  MODULE_LICENSE("GPL");
>  MODULE_ALIAS("platform:da9052-rtc");

What's this?

      parent reply	other threads:[~2014-05-02 20:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 11:45 Opensource [Anthony Olech]
2014-04-30  8:20 ` Opensource [Anthony Olech]
2014-05-02 20:09 ` 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=20140502130942.490ca884c0a1f4a2c47de150@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.zummo@towertech.it \
    --cc=anthony.olech.opensource@diasemi.com \
    --cc=david.chen@diasemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=support.opensource@diasemi.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

all inboxes | Powered by JetHome®