23 Mar, 2020

1 commit


13 Aug, 2019

1 commit

  • As spin_unlock_irq will enable interrupts.
    mxc_rtc_irq_enable is called from interrupt handler mxc_rtc_interrupt.
    Interrupts are enabled in interrupt handler.
    Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
    in IRQ context to avoid this.

    Signed-off-by: Fuqian Huang
    Link: https://lore.kernel.org/r/20190807082310.10135-1-huangfq.daxian@gmail.com
    Signed-off-by: Alexandre Belloni

    Fuqian Huang
     

29 Apr, 2019

3 commits


12 Apr, 2019

1 commit

  • With calling dev_pm_set_wake_irq() to set MXC RTC as wakeup source
    for suspend, generic wake irq mechanism will automatically enable
    it as wakeup source when suspend, then the suspend/resume callback
    which are ONLY for enabling/disabling irq wake can be removed, it
    simplifies the code.

    Signed-off-by: Anson Huang
    Signed-off-by: Alexandre Belloni

    Anson Huang
     

04 Apr, 2019

1 commit


22 May, 2018

1 commit


04 May, 2018

1 commit

  • We should get drvdata from struct device directly. Going via
    platform_device is an unneeded step back and forth.

    Signed-off-by: Wolfram Sang
    Acked-by: Michal Simek (for zynqmp)
    Signed-off-by: Alexandre Belloni

    Wolfram Sang
     

24 Aug, 2017

1 commit

  • Currently, the IRQs are disabled when the rtc character device is closed.
    This means that the device needs to stay open to get alarms while the usual
    use case will open the device, set the alarm and close the device as is
    done in rtcwake.

    Keep the alarm functional on character device release so the platform can
    actually wakeup.

    Reviewed-by: Fabio Estevam
    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

24 Jun, 2017

