17 May, 2011

1 commit

  • The first cpu which switches from periodic to oneshot mode switches
    also the broadcast device into oneshot mode. The broadcast device
    serves as a backup for per cpu timers which stop in deeper
    C-states. To avoid starvation of the cpus which might be in idle and
    depend on broadcast mode it marks the other cpus as broadcast active
    and sets the brodcast expiry value of those cpus to the next tick.

    The oneshot mode broadcast bit for the other cpus is sticky and gets
    only cleared when those cpus exit idle. If a cpu was not idle while
    the bit got set in consequence the bit prevents that the broadcast
    device is armed on behalf of that cpu when it enters idle for the
    first time after it switched to oneshot mode.

    In most cases that goes unnoticed as one of the other cpus has usually
    a timer pending which keeps the broadcast device armed with a short
    timeout. Now if the only cpu which has a short timer active has the
    bit set then the broadcast device will not be armed on behalf of that
    cpu and will fire way after the expected timer expiry. In the case of
    Christians bug report it took ~145 seconds which is about half of the
    wrap around time of HPET (the limit for that device) due to the fact
    that all other cpus had no timers armed which expired before the 145
    seconds timeframe.

    The solution is simply to clear the broadcast active bit
    unconditionally when a cpu switches to oneshot mode after the first
    cpu switched the broadcast device over. It's not idle at that point
    otherwise it would not be executing that code.

    [ I fundamentally hate that broadcast crap. Why the heck thought some
    folks that when going into deep idle it's a brilliant concept to
    switch off the last device which brings the cpu back from that
    state? ]

    Thanks to Christian for providing all the valuable debug information!

    Reported-and-tested-by: Christian Hoffmann
    Cc: John Stultz
    Link: http://lkml.kernel.org/r/%3Calpine.LFD.2.02.1105161105170.3078%40ionos%3E
    Cc: stable@kernel.org
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

12 May, 2011

1 commit


07 May, 2011

11 commits

  • Since commit f44f7f9 (RTC: Initialize kernel state from RTC)
    rtc_device_register reads the programmed alarm. As reading the alarm
    needs to take the mc13xxx lock, release it before calling
    rtc_device_register.

    This fixes a deadlock during boot:

    INFO: task swapper:1 blocked for more than 120 seconds.
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    swapper D c02b175c 0 1 0 0x00000000
    [] (schedule+0x304/0x4f4) from [] (__mutex_lock_slowpath+0x7c/0x110)
    [] (__mutex_lock_slowpath+0x7c/0x110) from [] (mc13xxx_rtc_read_time+0x1c/0x118)
    [] (mc13xxx_rtc_read_time+0x1c/0x118) from [] (__rtc_read_time+0x58/0x5c)
    [] (__rtc_read_time+0x58/0x5c) from [] (rtc_read_time+0x30/0x48)
    [] (rtc_read_time+0x30/0x48) from [] (__rtc_read_alarm+0x1c/0x290)
    [] (__rtc_read_alarm+0x1c/0x290) from [] (rtc_device_register+0x150/0x27c)
    [] (rtc_device_register+0x150/0x27c) from [] (mc13xxx_rtc_probe+0x128/0x17c)
    [] (mc13xxx_rtc_probe+0x128/0x17c) from [] (platform_drv_probe+0x1c/0x24)
    [] (platform_drv_probe+0x1c/0x24) from [] (driver_probe_device+0x80/0x1a8)
    [] (driver_probe_device+0x80/0x1a8) from [] (__driver_attach+0x8c/0x90)
    [] (__driver_attach+0x8c/0x90) from [] (bus_for_each_dev+0x60/0x8c)
    [] (bus_for_each_dev+0x60/0x8c) from [] (bus_add_driver+0x180/0x248)
    [] (bus_add_driver+0x180/0x248) from [] (driver_register+0x70/0x15c)
    [] (driver_register+0x70/0x15c) from [] (platform_driver_probe+0x18/0x98)
    [] (platform_driver_probe+0x18/0x98) from [] (do_one_initcall+0x2c/0x168)
    [] (do_one_initcall+0x2c/0x168) from [] (kernel_init+0xa0/0x150)
    [] (kernel_init+0xa0/0x150) from [] (kernel_thread_exit+0x0/0x8)

    Reported-by: Vagrant Cascadian
    Signed-off-by: Uwe Kleine-König
    Closes: http://bugs.debian.org/625804
    [Tweaked commit log -jstultz]
    Signed-off-by: John Stultz

    Uwe Kleine-König
     
  • 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: Wolfram Sang
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     
  • 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: Wolfram Sang
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     
  • 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: Wolfram Sang
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     
  • 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: Wolfram Sang
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     
  • 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: Wolfram Sang
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     
  • 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 clientdata.

    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 clientdata is initialized prior to registering
    the rtc device.

    CC: Wolfram Sang
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     
  • 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: Wolfram Sang
    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     
  • 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
     
  • 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
     
  • 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
     

05 May, 2011

