20 May, 2016

1 commit

  • Many drivers are defining a DRV_VERSION. This is often only used for
    MODULE_VERSION and sometimes to print an info message at probe time. This
    is kind of pointless as they are all versionned with the kernel anyway.
    Also the core will print a message when a new rtc is found.

    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

05 Sep, 2015

1 commit


20 Oct, 2014

1 commit


04 Apr, 2014

2 commits

  • The patch "rtc: verify a critical argument to rtc_update_irq() before
    using it" introduces validation for rtc_device in the RTC core, so there
    are no need to check this argument for rtc_update_irq() from the
    drivers.

    This patch removes such check for the existing rtc_update_irq() users.

    Signed-off-by: Alexander Shiyan
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Shiyan
     
  • RTC drivers must not return an error after device registration.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Alessandro Zummo
    Reported-by: Ales Novak
    Cc: Alexander Shiyan
    Cc: Atsushi Nemoto
    Cc: Jiri Kosina
    Cc: Srikanth Srinivasan
    Cc: Lee Jones
    Cc: Sascha Hauer
    Cc: Joonsoo Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alessandro Zummo
     

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
     

30 Apr, 2013

1 commit


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
     

24 Mar, 2012

1 commit

  • Since commit e58aa3d2d0cc ("genirq: run irq handlers with interrupts
    disabled") we run all interrupt handlers with interrupts disabled and we
    even check and yell when an interrupt handler returns with interrupts
    enabled - see commit b738a50a2026 ("genirq: warn when handler enables
    interrupts").

    So now this flag is a NOOP and can be removed.

    Signed-off-by: Yong Zhang
    Acked-by: Linus Walleij
    Acked-by: Wan ZongShun
    Cc: Alessandro Zummo
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yong Zhang
     

11 Jan, 2012

1 commit

  • This patch converts the drivers in drivers/rtc/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Acked-by: Mike Frysinger
    Acked-by: Guan Xuetao
    Acked-by: Linus Walleij
    Acked-by: Haojian Zhuang
    Cc: Alessandro Zummo
    Cc: Srinidhi Kasagar
    Cc: Lars-Peter Clausen
    Cc: Ben Dooks
    Cc: John Stultz
    Acked-by: Jean-Christophe PLAGNIOL-VILLARD
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     

01 Nov, 2011

1 commit


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
     

22 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
     

16 Dec, 2009

2 commits

  • The to_platform_device macro itself uses container_of macro. Nested use
    of container_of macro causes following sparse warnings:

    rtc-ds1553.c:259:3: warning: symbol '__mptr' shadows an earlier one
    rtc-ds1553.c:259:3: originally declared here

    Signed-off-by: Atsushi Nemoto
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: Andrew Sharp
    Cc: Thomas Hommel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     
  • * Call dev_set_drvdata before rtc device creation
    * Use its own spinlock instead of rtc->irq_lock
    * Check pdata->rtc before calling rtc_update_irq
    * Use {alarm,update}_irq_enable and remove ioctl routine
    * Use devres APIs and simplify error/remove path

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

    Atsushi Nemoto
     

19 Jun, 2009

1 commit

  • IRQF_SHARED should not be used with IRQF_DISABLED. There is no in-tree
    user of this driver and only out-of-tree user I know uses a dedicated irq
    line for this RTC.

    Signed-off-by: Atsushi Nemoto
    Cc: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

07 Jan, 2009

1 commit

  • This patch fixes a bunch of irq checking misuses. Most drivers were
    getting irq via platform_get_irq(), which returns -ENXIO or r->start.

    rtc-cmos.c is special. It is using PNP and platform bindings. Hopefully
    nobody is using PNP IRQ 0 for RTC. So the changes should be safe.

    rtc-sh.c is using platform_get_irq, but was storing a result into an
    unsigned type, then was checking for < 0. This is fixed now.

    Signed-off-by: Anton Vorontsov
    Cc: Alessandro Zummo
    Acked-by: David Brownell
    Acked-by: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

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
     

17 Oct, 2008

1 commit

  • Make the rtc framework consistent about disabling 1/second update IRQs
    that may have been activated through the /dev interface, when that /dev
    file is closed. (It may have closed because of coredump, etc.) This was
    previously done only for emulated update IRQs ... now, do it always.

    Also comment the current policy: repeating IRQs (periodic, update) that
    userspace enabled will be cleanly disabled, but alarms are left alone.
    Such repeating IRQs are a constant and pointless system load.

    Update some RTC drivers to remove now-needless release() methods. Most
    such methods just enforce that policy. The others all seem to be buggy,
    and mistreat in-kernel clients of periodic or alarm IRQs.

    Signed-off-by: David Brownell
    Acked-by: Andrew Sharp
    Cc: Angelo Castello
    Acked-by: Atsushi Nemoto
    Acked-by: Paul Mundt
    Cc: Thomas Hommel
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

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
     

15 Nov, 2007

1 commit

  • Several of the RTC drivers are exporting binary "nvram" files in sysfs. Such
    NVRAM (or on many systems, EEPROM) data is often initialized during system
    manufacture to hold data about identity (serial numbers, Ethernet addresses,
    etc), configuration, calibration, and so forth.

    This patch improves integrity and security of those files:

    - Correctly initializes the size in one of the two cases where
    that was not yet being done.

    - Improves system security/integrity by making this state not
    be world-writable by default.

    Letting arbitrary userspace code mangle such state by default is at least Not
    A Good Thing; and it could sometimes be worse, depending on the particular
    data that might be corrupted. (I disregard the paranoiac "don't let anyone
    read it either" approach. Anyone storing passwords in such memory doesn't
    really care about security.)

    Signed-off-by: David Brownell
    Acked-by: Atsushi Nemoto
    Cc: Torsten Ertbjerg Rasmussen
    Cc: Mark Zhan
    Cc: Thomas Hommel
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

17 Oct, 2007

1 commit

  • The rtc-ds1553 platform driver name doesn't match its module name, which
    might prevent it from properly hotplugging. This driver has no in-tree
    users.

    Signed-off-by: Atsushi Nemoto
    Cc: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

20 Sep, 2007

1 commit


22 Jul, 2007

1 commit

  • This patch fixes these sparse warnings:

    drivers/rtc/rtc-ds1742.c:265:2: warning: returning void-valued expression
    drivers/rtc/rtc-ds1553.c:409:2: warning: returning void-valued expression

    Signed-off-by: Atsushi Nemoto
    Cc: David Brownell
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

12 Jul, 2007

2 commits

  • Well, first of all, I don't want to change so many files either.

    What I do:
    Adding a new parameter "struct bin_attribute *" in the
    .read/.write methods for the sysfs binary attributes.

    In fact, only the four lines change in fs/sysfs/bin.c and
    include/linux/sysfs.h do the real work.
    But I have to update all the files that use binary attributes
    to make them compatible with the new .read and .write methods.
    I'm not sure if I missed any. :(

    Why I do this:
    For a sysfs attribute, we can get a pointer pointing to the
    struct attribute in the .show/.store method,
    while we can't do this for the binary attributes.
    I don't know why this is different, but this does make it not
    so handy to use the binary attributes as the regular ones.
    So I think this patch is reasonable. :)

    Who benefits from it:
    The patch that exposes ACPI tables in sysfs
    requires such an improvement.
    All the table binary attributes share the same .read method.
    Parameter "struct bin_attribute *" is used to get
    the table signature and instance number which are used to
    distinguish different ACPI table binary attributes.

    Without this parameter, we need to offer different .read methods
    for different ACPI table binary attributes.
    This is impossible as there are various ACPI tables on different
    platforms, and we don't know what they are until they are loaded.

    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Zhang Rui
     
  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

09 May, 2007

1 commit

  • 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
     

13 Feb, 2007

1 commit

  • Change __init to __devinit in rtc drivers' probe functions.

    Resolves MODPOST warnings:

    WARNING: drivers/rtc/rtc-ds1553.o - Section mismatch: reference to
    .init.text:ds1553_rtc_probe from .data.rel between 'ds1553_rtc_driver' (at
    offset 0x0) and 'ds1553_nvram_attr'
    WARNING: drivers/rtc/rtc-ds1742.o - Section mismatch: reference to
    .init.text:ds1742_rtc_probe from .data.rel between 'ds1742_rtc_driver' (at
    offset 0x0) and 'ds1742_nvram_attr'

    Signed-off-by: Prarit Bhargava
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Prarit Bhargava
     

26 Nov, 2006

1 commit

  • I got a lockdep warning when running "rtctest" so I though it'd be good
    to see what was up.

    - The warning was for rtc->irq_task_lock, gotten from rtc_update_irq()
    by irq handlerss ... but in a handful of other cases, grabbed without
    blocking IRQs.

    - Some callers to rtc_update_irq() were not ensuring IRQs were blocked,
    yet the routine expects that; make sure all callers block IRQs.

    It would appear that RTC API tests haven't been part of anyone's kernel
    regression test suite recently, at least not with lockdep running.

    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

2 commits


03 Jul, 2006

1 commit


28 Jun, 2006

1 commit


26 Jun, 2006

1 commit