10 Mar, 2011

2 commits

  • With the generic rtc code now emulating PIE mode irqs via an
    hrtimer, no one calls the rtc_class_ops->irq_set_freq call.

    This patch removes the hook and deletes the driver functions
    if no one else calls them.

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

    John Stultz
     
  • With PIE mode interrupts now emulated in generic code via an hrtimer,
    no one calls rtc_class_ops->irq_set_state(), so this patch removes it
    along with driver implementations.

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

    John Stultz
     

05 Mar, 2011

1 commit

  • Fix s3c_rtc_setaie() prototype to eliminate the following compile
    warning:

    drivers/rtc/rtc-s3c.c:383: warning: initialization from incompatible pointer type

    (akpm: the rtc_class_ops.alarm_irq_enable() handler is being passed two
    arguments where it expects just one, presumably with undesired effects)

    Signed-off-by: Axel Lin
    Cc: Alessandro Zummo
    Cc: Ben Dooks
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     

28 Oct, 2010

6 commits

  • Add "rtc_valid_tm" in s3c_rtc_gettime() as per Wan ZongShun's suggestion.

    Suggested-by: Wan ZongShun
    Signed-off-by: Kukjin Kim
    Cc: Ben Dooks
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kukjin Kim
     
  • Change RTC initialization method in probe(). The 'rtc_valid_tm(tm)' can
    check whether RTC BCD is valid or not. And change the method of checking
    because the previous method cannot validate RTC BCD registers properly.

    Signed-off-by: Changhwan Youn
    Signed-off-by: Kukjin Kim
    Cc: Ben Dooks
    Cc: Wan ZongShun
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Changhwan Youn
     
  • Fix debug message format.

    Signed-off-by: Kukjin Kim
    Acked-by: Ben Dooks
    Cc: Wan ZongShun
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kukjin Kim
     
  • The alarm_irq_enable function should be implemented to support RTC alarm.
    And fix tabs instead of white space around the proc field.

    Signed-off-by: Changhwan Youn
    Signed-off-by: Kukjin Kim
    Acked-by: Ben Dooks
    Cc: Wan ZongShun
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Changhwan Youn
     
  • Current s3c_rtc_getalarm() sets missing field of alarm time with 0xff.
    But this value should be -1 according to drivers/rtc/interface.c.

    Signed-off-by: Changhwan Youn
    Signed-off-by: Kukjin Kim
    Acked-by: Ben Dooks
    Cc: Wan ZongShun
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Changhwan Youn
     
  • S3C2410_RTCCON of TYPE_S3C64XX RTC should be read/written by readw and
    writew, because TYPE_S3C64XX RTC uses bit 8 and 9. And TYPE_S3C2410 RTC
    also can access it by readw and writew.

    [atul.dahiya@samsung.com: tested on smdk2416]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Changhwan Youn
    Signed-off-by: Kukjin Kim
    Tested-by: Atul Dahiya
    Cc: Ben Dooks
    Cc: Wan ZongShun
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Changhwan Youn
     

23 Sep, 2010

1 commit

  • This change resolves a problem about unbalanced calls of
    enable_irq_wakeup() and disable_irq_wakeup() for alarm interrupt.

    Bug reproduction:

    root@eb600:~# echo 0 > /sys/class/rtc/rtc0/wakealarm

    WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0xe4()
    Unbalanced IRQ 46 wake disable
    Modules linked in:
    [] (unwind_backtrace+0x0/0xd8) from [] (warn_slowpath_common+0x44/0x5c)
    [] (warn_slowpath_common+0x44/0x5c) from [] (warn_slowpath_fmt+0x24/0x30)
    [] (warn_slowpath_fmt+0x24/0x30) from [] (set_irq_wake+0x7c/0xe4)
    [] (set_irq_wake+0x7c/0xe4) from [] (s3c_rtc_setalarm+0xa8/0xb8)
    [] (s3c_rtc_setalarm+0xa8/0xb8) from [] (rtc_set_alarm+0x60/0x74)
    [] (rtc_set_alarm+0x60/0x74) from [] (rtc_sysfs_set_wakealarm+0xc8/0xd8)
    [] (rtc_sysfs_set_wakealarm+0xc8/0xd8) from [] (dev_attr_store+0x20/0x24)
    [] (dev_attr_store+0x20/0x24) from [] (sysfs_write_file+0x104/0x13c)
    [] (sysfs_write_file+0x104/0x13c) from [] (vfs_write+0xb0/0x158)
    [] (vfs_write+0xb0/0x158) from [] (sys_write+0x3c/0x68)
    [] (sys_write+0x3c/0x68) from [] (ret_fast_syscall+0x0/0x28)

    Signed-off-by: Vladimir Zapolskiy
    Cc: Alessandro Zummo
    Cc: Ben Dooks
    Cc: Atul Dahiya
    Cc: Taekgyun Ko
    Cc: Kukjin Kim
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vladimir Zapolskiy
     

05 Aug, 2010

3 commits


05 Jun, 2010

2 commits


25 May, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

07 Jan, 2009

1 commit

  • Move the power of 2 check on frequencies down into individual rtc drivers

    This is to allow for non power of 2 real time clock periodic interrupts
    such as those on the pxa27x to be found in the new pxa27x-rtc driver

    Signed-off-by: Jonathan Cameron
    Signed-off-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonathan Cameron
     