9 commits

  • Christian Hoffmann reported that the command line clocksource override
    with acpi_pm timer fails:

    Kernel command line: clocksource=acpi_pm
    hpet clockevent registered
    Switching to clocksource hpet
    Override clocksource acpi_pm is not HRT compatible.
    Cannot switch while in HRT/NOHZ mode.

    The watchdog code is what enables CLOCK_SOURCE_VALID_FOR_HRES, but we
    actually end up selecting the clocksource before we enqueue it into
    the watchdog list, so that's why we see the warning and fail to switch
    to acpi_pm timer as requested. That's particularly bad when we want to
    debug timekeeping related problems in early boot.

    Put the selection call last.

    Reported-by: Christian Hoffmann
    Signed-off-by: John Stultz
    Cc: stable@kernel.org # 32...
    Link: http://lkml.kernel.org/r/%3C1304558210.2943.24.camel%40work-vm%3E
    Signed-off-by: Thomas Gleixner

    john stultz
     
  • * 'staging-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6:
    staging: Remove a warning for drivers/staging/wlan-ng/cfg80211.c
    staging: intel_sst: intelmid needs delay.h
    staging: solo6x10: add select SND_PCM to fix build error
    staging: usbip: vhci: fix oops on subsequent attach
    staging: ft1000: Remove unnecessary EXPORT_SYMBOLs
    staging: rts_pstor: use #ifdef instead of #if
    staging: rts_pstor: Add
    staging: gma500: Depend on X86
    staging: olpc: Add

    Linus Torvalds
     
  • * 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
    xHCI: Clear PLC in xhci_bus_resume()
    USB: fix regression in usbip by setting has_tt flag
    usb/isp1760: Report correct urb status after unlink
    omap:usb: add regulator support for EHCI
    mfd: Fix usbhs_enable error handling
    usb: musb: gadget: Fix out-of-sync runtime pm calls
    usb: musb: omap2430: Fix retention idle on musb peripheral only boards

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
    ceph: do not call __mark_dirty_inode under i_lock
    libceph: fix ceph_osdc_alloc_request error checks
    ceph: handle ceph_osdc_new_request failure in ceph_writepages_start
    libceph: fix ceph_msg_new error path
    ceph: use ihold() when i_lock is held

    Linus Torvalds
     
  • * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
    [media] ngene: Fix CI data transfer regression Fix CI data transfer regression introduced by previous cleanup.
    [media] v4l: make sure drivers supply a zeroed struct v4l2_subdev
    [media] Missing frontend config for LME DM04/QQBOX
    [media] rc_core: avoid kernel oops when rmmod saa7134
    [media] imon: add conditional locking in change_protocol
    [media] rc: show RC_TYPE_OTHER in sysfs
    [media] ite-cir: modular build on ppc requires delay.h include
    [media] mceusb: add Dell transceiver ID

    Linus Torvalds
     
  • * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
    firewire: Fix for broken configrom updates in quick succession

    Linus Torvalds
     
  • …s/security-testing-2.6

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
    flex_arrays: allow zero length flex arrays
    flex_array: flex_array_prealloc takes a number of elements, not an end
    SELinux: pass last path component in may_create

    Linus Torvalds
     
  • The SLUB allocator use of the cmpxchg_double logic was wrong: it
    actually needs the irq-safe one.

    That happens automatically when we use the native unlocked 'cmpxchg8b'
    instruction, but when compiling the kernel for older x86 CPUs that do
    not support that instruction, we fall back to the generic emulation
    code.

    And if you don't specify that you want the irq-safe version, the generic
    code ends up just open-coding the cmpxchg8b equivalent without any
    protection against interrupts or preemption. Which definitely doesn't
    work for SLUB.

    This was reported by Werner Landgraf , who saw
    instability with his distro-kernel that was compiled to support pretty
    much everything under the sun. Most big Linux distributions tend to
    compile for PPro and later, and would never have noticed this problem.

    This also fixes the prototypes for the irqsafe cmpxchg_double functions
    to use 'bool' like they should.

    [ Btw, that whole "generic code defaults to no protection" design just
    sounds stupid - if the code needs no protection, there is no reason to
    use "cmpxchg_double" to begin with. So we should probably just remove
    the unprotected version entirely as pointless. - Linus ]

    Signed-off-by: Thomas Gleixner
    Reported-and-tested-by: werner
    Acked-and-tested-by: Ingo Molnar
    Acked-by: Christoph Lameter
    Cc: Pekka Enberg
    Cc: Jens Axboe
    Cc: Tejun Heo
    Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1105041539050.3005@ionos
    Signed-off-by: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     
  • The __mark_dirty_inode helper now takes i_lock as of 250df6ed. Fix the
    one ceph callers that held i_lock (__ceph_mark_dirty_caps) to return the
    flags value so that the callers can do it outside of i_lock.

    Signed-off-by: Sage Weil

    Sage Weil
     

04 May, 2011

17 commits


03 May, 2011

1 commit