Skip to content
Commits on Jul 19, 2012
  1. Revert "sched/nohz: Rewrite and fix load-avg computation -- again"

    This reverts commit 7490d0a as it
    breaks BFS.
    Oleksandr Natalenko committed Jul 20, 2012
  2. Merge branch 'distro-3.4' into pf-3.4

    Oleksandr Natalenko committed Jul 19, 2012
  3. Merge branch 'version-3.4' into pf-3.4

    Oleksandr Natalenko committed Jul 19, 2012
  4. distro-3.4: bump to v3.4.6-pf

    Oleksandr Natalenko committed Jul 19, 2012
  5. version-3.4: bump to v3.4.6-pf

    Oleksandr Natalenko committed Jul 19, 2012
  6. Merge branch 'layer7-3.4' into pf-3.4

    Oleksandr Natalenko committed Jul 19, 2012
  7. layer7-3.4: enable connection flow accounting, otherwise connbytes an…

    …d layer7 will fail
    Oleksandr Natalenko committed Jul 19, 2012
  8. fix merge conflict

    Oleksandr Natalenko committed Jul 19, 2012
  9. @gregkh

    Linux 3.4.6

    gregkh committed Jul 19, 2012
  10. @sameo @gregkh

    NFC: Export nfc.h to userland

    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>
    sameo committed with gregkh May 10, 2012
  11. @gregkh

    timekeeping: Add missing update call in timekeeping_resume()

    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>
    Thomas Gleixner committed with gregkh Jul 17, 2012
  12. @gregkh

    hrtimer: Update hrtimer base offsets each hrtimer_interrupt

    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>
    John Stultz committed with gregkh Jul 17, 2012
  13. @gregkh

    timekeeping: Provide hrtimer update function

    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>
    Thomas Gleixner committed with gregkh Jul 17, 2012
  14. @gregkh

    hrtimers: Move lock held region in hrtimer_interrupt()

    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>
    Thomas Gleixner committed with gregkh Jul 17, 2012
  15. @gregkh

    timekeeping: Maintain ktime_t based offsets for hrtimers

    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>
    Thomas Gleixner committed with gregkh Jul 17, 2012
  16. @gregkh

    timekeeping: Fix leapsecond triggered load spike issue

    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>
    John Stultz committed with gregkh Jul 17, 2012
  17. @gregkh

    hrtimer: Provide clock_was_set_delayed()

    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>
    John Stultz committed with gregkh Jul 17, 2012
  18. @gregkh

    cfg80211: check iface combinations only when iface is running

    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>
    Michal Kazior committed with gregkh Jun 8, 2012
  19. @gregkh

    clk: Check parent for NULL in clk_change_rate

    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>
    Pawel Moll committed with gregkh Jun 8, 2012
  20. @BlueDragonX @gregkh

    HID: add support for 2012 MacBook Pro Retina

    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>
    BlueDragonX committed with gregkh Jul 10, 2012
  21. @yurikhan @gregkh

    Input: xpad - add Andamiro Pump It Up pad

    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>
    yurikhan committed with gregkh Jul 11, 2012
  22. @K900 @gregkh

    Input: xpad - add signature for Razer Onza Tournament Edition

    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>
    K900 committed with gregkh Jul 11, 2012
  23. @yurikhan @gregkh

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

    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>
    yurikhan committed with gregkh Jul 11, 2012
  24. @rydberg @gregkh

    Input: bcm5974 - Add support for 2012 MacBook Pro Retina

    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>
    rydberg committed with gregkh Jul 10, 2012
  25. @ebiederm @gregkh

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

    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>
    ebiederm committed with gregkh Jul 9, 2012
  26. @ebiederm @gregkh

    bonding: debugfs and network namespaces are incompatible

    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>
    ebiederm committed with gregkh Jul 9, 2012
  27. @gregkh

    stmmac: Fix for nfs hang on multiple reboot

    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>
    Deepak Sikri committed with gregkh Jul 8, 2012
  28. @elp @gregkh

    mac80211: destroy assoc_data correctly if assoc fails

    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>
    elp committed with gregkh Jul 2, 2012
  29. @studiofuga @gregkh

    rpmsg: fix dependency on initialization order

    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>
    studiofuga committed with gregkh Jul 16, 2012
  30. @gregkh

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

    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>
    Emmanuel Grumbach committed with gregkh Jul 4, 2012
  31. @sgruszka @gregkh

    iwlegacy: always monitor for stuck queues

    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>
    sgruszka committed with gregkh Jul 4, 2012
  32. @gregkh

    e1000e: Correct link check logic for 82571 serdes

    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>
    Tushar Dave committed with gregkh Jul 12, 2012
  33. @sgruszka @gregkh

    rt2x00usb: fix indexes ordering on RX queue kick

    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>
    sgruszka committed with gregkh Jul 4, 2012
  34. @andersk @gregkh

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

    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>
    andersk committed with gregkh Jul 15, 2012
Something went wrong with that request. Please try again.