03 Nov, 2008

1 commit


31 Oct, 2008

2 commits

  • tAdd adds device_init_wakeup() ivokation to probe function of
    s3c2410_rtc_driver. Without of this wakealarm sysfs attribute does not
    initialise.

    Signed-off-by: Yauhen Kharuzhy
    Acked-by: Ben Dooks
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yauhen Kharuzhy
     
  • Warnings was appeared when compile rtc-s3c.c because
    platform_driver structure s3c2410_rtcdrv has wrong name.

    Signed-off-by: Yauhen Kharuzhy
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yauhen Kharuzhy
     

30 Oct, 2008

1 commit


20 Oct, 2008

1 commit

  • Change drivers/rtc/ to use the new bcd2bin/bin2bcd functions instead of
    the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros.

    Signed-off-by: Adrian Bunk
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

07 Aug, 2008

2 commits


25 Jul, 2008

2 commits

  • The rtc-s3c.c driver has been using its own ioctl() handling to deal with
    alarm and periodic interrupts to handle what should now be done with the
    rtc core code.

    Change to using the .irq_set_freq and .irq_set_state driver entries and
    remove the .ioctl handling.

    Signed-off-by: Ben Dooks
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     
  • Add the relevant __devinit and __devexit attributes to the rtc-s3c driver.

    Signed-off-by: Ben Dooks
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     

22 May, 2008

2 commits

  • On ARM, asm/rtc.h only contains definitions for the predecessor to
    the RTC class support. RTC class drivers should not be including
    this include.

    Build tested on at91sam9rl and s3c2410 configurations.

    Acked-by: Alessandro Zummo
    Signed-off-by: Russell King

    Russell King
     
  • asm/mach/time.h is the ARM header file for setting up kernel ticker
    timekeeping (be that the old jiffy interrupt or the new clocksource.)
    RTC drivers have no business using this header file, and in fact do
    not require it.

    Build tested on at91sam9rl, omap and s3c2410 configurations.

    Acked-by: Alessandro Zummo
    Acked-by: Andrew Victor
    Signed-off-by: Russell King

    Russell King
     

28 Apr, 2008

1 commit


11 Apr, 2008

1 commit

  • Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
    prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable RTC
    platform drivers, to re-enable module auto loading.

    [dbrownell@users.sourceforge.net: more drivers, minor fix]
    Signed-off-by: Kay Sievers
    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kay Sievers
     

07 Feb, 2008

1 commit


30 Oct, 2007

1 commit


01 Aug, 2007

1 commit


09 May, 2007

2 commits

  • RTC class suspend/resume support, re-initializing the system clock on resume
    from the clock used to initialize it at boot time.

    - The reinit-on-resume is hooked to the existing RTC_HCTOSYS config
    option, on the grounds that a clock good enough for init must also
    be good enough for re-init.

    - Inlining a version of the code used by ARM, to save and restore the
    delta between a selected RTC and the current system wall-clock time.

    - Removes calls to that ARM code from AT91, OMAP1, and S3C RTCs. This
    means that systems using those RTCs across suspend/resume will likely
    want to change their kernel configs to enable RTC_HCTOSYS.

    If HCTOSYS isn't using a second RTC (with battery?), this changes the
    system's initial date from Jan 1970 to the epoch this hardware uses:
    1998 for AT91, 2000 for OMAP1 (assuming no split power mode), etc.

    This goes on top of the patch series removing "struct class_device" usage
    from the RTC framework. That's all needed for class suspend()/resume().

    Signed-off-by: David Brownell
    Acked-by: Greg Kroah-Hartman
    Acked-By: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     
  • This patch removes class_device from the programming interface that the RTC
    framework exposes to the rest of the kernel. Now an rtc_device is passed,
    which is more type-safe and streamlines all the relevant code.

    Signed-off-by: David Brownell
    Acked-by: Greg Kroah-Hartman
    Acked-By: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

15 Feb, 2007

1 commit

  • The obsolete SA_xxx interrupt flags have been used despite the scheduled
    removal. Fixup the remaining users.

    Signed-off-by: Thomas Gleixner
    Acked-by: Ingo Molnar
    Cc: "Luck, Tony"
    Cc: Roman Zippel
    Cc: Geert Uytterhoeven
    Cc: Jeff Garzik
    Cc: Wim Van Sebroeck
    Cc: Roland Dreier
    Cc: Alessandro Zummo
    Cc: James Bottomley
    Cc: Greg KH
    Cc: Dave Airlie
    Cc: James Simmons
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

14 Dec, 2006

1 commit

  • Fix a glitch in the procfs dumping of whether the alarm IRQ is enabled: use
    the traditional name (from drivers/char/rtc.c and many other places) of
    "alarm_IRQ", not "alrm_wakeup" (which didn't even match the efirtc code, which
    originated that reporting API).

    Also, update a few of the RTC drivers to stop providing that duplicate status,
    and/or to expose it properly when reporting the alarm state. We really don't
    want every RTC driver doing their own thing here...

    Signed-off-by: David Brownell
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

01 Oct, 2006

1 commit