1 commit

  • This variable was never used. With GCC 6.2, we get the following warning:

    drivers/rtc/rtc-mxc.c:44:18: warning: ‘PIE_BIT_DEF’ defined but not used [-Wunused-const-variable=]
    static const u32 PIE_BIT_DEF[MAX_PIE_NUM][2] = {

    Signed-off-by: Diaz de Grenu, Jose
    Signed-off-by: Alexandre Belloni

    Diaz de Grenu, Jose
     

12 Jan, 2017

1 commit

  • Declare rtc_class_ops structures as const as they are only passed
    as an argument to the function devm_rtc_device_register. This argument
    is of type const struct rtc_class_ops *, so rtc_class_ops structures
    having this property can be declared const.
    Done using Coccinelle:

    @r1 disable optional_qualifier @
    identifier i;
    position p;
    @@
    static struct rtc_class_ops i@p = {...};

    @ok1@
    identifier r1.i;
    position p;
    @@
    devm_rtc_device_register(...,&i@p,...)

    @bad@
    position p!={r1.p,ok1.p};
    identifier r1.i;
    @@
    i@p

    @depends on !bad disable optional_qualifier@
    identifier r1.i;
    @@
    +const
    struct rtc_class_ops i;

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Alexandre Belloni

    Bhumika Goyal
     

20 May, 2016

1 commit


05 Aug, 2015

2 commits


20 Jun, 2015

1 commit


03 Apr, 2015

3 commits

  • This driver has a number of y2038/y2106 issues.

    This patch resolves them by:

    - Replacing rtc_time_to_tm() with rtc_time64_to_tm()
    - Replacing rtc_tm_to_time() with rtc_tm_to_time64()
    - Changing mxc_rtc_set_mmss() to use rtc_class_ops's set_mmss64()

    After this patch, the driver should not have any remaining
    y2038/y2106 issues.

    Signed-off-by: Xunlei Pang
    Signed-off-by: John Stultz
    Acked-by: Alessandro Zummo
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-14-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     
  • We want to convert mxc_rtc_set_mmss() to use rtc_class_ops's
    set_mmss64(), but it uses get_alarm_or_time()/set_alarm_or_time()
    internal interfaces which are y2038 unsafe.

    So here as a separate patch, it converts these two internal
    interfaces of "mxc" to use safe time64_t to make some
    preparations.

    Signed-off-by: Xunlei Pang
    Signed-off-by: John Stultz
    Acked-by: Alessandro Zummo
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-13-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     
  • rtc_class_ops's set_alarm() shouldn't deal with the alarm date,
    as this is handled in the rtc core.

    See rtc_dev_ioctl()'s RTC_ALM_SET and RTC_WKALM_SET cases.

    Signed-off-by: Xunlei Pang
    Signed-off-by: John Stultz
    Acked-by: Alessandro Zummo
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-12-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     

20 Oct, 2014

1 commit


24 Jan, 2014

2 commits


12 Sep, 2013

1 commit

  • Convert the composition of devm_request_mem_region and devm_ioremap to a
    single call to devm_ioremap_resource. The associated call to
    platform_get_resource is also simplified and moved next to the new call
    to devm_ioremap_resource.

    This was done using a combination of the semantic patches
    devm_ioremap_resource.cocci and devm_request_and_ioremap.cocci, found in
    the scripts/coccinelle/api directory.

    In rtc-lpc32xx.c and rtc-mv.c, the local variable size is no longer needed.

    In rtc-ds1511.c the size field of the local structure is not useful any
    more, and is deleted.

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     

04 Jul, 2013

2 commits


30 Apr, 2013

2 commits


04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Alessandro Zummo
    Cc: Srinidhi Kasagar
    Cc: Linus Walleij
    Cc: Mike Frysinger
    Cc: Wan ZongShun
    Cc: Guan Xuetao
    Cc: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

15 Oct, 2012

1 commit

  • It changes the driver to use platform_device_id rather than cpu_is_xxx
    to determine the controller type, and updates the platform code
    accordingly.

    As the result, mach/hardware.h inclusion gets removed from the driver.

    Signed-off-by: Shawn Guo
    Acked-by: Sascha Hauer
    Acked-by: Arnd Bergmann
    Cc: Andrew Morton
    Cc: rtc-linux@googlegroups.com

    Shawn Guo
     

06 Oct, 2012

2 commits


12 Jul, 2012

1 commit

  • Fixes

    WARNING: at irq/handle.c:146 handle_irq_event_percpu+0x19c/0x1b8()
    irq 25 handler mxc_rtc_interrupt+0x0/0xac enabled interrupts
    Modules linked in:
    (unwind_backtrace+0x0/0xf0) from (warn_slowpath_common+0x4c/0x64)
    (warn_slowpath_common+0x4c/0x64) from (warn_slowpath_fmt+0x30/0x40)
    (warn_slowpath_fmt+0x30/0x40) from (handle_irq_event_percpu+0x19c/0x1b8)
    (handle_irq_event_percpu+0x19c/0x1b8) from (handle_irq_event+0x28/0x38)
    (handle_irq_event+0x28/0x38) from (handle_level_irq+0x80/0xc4)
    (handle_level_irq+0x80/0xc4) from (generic_handle_irq+0x24/0x38)
    (generic_handle_irq+0x24/0x38) from (handle_IRQ+0x30/0x84)
    (handle_IRQ+0x30/0x84) from (avic_handle_irq+0x2c/0x4c)
    (avic_handle_irq+0x2c/0x4c) from (__irq_svc+0x40/0x60)
    Exception stack(0xc050bf60 to 0xc050bfa8)
    bf60: 00000001 00000000 003c4208 c0018e20 c050a000 c050a000 c054a4c8 c050a000
    bf80: c05157a8 4117b363 80503bb4 00000000 01000000 c050bfa8 c0018e2c c000e808
    bfa0: 60000013 ffffffff
    (__irq_svc+0x40/0x60) from (default_idle+0x1c/0x30)
    (default_idle+0x1c/0x30) from (cpu_idle+0x68/0xa8)
    (cpu_idle+0x68/0xa8) from (start_kernel+0x22c/0x26c)

    Signed-off-by: Benoît Thébaudeau
    Cc: Alessandro Zummo
    Cc: Sascha Hauer
    Acked-by: Uwe Kleine-König
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benoît Thébaudeau
     

11 Jan, 2012

2 commits

  • Fix alarm IRQ handling, make the alarm one-shot. Cleanup black magick
    with a validation of already validated time data.

    Add ability to wake the system with alarm.

    [akpm@linux-foundation.org: fix CONFIG_PM=n build]
    Signed-off-by: Yauhen Kharuzhy
    Cc: Daniel Mack
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yauhen Kharuzhy
     
  • There is no way to track year in the i.MX1 RTC: Days Counter register is
    9-bit wide only. Attempt to save date after 1970-01-01 plus 512 days
    causes endless loop in mxc_rtc_set_mmss(). Fix this by resetting year to
    1970.

    [akpm@linux-foundation.org: use conventional comment layout]
    Signed-off-by: Yauhen Kharuzhy
    Cc: Daniel Mack
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yauhen Kharuzhy
     

27 May, 2011

1 commit


07 May, 2011

1 commit

  • Commit f44f7f96a20 ("RTC: Initialize kernel state from RTC") uncovered
    an issue in a number of RTC drivers, where the drivers call
    rtc_device_register before initializing the device or platform drvdata.

    This frequently results in null pointer dereferences when the
    rtc_device_register immediately makes use of the rtc device, calling
    rtc_read_alarm.

    The solution is to ensure the drvdata is initialized prior to registering
    the rtc device.

    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: Wolfram Sang
    [fixed up commit log -jstultz]
    Signed-off-by: John Stultz

    Wolfram Sang
     

10 Mar, 2011

1 commit

  • Now that the generic code handles UIE mode irqs via periodic
    alarm interrupts, no one calls the
    rtc_class_ops->update_irq_enable() method anymore.

    This patch removes the driver hooks and implementations of
    update_irq_enable if no one else is calling it.

    CC: Thomas Gleixner
    CC: Alessandro Zummo
    CC: Marcelo Roberto Jimenez
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     

11 Aug, 2010

1 commit


25 May, 2010

1 commit


07 Apr, 2010

1 commit

  • On exit paths in mxc_rtc_probe() method some resources are not freed
    correctly.

    This patch fixes:
    * unrequested memory region containing imx RTC registers
    * iounmap() isn't called on exit_free_pdata branch
    * clock get rate is called for freed clock source
    * clock isn't disabled on exit_put_clk branch

    To simplify the fix managed device resources are used.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Vladimir Zapolskiy
    Cc: Alessandro Zummo
    Cc: Daniel Mack
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Zapolskiy