Skip to content
Commits on Jul 19, 2012
  1. @gregkh

    Linux 3.4.6

    gregkh committed
  2. @gregkh

    NFC: Export nfc.h to userland

    Samuel Ortiz committed with gregkh
    commit dbd4fca upstream.
    
    The netlink commands and attributes, along with the socket structure
    definitions need to be exported.
    
    Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  3. @gregkh

    timekeeping: Add missing update call in timekeeping_resume()

    Thomas Gleixner committed with gregkh
    This is a backport of 3e99713
    
    The leap second rework unearthed another issue of inconsistent data.
    
    On timekeeping_resume() the timekeeper data is updated, but nothing
    calls timekeeping_update(), so now the update code in the timer
    interrupt sees stale values.
    
    This has been the case before those changes, but then the timer
    interrupt was using stale data as well so this went unnoticed for quite
    some time.
    
    Add the missing update call, so all the data is consistent everywhere.
    
    Reported-by: Andreas Schwab <schwab@linux-m68k.org>
    Reported-and-tested-by: "Rafael J. Wysocki" <rjw@sisk.pl>
    Reported-and-tested-by: Martin Steigerwald <Martin@lichtvoll.de>
    Cc: John Stultz <johnstul@us.ibm.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
    Cc: Prarit Bhargava <prarit@redhat.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  4. @gregkh

    hrtimer: Update hrtimer base offsets each hrtimer_interrupt

    John Stultz committed with gregkh
    This is a backport of 5baefd6
    
    The update of the hrtimer base offsets on all cpus cannot be made
    atomically from the timekeeper.lock held and interrupt disabled region
    as smp function calls are not allowed there.
    
    clock_was_set(), which enforces the update on all cpus, is called
    either from preemptible process context in case of do_settimeofday()
    or from the softirq context when the offset modification happened in
    the timer interrupt itself due to a leap second.
    
    In both cases there is a race window for an hrtimer interrupt between
    dropping timekeeper lock, enabling interrupts and clock_was_set()
    issuing the updates. Any interrupt which arrives in that window will
    see the new time but operate on stale offsets.
    
    So we need to make sure that an hrtimer interrupt always sees a
    consistent state of time and offsets.
    
    ktime_get_update_offsets() allows us to get the current monotonic time
    and update the per cpu hrtimer base offsets from hrtimer_interrupt()
    to capture a consistent state of monotonic time and the offsets. The
    function replaces the existing ktime_get() calls in hrtimer_interrupt().
    
    The overhead of the new function vs. ktime_get() is minimal as it just
    adds two store operations.
    
    This ensures that any changes to realtime or boottime offsets are
    noticed and stored into the per-cpu hrtimer base structures, prior to
    any hrtimer expiration and guarantees that timers are not expired early.
    
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Acked-by: Prarit Bhargava <prarit@redhat.com>
    Link: http://lkml.kernel.org/r/1341960205-56738-8-git-send-email-johnstul@us.ibm.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  5. @gregkh

    timekeeping: Provide hrtimer update function

    Thomas Gleixner committed with gregkh
    This is a backport of f6c06ab
    
    To finally fix the infamous leap second issue and other race windows
    caused by functions which change the offsets between the various time
    bases (CLOCK_MONOTONIC, CLOCK_REALTIME and CLOCK_BOOTTIME) we need a
    function which atomically gets the current monotonic time and updates
    the offsets of CLOCK_REALTIME and CLOCK_BOOTTIME with minimalistic
    overhead. The previous patch which provides ktime_t offsets allows us
    to make this function almost as cheap as ktime_get() which is going to
    be replaced in hrtimer_interrupt().
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Acked-by: Prarit Bhargava <prarit@redhat.com>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Link: http://lkml.kernel.org/r/1341960205-56738-7-git-send-email-johnstul@us.ibm.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  6. @gregkh

    hrtimers: Move lock held region in hrtimer_interrupt()

    Thomas Gleixner committed with gregkh
    This is a backport of 196951e
    
    We need to update the base offsets from this code and we need to do
    that under base->lock. Move the lock held region around the
    ktime_get() calls. The ktime_get() calls are going to be replaced with
    a function which gets the time and the offsets atomically.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Acked-by: Prarit Bhargava <prarit@redhat.com>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Link: http://lkml.kernel.org/r/1341960205-56738-6-git-send-email-johnstul@us.ibm.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  7. @gregkh

    timekeeping: Maintain ktime_t based offsets for hrtimers

    Thomas Gleixner committed with gregkh
    This is a backport of 5b9fe75
    
    We need to update the hrtimer clock offsets from the hrtimer interrupt
    context. To avoid conversions from timespec to ktime_t maintain a
    ktime_t based representation of those offsets in the timekeeper. This
    puts the conversion overhead into the code which updates the
    underlying offsets and provides fast accessible values in the hrtimer
    interrupt.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Acked-by: Prarit Bhargava <prarit@redhat.com>
    Link: http://lkml.kernel.org/r/1341960205-56738-4-git-send-email-johnstul@us.ibm.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  8. @gregkh

    timekeeping: Fix leapsecond triggered load spike issue

    John Stultz committed with gregkh
    This is a backport of 4873fa0
    
    The timekeeping code misses an update of the hrtimer subsystem after a
    leap second happened. Due to that timers based on CLOCK_REALTIME are
    either expiring a second early or late depending on whether a leap
    second has been inserted or deleted until an operation is initiated
    which causes that update. Unless the update happens by some other
    means this discrepancy between the timekeeping and the hrtimer data
    stays forever and timers are expired either early or late.
    
    The reported immediate workaround - $ data -s "`date`" - is causing a
    call to clock_was_set() which updates the hrtimer data structures.
    See: http://www.sheeri.com/content/mysql-and-leap-second-high-cpu-and-fix
    
    Add the missing clock_was_set() call to update_wall_time() in case of
    a leap second event. The actual update is deferred to softirq context
    as the necessary smp function call cannot be invoked from hard
    interrupt context.
    
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Reported-by: Jan Engelhardt <jengelh@inai.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Acked-by: Prarit Bhargava <prarit@redhat.com>
    Link: http://lkml.kernel.org/r/1341960205-56738-3-git-send-email-johnstul@us.ibm.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  9. @gregkh

    hrtimer: Provide clock_was_set_delayed()

    John Stultz committed with gregkh
    This is a backport of f55a6fa
    
    clock_was_set() cannot be called from hard interrupt context because
    it calls on_each_cpu().
    
    For fixing the widely reported leap seconds issue it is necessary to
    call it from hard interrupt context, i.e. the timer tick code, which
    does the timekeeping updates.
    
    Provide a new function which denotes it in the hrtimer cpu base
    structure of the cpu on which it is called and raise the hrtimer
    softirq. We then execute the clock_was_set() notificiation from
    softirq context in run_hrtimer_softirq(). The hrtimer softirq is
    rarely used, so polling the flag there is not a performance issue.
    
    [ tglx: Made it depend on CONFIG_HIGH_RES_TIMERS. We really should get
      rid of all this ifdeffery ASAP ]
    
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Reported-by: Jan Engelhardt <jengelh@inai.de>
    Reviewed-by: Ingo Molnar <mingo@kernel.org>
    Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Acked-by: Prarit Bhargava <prarit@redhat.com>
    Link: http://lkml.kernel.org/r/1341960205-56738-2-git-send-email-johnstul@us.ibm.com
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Stultz <johnstul@us.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  10. @gregkh

    cfg80211: check iface combinations only when iface is running

    Michal Kazior committed with gregkh
    commit f8cdddb upstream.
    
    Don't validate interface combinations on a stopped
    interface. Otherwise we might end up being able to
    create a new interface with a certain type, but
    won't be able to change an existing interface
    into that type.
    
    This also skips some other functions when
    interface is stopped and changing interface type.
    
    Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    [Fixes regression introduced by cherry pick of 463454b]
    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  11. @gregkh

    clk: Check parent for NULL in clk_change_rate

    Pawel Moll committed with gregkh
    commit bf47b4f upstream.
    
    clk_change_rate() is accessing parent's rate without checking
    if the parent exists at all. In case of root clocks this will
    cause NULL pointer dereference.
    
    This patch follows what clk_calc_new_rates() does in such
    situation.
    
    Signed-off-by: Pawel Moll <pawel.moll@arm.com>
    Signed-off-by: Mike Turquette <mturquette@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  12. @BlueDragonX @gregkh

    HID: add support for 2012 MacBook Pro Retina

    BlueDragonX committed with gregkh
    commit b2e6ad7 upstream.
    
    Add support for the 15'' MacBook Pro Retina. The keyboard is
    the same as recent models.
    
    The patch needs to be synchronized with the bcm5974 patch for
    the trackpad - as usual.
    
    Patch originally written by clipcarl (forums.opensuse.org).
    
    [rydberg@euromail.se: Amended mouse ignore lines]
    Signed-off-by: Ryan Bourgeois <bluedragonx@gmail.com>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    Acked-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  13. @yurikhan @gregkh

    Input: xpad - add Andamiro Pump It Up pad

    yurikhan committed with gregkh
    commit e76b8ee upstream.
    
    I couldn't find the vendor ID in any of the online databases, but this
    mat has a Pump It Up logo on the top side of the controller compartment,
    and a disclaimer stating that Andamiro will not be liable on the bottom.
    
    Signed-off-by: Yuri Khan <yurivkhan@gmail.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  14. @K900 @gregkh

    Input: xpad - add signature for Razer Onza Tournament Edition

    K900 committed with gregkh
    commit cc71a7e upstream.
    
    Signed-off-by: Ilia Katsnelson <k0009000@gmail.com>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  15. @yurikhan @gregkh

    Input: xpad - handle all variations of Mad Catz Beat Pad

    yurikhan committed with gregkh
    commit 3ffb62c upstream.
    
    The device should be handled by xpad driver instead of generic HID driver.
    
    Signed-off-by: Yuri Khan <yurivkhan@gmail.com>
    Acked-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  16. @rydberg @gregkh

    Input: bcm5974 - Add support for 2012 MacBook Pro Retina

    rydberg committed with gregkh
    commit 3dde22a upstream.
    
    Add support for the 15'' MacBook Pro Retina model (MacBookPro10,1).
    
    Patch originally written by clipcarl (forums.opensuse.org).
    
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  17. @ebiederm @gregkh

    bonding: Manage /proc/net/bonding/ entries from the netdev events

    ebiederm committed with gregkh
    commit a64d49c upstream.
    
    It was recently reported that moving a bonding device between network
    namespaces causes warnings from /proc.  It turns out after the move we
    were trying to add and to remove the /proc/net/bonding entries from the
    wrong network namespace.
    
    Move the bonding /proc registration code into the NETDEV_REGISTER and
    NETDEV_UNREGISTER events where the proc registration and unregistration
    will always happen at the right time.
    
    Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  18. @ebiederm @gregkh

    bonding: debugfs and network namespaces are incompatible

    ebiederm committed with gregkh
    commit 96ca7ff upstream.
    
    The bonding debugfs support has been broken in the presence of network
    namespaces since it has been added.  The debugfs support does not handle
    multiple bonding devices with the same name in different network
    namespaces.
    
    I haven't had any bug reports, and I'm not interested in getting any.
    Disable the debugfs support when network namespaces are enabled.
    
    Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  19. @gregkh

    stmmac: Fix for nfs hang on multiple reboot

    Deepak Sikri committed with gregkh
    commit 8e83989 upstream.
    
    It was observed that during multiple reboots nfs hangs. The status of
    receive descriptors shows that all the descriptors were in control of
    CPU, and none were assigned to DMA.
    Also the DMA status register confirmed that the Rx buffer is
    unavailable.
    
    This patch adds the fix for the same by adding the memory barriers to
    ascertain that the all instructions before enabling the Rx or Tx DMA are
    completed which involves the proper setting of the ownership bit in DMA
    descriptors.
    
    Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  20. @elp @gregkh

    mac80211: destroy assoc_data correctly if assoc fails

    elp committed with gregkh
    commit 10a9109 upstream.
    
    If association failed due to internal error (e.g. no
    supported rates IE), we call ieee80211_destroy_assoc_data()
    with assoc=true, while we actually reject the association.
    
    This results in the BSSID not being zeroed out.
    
    After passing assoc=false, we no longer have to call
    sta_info_destroy_addr() explicitly. While on it, move
    the "associated" message after the assoc_success check.
    
    Signed-off-by: Eliad Peller <eliad@wizery.com>
    Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  21. @studiofuga @gregkh

    rpmsg: fix dependency on initialization order

    studiofuga committed with gregkh
    commit 9634252 upstream.
    
    When rpmsg drivers are built into the kernel, they must not initialize
    before the rpmsg bus does, otherwise they'd trigger a BUG() in
    drivers/base/driver.c line 169 (driver_register()).
    
    To fix that, and to stop depending on arbitrary linkage ordering of
    those built-in rpmsg drivers, we make the rpmsg bus initialize at
    subsys_initcall.
    
    Signed-off-by: Federico Fuga <fuga@studiofuga.com>
    [ohad: rewrite the commit log]
    Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  22. @gregkh

    iwlegacy: don't mess up the SCD when removing a key

    Emmanuel Grumbach committed with gregkh
    commit b48d966 upstream.
    
    When we remove a key, we put a key index which was supposed
    to tell the fw that we are actually removing the key. But
    instead the fw took that index as a valid index and messed
    up the SRAM of the device.
    
    This memory corruption on the device mangled the data of
    the SCD. The impact on the user is that SCD queue 2 got
    stuck after having removed keys.
    
    Reported-by: Paul Bolle <pebolle@tiscali.nl>
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  23. @sgruszka @gregkh

    iwlegacy: always monitor for stuck queues

    sgruszka committed with gregkh
    commit c2ca7d9 upstream.
    
    This is iwlegacy version of:
    
    commit 342bbf3
    Author: Johannes Berg <johannes.berg@intel.com>
    Date:   Sun Mar 4 08:50:46 2012 -0800
    
        iwlwifi: always monitor for stuck queues
    
        If we only monitor while associated, the following
        can happen:
         - we're associated, and the queue stuck check
           runs, setting the queue "touch" time to X
         - we disassociate, stopping the monitoring,
           which leaves the time set to X
         - almost 2s later, we associate, and enqueue
           a frame
         - before the frame is transmitted, we monitor
           for stuck queues, and find the time set to
           X, although it is now later than X + 2000ms,
           so we decide that the queue is stuck and
           erroneously restart the device
    
    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  24. @gregkh

    e1000e: Correct link check logic for 82571 serdes

    Tushar Dave committed with gregkh
    commit d0efa8f upstream.
    
    SYNCH bit and IV bit of RXCW register are sticky. Before examining these bits,
    RXCW should be read twice to filter out one-time false events and have correct
    values for these bits. Incorrect values of these bits in link check logic can
    cause weird link stability issues if auto-negotiation fails.
    
    Reported-by: Dean Nelson <dnelson@redhat.com>
    Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
    Reviewed-by: Bruce Allan <bruce.w.allan@intel.com>
    Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  25. @sgruszka @gregkh

    rt2x00usb: fix indexes ordering on RX queue kick

    sgruszka committed with gregkh
    commit efd8211 upstream.
    
    On rt2x00_dmastart() we increase index specified by Q_INDEX and on
    rt2x00_dmadone() we increase index specified by Q_INDEX_DONE. So entries
    between Q_INDEX_DONE and Q_INDEX are those we currently process in the
    hardware. Entries between Q_INDEX and Q_INDEX_DONE are those we can
    submit to the hardware.
    
    According to that fix rt2x00usb_kick_queue(), as we need to submit RX
    entries that are not processed by the hardware. It worked before only
    for empty queue, otherwise was broken.
    
    Note that for TX queues indexes ordering are ok. We need to kick entries
    that have filled skb, but was not submitted to the hardware, i.e.
    started from Q_INDEX_DONE and have ENTRY_DATA_PENDING bit set.
    
    From practical standpoint this fixes RX queue stall, usually reproducible
    in AP mode, like for example reported here:
    https://bugzilla.redhat.com/show_bug.cgi?id=828824
    
    Reported-and-tested-by: Franco Miceli <fmiceli@plan.ceibal.edu.uy>
    Reported-and-tested-by: Tom Horsley <horsley1953@gmail.com>
    Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  26. @andersk @gregkh

    fifo: Do not restart open() if it already found a partner

    andersk committed with gregkh
    commit 05d290d upstream.
    
    If a parent and child process open the two ends of a fifo, and the
    child immediately exits, the parent may receive a SIGCHLD before its
    open() returns.  In that case, we need to make sure that open() will
    return successfully after the SIGCHLD handler returns, instead of
    throwing EINTR or being restarted.  Otherwise, the restarted open()
    would incorrectly wait for a second partner on the other end.
    
    The following test demonstrates the EINTR that was wrongly thrown from
    the parent’s open().  Change .sa_flags = 0 to .sa_flags = SA_RESTART
    to see a deadlock instead, in which the restarted open() waits for a
    second reader that will never come.  (On my systems, this happens
    pretty reliably within about 5 to 500 iterations.  Others report that
    it manages to loop ~forever sometimes; YMMV.)
    
      #include <sys/stat.h>
      #include <sys/types.h>
      #include <sys/wait.h>
      #include <fcntl.h>
      #include <signal.h>
      #include <stdio.h>
      #include <stdlib.h>
      #include <unistd.h>
    
      #define CHECK(x) do if ((x) == -1) {perror(#x); abort();} while(0)
    
      void handler(int signum) {}
    
      int main()
      {
          struct sigaction act = {.sa_handler = handler, .sa_flags = 0};
          CHECK(sigaction(SIGCHLD, &act, NULL));
          CHECK(mknod("fifo", S_IFIFO | S_IRWXU, 0));
          for (;;) {
              int fd;
              pid_t pid;
              putc('.', stderr);
              CHECK(pid = fork());
              if (pid == 0) {
                  CHECK(fd = open("fifo", O_RDONLY));
                  _exit(0);
              }
              CHECK(fd = open("fifo", O_WRONLY));
              CHECK(close(fd));
              CHECK(waitpid(pid, NULL, 0));
          }
      }
    
    This is what I suspect was causing the Git test suite to fail in
    t9010-svn-fe.sh:
    
    	http://bugs.debian.org/678852
    
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>
    Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  27. @tiwai @gregkh

    intel_ips: blacklist HP ProBook laptops

    tiwai committed with gregkh
    commit 88ca518 upstream.
    
    intel_ips driver spews the warning message
      "ME failed to update for more than 1s, likely hung"
    at each second endlessly on HP ProBook laptops with IronLake.
    
    As this has never worked, better to blacklist the driver for now.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Matthew Garrett <mjg@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  28. @gregkh

    sched/nohz: Rewrite and fix load-avg computation -- again

    Peter Zijlstra committed with gregkh
    commit 5167e8d upstream.
    
    Thanks to Charles Wang for spotting the defects in the current code:
    
     - If we go idle during the sample window -- after sampling, we get a
       negative bias because we can negate our own sample.
    
     - If we wake up during the sample window we get a positive bias
       because we push the sample to a known active period.
    
    So rewrite the entire nohz load-avg muck once again, now adding
    copious documentation to the code.
    
    Reported-and-tested-by: Doug Smythies <dsmythies@telus.net>
    Reported-and-tested-by: Charles Wang <muming.wq@gmail.com>
    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Link: http://lkml.kernel.org/r/1340373782.18025.74.camel@twins
    [ minor edits ]
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  29. @watologo1 @gregkh

    cpufreq / ACPI: Fix not loading acpi-cpufreq driver regression

    watologo1 committed with gregkh
    commit c4686c7 upstream.
    
    Commit d640113 introduced a regression on SMP
    systems where the processor core with ACPI id zero is disabled
    (typically should be the case because of hyperthreading).
    The regression got spread through stable kernels.
    On 3.0.X it got introduced via 3.0.18.
    
    Such platforms may be rare, but do exist.
    Look out for a disabled processor with acpi_id 0 in dmesg:
    ACPI: LAPIC (acpi_id[0x00] lapic_id[0x10] disabled)
    
    This problem has been observed on a:
    HP Proliant BL280c G6 blade
    
    This patch restricts the introduced workaround to platforms
    with nr_cpu_ids <= 1.
    
    Signed-off-by: Thomas Renninger <trenn@suse.de>
    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  30. @acpibob @gregkh

    ACPICA: Fix possible fault in return package object repair code

    acpibob committed with gregkh
    commit 46befd6 upstream.
    
    Fixes a problem that can occur when a lone package object is
    wrapped with an outer package object in order to conform to
    the ACPI specification. Can affect these predefined names:
    _ALR,_MLS,_PSS,_TRT,_TSS,_PRT,_HPX,_DLM,_CSD,_PSD,_TSD
    
    https://bugzilla.kernel.org/show_bug.cgi?id=44171
    
    This problem was introduced in 3.4-rc1 by commit
    6a99b1c
    (ACPICA: Object repair code: Support to add Package wrappers)
    
    Reported-by: Vlastimil Babka <caster@gentoo.org>
    Signed-off-by: Bob Moore <robert.moore@intel.com>
    Signed-off-by: Lin Ming <ming.m.lin@intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  31. @toddpoynor @gregkh

    ARM: SAMSUNG: fix race in s3c_adc_start for ADC

    toddpoynor committed with gregkh
    commit 8265981 upstream.
    
    Checking for adc->ts_pend already claimed should be done with the
    lock held.
    
    Signed-off-by: Todd Poynor <toddpoynor@google.com>
    Acked-by: Ben Dooks <ben-linux@fluff.org>
    Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  32. @neilbrown @gregkh

    md/raid1: fix use-after-free bug in RAID1 data-check code.

    neilbrown committed with gregkh
    commit 2d4f4f3 upstream.
    
    This bug has been present ever since data-check was introduce
    in 2.6.16.  However it would only fire if a data-check were
    done on a degraded array, which was only possible if the array
    has 3 or more devices.  This is certainly possible, but is quite
    uncommon.
    
    Since hot-replace was added in 3.3 it can happen more often as
    the same condition can arise if not all possible replacements are
    present.
    
    The problem is that as soon as we submit the last read request, the
    'r1_bio' structure could be freed at any time, so we really should
    stop looking at it.  If the last device is being read from we will
    stop looking at it.  However if the last device is not due to be read
    from, we will still check the bio pointer in the r1_bio, but the
    r1_bio might already be free.
    
    So use the read_targets counter to make sure we stop looking for bios
    to submit as soon as we have submitted them all.
    
    This fix is suitable for any -stable kernel since 2.6.16.
    
    Reported-by: Arnold Schulz <arnysch@gmx.net>
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  33. @gregkh

    mtd: nandsim: don't open code a do_div helper

    Herton Ronaldo Krzesinski committed with gregkh
    commit 596fd46 upstream.
    
    We don't need to open code the divide function, just use div_u64 that
    already exists and do the same job. While this is a straightforward
    clean up, there is more to that, the real motivation for this.
    
    While building on a cross compiling environment in armel, using gcc
    4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5), I was getting the following build
    error:
    
    ERROR: "__aeabi_uldivmod" [drivers/mtd/nand/nandsim.ko] undefined!
    
    After investigating with objdump and hand built assembly version
    generated with the compiler, I narrowed __aeabi_uldivmod as being
    generated from the divide function. When nandsim.c is built with
    -fno-inline-functions-called-once, that happens when
    CONFIG_DEBUG_SECTION_MISMATCH is enabled, the do_div optimization in
    arch/arm/include/asm/div64.h doesn't work as expected with the open
    coded divide function: even if the do_div we are using doesn't have a
    constant divisor, the compiler still includes the else parts of the
    optimized do_div macro, and translates the divisions there to use
    __aeabi_uldivmod, instead of only calling __do_div_asm -> __do_div64 and
    optimizing/removing everything else out.
    
    So to reproduce, gcc 4.6 plus CONFIG_DEBUG_SECTION_MISMATCH=y and
    CONFIG_MTD_NAND_NANDSIM=m should do it, building on armel.
    
    After this change, the compiler does the intended thing even with
    -fno-inline-functions-called-once, and optimizes out as expected the
    constant handling in the optimized do_div on arm. As this also avoids a
    build issue, I'm marking for Stable, as I think is applicable for this
    case.
    
    Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
    Acked-by: Nicolas Pitre <nico@linaro.org>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  34. @gregkh

    media: dvb-core: Release semaphore on error path dvb_register_device()

    Santosh Nayak committed with gregkh
    commit 82163ed upstream.
    
    There is a missing "up_write()" here. Semaphore should be released
    before returning error value.
    
    Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  35. @JeffMoyer @gregkh

    block: fix infinite loop in __getblk_slow

    JeffMoyer committed with gregkh
    commit 91f68c8 upstream.
    
    Commit 080399a ("block: don't mark buffers beyond end of disk as
    mapped") exposed a bug in __getblk_slow that causes mount to hang as it
    loops infinitely waiting for a buffer that lies beyond the end of the
    disk to become uptodate.
    
    The problem was initially reported by Torsten Hilbrich here:
    
        https://lkml.org/lkml/2012/6/18/54
    
    and also reported independently here:
    
        http://www.sysresccd.org/forums/viewtopic.php?f=13&t=4511
    
    and then Richard W.M.  Jones and Marcos Mello noted a few separate
    bugzillas also associated with the same issue.  This patch has been
    confirmed to fix:
    
        https://bugzilla.redhat.com/show_bug.cgi?id=835019
    
    The main problem is here, in __getblk_slow:
    
            for (;;) {
                    struct buffer_head * bh;
                    int ret;
    
                    bh = __find_get_block(bdev, block, size);
                    if (bh)
                            return bh;
    
                    ret = grow_buffers(bdev, block, size);
                    if (ret < 0)
                            return NULL;
                    if (ret == 0)
                            free_more_memory();
            }
    
    __find_get_block does not find the block, since it will not be marked as
    mapped, and so grow_buffers is called to fill in the buffers for the
    associated page.  I believe the for (;;) loop is there primarily to
    retry in the case of memory pressure keeping grow_buffers from
    succeeding.  However, we also continue to loop for other cases, like the
    block lying beond the end of the disk.  So, the fix I came up with is to
    only loop when grow_buffers fails due to memory allocation issues
    (return value of 0).
    
    The attached patch was tested by myself, Torsten, and Rich, and was
    found to resolve the problem in call cases.
    
    Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
    Reported-and-Tested-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
    Tested-by: Richard W.M. Jones <rjones@redhat.com>
    Reviewed-by: Josh Boyer <jwboyer@redhat.com>
    [ Jens is on vacation, taking this directly  - Linus ]
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Something went wrong with that request. Please try again.