14 Aug, 2014

18 commits

  • Greg Kroah-Hartman
     
  • [ Upstream commit 093758e3daede29cb4ce6aedb111becf9d4bfc57 ]

    This commit is a guesswork, but it seems to make sense to drop this
    break, as otherwise the following line is never executed and becomes
    dead code. And that following line actually saves the result of
    local calculation by the pointer given in function argument. So the
    proposed change makes sense if this code in the whole makes sense (but I
    am unable to analyze it in the whole).

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=81641
    Reported-by: David Binderman
    Signed-off-by: Andrey Utkin
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Andrey Utkin
     
  • [ Upstream commit 4ec1b01029b4facb651b8ef70bc20a4be4cebc63 ]

    The LDC handshake could have been asynchronously triggered
    after ldc_bind() enables the ldc_rx() receive interrupt-handler
    (and thus intercepts incoming control packets)
    and before vio_port_up() calls ldc_connect(). If that is the case,
    ldc_connect() should return 0 and let the state-machine
    progress.

    Signed-off-by: Sowmini Varadhan
    Acked-by: Karl Volz
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Sowmini Varadhan
     
  • [ Upstream commit fe418231b195c205701c0cc550a03f6c9758fd9e ]

    Fix detection of BREAK on sunsab serial console: BREAK detection was only
    performed when there were also serial characters received simultaneously.
    To handle all BREAKs correctly, the check for BREAK and the corresponding
    call to uart_handle_break() must also be done if count == 0, therefore
    duplicate this code fragment and pull it out of the loop over the received
    characters.

    Patch applies to 3.16-rc6.

    Signed-off-by: Christopher Alexander Tobias Schulze
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Christopher Alexander Tobias Schulze
     
  • [ Upstream commit 5cdceab3d5e02eb69ea0f5d8fa9181800baf6f77 ]

    Fix regression in bbc i2c temperature and fan control on some Sun systems
    that causes the driver to refuse to load due to the bbc_i2c_bussel resource not
    being present on the (second) i2c bus where the temperature sensors and fan
    control are located. (The check for the number of resources was removed when
    the driver was ported to a pure OF driver in mid 2008.)

    Signed-off-by: Christopher Alexander Tobias Schulze
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Christopher Alexander Tobias Schulze
     
  • [ Upstream commit 4ca9a23765da3260058db3431faf5b4efd8cf926 ]

    Based almost entirely upon a patch by Christopher Alexander Tobias
    Schulze.

    In commit db64fe02258f1507e13fe5212a989922323685ce ("mm: rewrite vmap
    layer") lazy VMAP tlb flushing was added to the vmalloc layer. This
    causes problems on sparc64.

    Sparc64 has two VMAP mapped regions and they are not contiguous with
    eachother. First we have the malloc mapping area, then another
    unrelated region, then the vmalloc region.

    This "another unrelated region" is where the firmware is mapped.

    If the lazy TLB flushing logic in the vmalloc code triggers after
    we've had both a module unload and a vfree or similar, it will pass an
    address range that goes from somewhere inside the malloc region to
    somewhere inside the vmalloc region, and thus covering the
    openfirmware area entirely.

    The sparc64 kernel learns about openfirmware's dynamic mappings in
    this region early in the boot, and then services TLB misses in this
    area. But openfirmware has some locked TLB entries which are not
    mentioned in those dynamic mappings and we should thus not disturb
    them.

    These huge lazy TLB flush ranges causes those openfirmware locked TLB
    entries to be removed, resulting in all kinds of problems including
    hard hangs and crashes during reboot/reset.

    Besides causing problems like this, such huge TLB flush ranges are
    also incredibly inefficient. A plea has been made with the author of
    the VMAP lazy TLB flushing code, but for now we'll put a safety guard
    into our flush_tlb_kernel_range() implementation.

    Since the implementation has become non-trivial, stop defining it as a
    macro and instead make it a function in a C source file.

    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    David S. Miller
     
  • [ Upstream commit 18f38132528c3e603c66ea464727b29e9bbcb91b ]

    The assumption was that update_mmu_cache() (and the equivalent for PMDs) would
    only be called when the PTE being installed will be accessible by the user.

    This is not true for code paths originating from remove_migration_pte().

    There are dire consequences for placing a non-valid PTE into the TSB. The TLB
    miss frramework assumes thatwhen a TSB entry matches we can just load it into
    the TLB and return from the TLB miss trap.

    So if a non-valid PTE is in there, we will deadlock taking the TLB miss over
    and over, never satisfying the miss.

    Just exit early from update_mmu_cache() and friends in this situation.

    Based upon a report and patch from Christopher Alexander Tobias Schulze.

    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    David S. Miller
     
  • [ Upstream commit 4d8fdc95c60e90d84c8257a0067ff4b1729a3757 ]

    tg3_tso_bug() was originally designed to handle only HW TX ring 0, Commit
    d3f6f3a1d818410c17445bce4f4caab52eb102f1 ("tg3: Prevent page allocation failure
    during TSO workaround") changed the driver logic to use tg3_tso_bug() for all
    HW TX rings that are enabled. This patch fixes the regression by modifying
    tg3_tso_bug() to handle multiple HW TX rings.

    Signed-off-by: Prashant Sreedharan
    Signed-off-by: Michael Chan
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Prashant Sreedharan
     
  • [ Upstream commit 757efd32d5ce31f67193cc0e6a56e4dffcc42fb1 ]

    Dave reported following splat, caused by improper use of
    IP_INC_STATS_BH() in process context.

    BUG: using __this_cpu_add() in preemptible [00000000] code: trinity-c117/14551
    caller is __this_cpu_preempt_check+0x13/0x20
    CPU: 3 PID: 14551 Comm: trinity-c117 Not tainted 3.16.0+ #33
    ffffffff9ec898f0 0000000047ea7e23 ffff88022d32f7f0 ffffffff9e7ee207
    0000000000000003 ffff88022d32f818 ffffffff9e397eaa ffff88023ee70b40
    ffff88022d32f970 ffff8801c026d580 ffff88022d32f828 ffffffff9e397ee3
    Call Trace:
    [] dump_stack+0x4e/0x7a
    [] check_preemption_disabled+0xfa/0x100
    [] __this_cpu_preempt_check+0x13/0x20
    [] sctp_packet_transmit+0x692/0x710 [sctp]
    [] sctp_outq_flush+0x2a2/0xc30 [sctp]
    [] ? mark_held_locks+0x7c/0xb0
    [] ? _raw_spin_unlock_irqrestore+0x5d/0x80
    [] sctp_outq_uncork+0x1a/0x20 [sctp]
    [] sctp_cmd_interpreter.isra.23+0x1142/0x13f0 [sctp]
    [] sctp_do_sm+0xdb/0x330 [sctp]
    [] ? preempt_count_sub+0xab/0x100
    [] ? sctp_cname+0x70/0x70 [sctp]
    [] sctp_primitive_ASSOCIATE+0x3a/0x50 [sctp]
    [] sctp_sendmsg+0x88f/0xe30 [sctp]
    [] ? lock_release_holdtime.part.28+0x9a/0x160
    [] ? put_lock_stats.isra.27+0xe/0x30
    [] inet_sendmsg+0x104/0x220
    [] ? inet_sendmsg+0x5/0x220
    [] sock_sendmsg+0x9e/0xe0
    [] ? might_fault+0xb9/0xc0
    [] ? might_fault+0x5e/0xc0
    [] SYSC_sendto+0x124/0x1c0
    [] ? syscall_trace_enter+0x250/0x330
    [] SyS_sendto+0xe/0x10
    [] tracesys+0xdd/0xe2

    This is a followup of commits f1d8cba61c3c4b ("inet: fix possible
    seqlock deadlocks") and 7f88c6b23afbd315 ("ipv6: fix possible seqlock
    deadlock in ip6_finish_output2")

    Signed-off-by: Eric Dumazet
    Cc: Hannes Frederic Sowa
    Reported-by: Dave Jones
    Acked-by: Neil Horman
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • [ Upstream commit ce7991e8198b80eb6b4441b6f6114bea4a665d66 ]

    Commit a71e3c37960ce5f9 ("net: phy: Set the driver when registering an MDIO bus
    device") caused the following regression on the fec driver:

    root@imx6qsabresd:~# echo mem > /sys/power/state
    PM: Syncing filesystems ... done.
    Freezing user space processes ... (elapsed 0.003 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
    Unable to handle kernel NULL pointer dereference at virtual address 0000002c
    pgd = bcd14000
    [0000002c] *pgd=4d9e0831, *pte=00000000, *ppte=00000000
    Internal error: Oops: 17 [#1] SMP ARM
    Modules linked in:
    CPU: 0 PID: 617 Comm: sh Not tainted 3.16.0 #17
    task: bc0c4e00 ti: bceb6000 task.ti: bceb6000
    PC is at fec_suspend+0x10/0x70
    LR is at dpm_run_callback.isra.7+0x34/0x6c
    pc : [] lr : [] psr: 600f0013
    sp : bceb7d70 ip : bceb7d88 fp : bceb7d84
    r10: 8091523c r9 : 00000000 r8 : bd88f478
    r7 : 803f8a88 r6 : 81165988 r5 : 00000000 r4 : 00000000
    r3 : 00000000 r2 : 00000000 r1 : bd88f478 r0 : bd88f478
    Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    Control: 10c5387d Table: 4cd1404a DAC: 00000015
    Process sh (pid: 617, stack limit = 0xbceb6240)
    Stack: (0xbceb7d70 to 0xbceb8000)
    ....

    The problem with the original commit is explained by Russell King:

    "It has the effect (as can be seen from the oops) of attaching the MDIO bus
    device (itself is a bus-less device) to the platform driver, which means
    that if the platform driver supports power management, it will be called
    to power manage the MDIO bus device.

    Moreover, drivers do not expect to be called for power management
    operations for devices which they haven't probed, and certainly not for
    devices which aren't part of the same bus that the driver is registered
    against."

    This reverts commit a71e3c37960ce5f9c6a519bc1215e3ba9fa83e75.

    Cc: #3.16
    Signed-off-by: Fabio Estevam
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Fabio Estevam
     
  • [ Upstream commit d9124268d84a836f14a6ead54ff9d8eee4c43be5 ]

    batadv_frag_insert_packet was unable to handle out-of-order packets because it
    dropped them directly. This is caused by the way the fragmentation lists is
    checked for the correct place to insert a fragmentation entry.

    The fragmentation code keeps the fragments in lists. The fragmentation entries
    are kept in descending order of sequence number. The list is traversed and each
    entry is compared with the new fragment. If the current entry has a smaller
    sequence number than the new fragment then the new one has to be inserted
    before the current entry. This ensures that the list is still in descending
    order.

    An out-of-order packet with a smaller sequence number than all entries in the
    list still has to be added to the end of the list. The used hlist has no
    information about the last entry in the list inside hlist_head and thus the
    last entry has to be calculated differently. Currently the code assumes that
    the iterator variable of hlist_for_each_entry can be used for this purpose
    after the hlist_for_each_entry finished. This is obviously wrong because the
    iterator variable is always NULL when the list was completely traversed.

    Instead the information about the last entry has to be stored in a different
    variable.

    This problem was introduced in 610bfc6bc99bc83680d190ebc69359a05fc7f605
    ("batman-adv: Receive fragmented packets and merge").

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli
    Signed-off-by: Greg Kroah-Hartman

    Sven Eckelmann
     
  • [ Upstream commit 06ebb06d49486676272a3c030bfeef4bd969a8e6 ]

    Check for cases when the caller requests 0 bytes instead of running off
    and dereferencing potentially invalid iovecs.

    Signed-off-by: Sasha Levin
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Sasha Levin
     
  • [ Upstream commit fcdfe3a7fa4cb74391d42b6a26dc07c20dab1d82 ]

    When performing segmentation, the mac_len value is copied right
    out of the original skb. However, this value is not always set correctly
    (like when the packet is VLAN-tagged) and we'll end up copying a bad
    value.

    One way to demonstrate this is to configure a VM which tags
    packets internally and turn off VLAN acceleration on the forwarding
    bridge port. The packets show up corrupt like this:
    16:18:24.985548 52:54:00:ab:be:25 > 52:54:00:26:ce:a3, ethertype 802.1Q
    (0x8100), length 1518: vlan 100, p 0, ethertype 0x05e0,
    0x0000: 8cdb 1c7c 8cdb 0064 4006 b59d 0a00 6402 ...|...d@.....d.
    0x0010: 0a00 6401 9e0d b441 0a5e 64ec 0330 14fa ..d....A.^d..0..
    0x0020: 29e3 01c9 f871 0000 0101 080a 000a e833)....q.........3
    0x0030: 000f 8c75 6e65 7470 6572 6600 6e65 7470 ...unetperf.netp
    0x0040: 6572 6600 6e65 7470 6572 6600 6e65 7470 erf.netperf.netp
    0x0050: 6572 6600 6e65 7470 6572 6600 6e65 7470 erf.netperf.netp
    0x0060: 6572 6600 6e65 7470 6572 6600 6e65 7470 erf.netperf.netp
    ...

    This also leads to awful throughput as GSO packets are dropped and
    cause retransmissions.

    The solution is to set the mac_len using the values already available
    in then new skb. We've already adjusted all of the header offset, so we
    might as well correctly figure out the mac_len using skb_reset_mac_len().
    After this change, packets are segmented correctly and performance
    is restored.

    CC: Eric Dumazet
    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Vlad Yasevich
     
  • [ Upstream commit 081e83a78db9b0ae1f5eabc2dedecc865f509b98 ]

    Macvlan devices do not initialize vlan_features. As a result,
    any vlan devices configured on top of macvlans perform very poorly.
    Initialize vlan_features based on the vlan features of the lower-level
    device.

    Signed-off-by: Vlad Yasevich
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Vlad Yasevich
     
  • [ Upstream commit c36c9d50cc6af5c5bfcc195f21b73f55520c15f9 ]

    The recent commit "e29aa33 bna: Enable Multi Buffer RX" is causing
    a performance regression. It does not properly update 'cmpl' pointer
    at the end of the loop in NAPI handler bnad_cq_process(). The result is
    only one packet / per NAPI-schedule is processed.

    Signed-off-by: Ivan Vecera
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ivan Vecera
     
  • [ Upstream commit 1f74e613ded11517db90b2bd57e9464d9e0fb161 ]

    In vegas we do a multiplication of the cwnd and the rtt. This
    may overflow and thus their result is stored in a u64. However, we first
    need to cast the cwnd so that actually 64-bit arithmetic is done.

    Then, we need to do do_div to allow this to be used on 32-bit arches.

    Cc: Stephen Hemminger
    Cc: Neal Cardwell
    Cc: Eric Dumazet
    Cc: David Laight
    Cc: Doug Leith
    Fixes: 8d3a564da34e (tcp: tcp_vegas cong avoid fix)
    Signed-off-by: Christoph Paasch
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Christoph Paasch
     
  • [ Upstream commit 45a07695bc64b3ab5d6d2215f9677e5b8c05a7d0 ]

    In veno we do a multiplication of the cwnd and the rtt. This
    may overflow and thus their result is stored in a u64. However, we first
    need to cast the cwnd so that actually 64-bit arithmetic is done.

    A first attempt at fixing 76f1017757aa0 ([TCP]: TCP Veno congestion
    control) was made by 159131149c2 (tcp: Overflow bug in Vegas), but it
    failed to add the required cast in tcp_veno_cong_avoid().

    Fixes: 76f1017757aa0 ([TCP]: TCP Veno congestion control)
    Signed-off-by: Christoph Paasch
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Christoph Paasch
     
  • [ Upstream commit 95cb5745983c222867cc9ac593aebb2ad67d72c0 ]

    Ipv4 tunnels created with "local any remote $ip" didn't work properly since
    7d442fab0 (ipv4: Cache dst in tunnels). 99% of packets sent via those tunnels
    had src addr = 0.0.0.0. That was because only dst_entry was cached, although
    fl4.saddr has to be cached too. Every time ip_tunnel_xmit used cached dst_entry
    (tunnel_rtable_get returned non-NULL), fl4.saddr was initialized with
    tnl_params->saddr (= 0 in our case), and wasn't changed until iptunnel_xmit().

    This patch adds saddr to ip_tunnel->dst_cache, fixing this issue.

    Reported-by: Sergey Popov
    Signed-off-by: Dmitry Popov
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Popov
     

04 Aug, 2014

2 commits


03 Aug, 2014

1 commit

  • Pull ARM fixes from Russell King:
    "A few fixes for ARM. Some of these are correctness issues:
    - TLBs must be flushed after the old mappings are removed by the DMA
    mapping code, but before the new mappings are established.
    - An off-by-one entry error in the Keystone LPAE setup code.

    Fixes include:
    - ensuring that the identity mapping for LPAE does not remove the
    kernel image from the identity map.
    - preventing userspace from trapping into kgdb.
    - fixing a preemption issue in the Intel iwmmxt code.
    - fixing a build error with nommu.

    Other changes include:
    - Adding a note about which areas of memory are expected to be
    accessible while the identity mapping tables are in place"

    * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    ARM: 8124/1: don't enter kgdb when userspace executes a kgdb break instruction
    ARM: idmap: add identity mapping usage note
    ARM: 8115/1: LPAE: reduce damage caused by idmap to virtual memory layout
    ARM: fix alignment of keystone page table fixup
    ARM: 8112/1: only select ARM_PATCH_PHYS_VIRT if MMU is enabled
    ARM: 8100/1: Fix preemption disable in iwmmxt_task_enable()
    ARM: DMA: ensure that old section mappings are flushed from the TLB

    Linus Torvalds
     

02 Aug, 2014

9 commits

  • The kgdb breakpoint hooks (kgdb_brk_fn and kgdb_compiled_brk_fn)
    should only be entered when a kgdb break instruction is executed
    from the kernel. Otherwise, if kgdb is enabled, a userspace program
    can cause the kernel to drop into the debugger by executing either
    KGDB_BREAKINST or KGDB_COMPILED_BREAK.

    Acked-by: Will Deacon
    Signed-off-by: Omar Sandoval
    Signed-off-by: Russell King

    Omar Sandoval
     
  • Add a note about the usage of the identity mapping; we do not support
    accesses outside of the identity map region and kernel image while a
    CPU is using the identity map. This is because the identity mapping
    may overwrite vmalloc space, IO mappings, the vectors pages, etc.

    Acked-by: Will Deacon
    Signed-off-by: Russell King

    Russell King
     
  • Pull vfs fixes from Al Viro:
    "This contains a couple of fixes - one is the aio fix from Christoph,
    the other a fallocate() one from Eric"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    vfs: fix check for fallocate on active swapfile
    direct-io: fix AIO regression

    Linus Torvalds
     
  • Pull x86 fix from Peter Anvin:
    "A single fix to not invoke the espfix code on Xen PV, as it turns out
    to oops the guest when invoked after all. This patch leaves some
    amount of dead code, in particular unnecessary initialization of the
    espfix stacks when they won't be used, but in the interest of keeping
    the patch minimal that cleanup can wait for the next cycle"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86_64/entry/xen: Do not invoke espfix64 on Xen

    Linus Torvalds
     
  • Pull staging driver bugfixes from Greg KH:
    "Here are some tiny staging driver bugfixes that I've had in my tree
    for the past week that resolve some reported issues. Nothing major at
    all, but it would be good to get them merged for 3.16-rc8 or -final"

    * tag 'staging-3.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
    staging: vt6655: Fix disassociated messages every 10 seconds
    staging: vt6655: Fix Warning on boot handle_irq_event_percpu.
    staging: rtl8723au: rtw_resume(): release semaphore before exit on error
    iio:bma180: Missing check for frequency fractional part
    iio:bma180: Fix scale factors to report correct acceleration units
    iio: buffer: Fix demux table creation

    Linus Torvalds
     
  • Pull device mapper fixes from Mike Snitzer:
    "Fix dm bufio shrinker to properly zero-fill all fields.

    Fix race in dm cache that caused improper reporting of the number of
    dirty blocks in the cache"

    * tag 'dm-3.16-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm cache: fix race affecting dirty block count
    dm bufio: fully initialize shrinker

    Linus Torvalds
     
  • Pull ARM straggler SoC fix from Olof Johansson:
    "A DT bugfix for Nomadik that had an ambigouos double-inversion of a
    gpio line, and one MAINTAINER URL update that might as well go in now.

    We could hold off until the merge window, but then we'll just have to
    mark the DT fix for stable and it just seems like in total causing
    more work"

    * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    MAINTAINERS: Update Tegra Git URL
    ARM: nomadik: fix up double inversion in DT

    Linus Torvalds
     
  • nr_dirty is updated without locking, causing it to drift so that it is
    non-zero (either a small positive integer, or a very large one when an
    underflow occurs) even when there are no actual dirty blocks. This was
    due to a race between the workqueue and map function accessing nr_dirty
    in parallel without proper protection.

    People were seeing under runs due to a race on increment/decrement of
    nr_dirty, see: https://lkml.org/lkml/2014/6/3/648

    Fix this by using an atomic_t for nr_dirty.

    Reported-by: roma1390@gmail.com
    Signed-off-by: Anssi Hannula
    Signed-off-by: Joe Thornber
    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org

    Anssi Hannula
     
  • 1d3d4437eae1 ("vmscan: per-node deferred work") added a flags field to
    struct shrinker assuming that all shrinkers were zero filled. The dm
    bufio shrinker is not zero filled, which leaves arbitrary kmalloc() data
    in flags. So far the only defined flags bit is SHRINKER_NUMA_AWARE.
    But there are proposed patches which add other bits to shrinker.flags
    (e.g. memcg awareness).

    Rather than simply initializing the shrinker, this patch uses kzalloc()
    when allocating the dm_bufio_client to ensure that the embedded shrinker
    and any other similar structures are zeroed.

    This fixes theoretical over aggressive shrinking of dm bufio objects.
    If the uninitialized dm_bufio_client.shrinker.flags contains
    SHRINKER_NUMA_AWARE then shrink_slab() would call the dm shrinker for
    each numa node rather than just once. This has been broken since 3.12.

    Signed-off-by: Greg Thelen
    Acked-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Cc: stable@vger.kernel.org # v3.12+

    Greg Thelen
     

01 Aug, 2014

7 commits

  • clockevents_increase_min_delta() calls printk() from under
    hrtimer_bases.lock. That causes lock inversion on scheduler locks because
    printk() can call into the scheduler. Lockdep puts it as:

    ======================================================
    [ INFO: possible circular locking dependency detected ]
    3.15.0-rc8-06195-g939f04b #2 Not tainted
    -------------------------------------------------------
    trinity-main/74 is trying to acquire lock:
    (&port_lock_key){-.....}, at: [] serial8250_console_write+0x8c/0x10c

    but task is already holding lock:
    (hrtimer_bases.lock){-.-...}, at: [] hrtimer_try_to_cancel+0x13/0x66

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #5 (hrtimer_bases.lock){-.-...}:
    [] lock_acquire+0x92/0x101
    [] _raw_spin_lock_irqsave+0x2e/0x3e
    [] __hrtimer_start_range_ns+0x1c/0x197
    [] perf_swevent_start_hrtimer.part.41+0x7a/0x85
    [] task_clock_event_start+0x3a/0x3f
    [] task_clock_event_add+0xd/0x14
    [] event_sched_in+0xb6/0x17a
    [] group_sched_in+0x44/0x122
    [] ctx_sched_in.isra.67+0x105/0x11f
    [] perf_event_sched_in.isra.70+0x47/0x4b
    [] __perf_install_in_context+0x8b/0xa3
    [] remote_function+0x12/0x2a
    [] smp_call_function_single+0x2d/0x53
    [] task_function_call+0x30/0x36
    [] perf_install_in_context+0x87/0xbb
    [] SYSC_perf_event_open+0x5c6/0x701
    [] SyS_perf_event_open+0x17/0x19
    [] syscall_call+0x7/0xb

    -> #4 (&ctx->lock){......}:
    [] lock_acquire+0x92/0x101
    [] _raw_spin_lock+0x21/0x30
    [] __perf_event_task_sched_out+0x1dc/0x34f
    [] __schedule+0x4c6/0x4cb
    [] schedule+0xf/0x11
    [] work_resched+0x5/0x30

    -> #3 (&rq->lock){-.-.-.}:
    [] lock_acquire+0x92/0x101
    [] _raw_spin_lock+0x21/0x30
    [] __task_rq_lock+0x33/0x3a
    [] wake_up_new_task+0x25/0xc2
    [] do_fork+0x15c/0x2a0
    [] kernel_thread+0x1a/0x1f
    [] rest_init+0x1a/0x10e
    [] start_kernel+0x303/0x308
    [] i386_start_kernel+0x79/0x7d

    -> #2 (&p->pi_lock){-.-...}:
    [] lock_acquire+0x92/0x101
    [] _raw_spin_lock_irqsave+0x2e/0x3e
    [] try_to_wake_up+0x1d/0xd6
    [] default_wake_function+0xb/0xd
    [] __wake_up_common+0x39/0x59
    [] __wake_up+0x29/0x3b
    [] tty_wakeup+0x49/0x51
    [] uart_write_wakeup+0x17/0x19
    [] serial8250_tx_chars+0xbc/0xfb
    [] serial8250_handle_irq+0x54/0x6a
    [] serial8250_default_handle_irq+0x19/0x1c
    [] serial8250_interrupt+0x38/0x9e
    [] handle_irq_event_percpu+0x5f/0x1e2
    [] handle_irq_event+0x2c/0x43
    [] handle_level_irq+0x57/0x80
    [] handle_irq+0x46/0x5c
    [] do_IRQ+0x32/0x89
    [] common_interrupt+0x2e/0x33
    [] _raw_spin_unlock_irqrestore+0x3f/0x49
    [] uart_start+0x2d/0x32
    [] uart_write+0xc7/0xd6
    [] n_tty_write+0xb8/0x35e
    [] tty_write+0x163/0x1e4
    [] redirected_tty_write+0x6d/0x75
    [] vfs_write+0x75/0xb0
    [] SyS_write+0x44/0x77
    [] syscall_call+0x7/0xb

    -> #1 (&tty->write_wait){-.....}:
    [] lock_acquire+0x92/0x101
    [] _raw_spin_lock_irqsave+0x2e/0x3e
    [] __wake_up+0x15/0x3b
    [] tty_wakeup+0x49/0x51
    [] uart_write_wakeup+0x17/0x19
    [] serial8250_tx_chars+0xbc/0xfb
    [] serial8250_handle_irq+0x54/0x6a
    [] serial8250_default_handle_irq+0x19/0x1c
    [] serial8250_interrupt+0x38/0x9e
    [] handle_irq_event_percpu+0x5f/0x1e2
    [] handle_irq_event+0x2c/0x43
    [] handle_level_irq+0x57/0x80
    [] handle_irq+0x46/0x5c
    [] do_IRQ+0x32/0x89
    [] common_interrupt+0x2e/0x33
    [] _raw_spin_unlock_irqrestore+0x3f/0x49
    [] uart_start+0x2d/0x32
    [] uart_write+0xc7/0xd6
    [] n_tty_write+0xb8/0x35e
    [] tty_write+0x163/0x1e4
    [] redirected_tty_write+0x6d/0x75
    [] vfs_write+0x75/0xb0
    [] SyS_write+0x44/0x77
    [] syscall_call+0x7/0xb

    -> #0 (&port_lock_key){-.....}:
    [] __lock_acquire+0x9ea/0xc6d
    [] lock_acquire+0x92/0x101
    [] _raw_spin_lock_irqsave+0x2e/0x3e
    [] serial8250_console_write+0x8c/0x10c
    [] call_console_drivers.constprop.31+0x87/0x118
    [] console_unlock+0x1d7/0x398
    [] vprintk_emit+0x3da/0x3e4
    [] printk+0x17/0x19
    [] clockevents_program_min_delta+0x104/0x116
    [] clockevents_program_event+0xe7/0xf3
    [] tick_program_event+0x1e/0x23
    [] hrtimer_force_reprogram+0x88/0x8f
    [] __remove_hrtimer+0x5b/0x79
    [] hrtimer_try_to_cancel+0x49/0x66
    [] hrtimer_cancel+0xd/0x18
    [] perf_swevent_cancel_hrtimer.part.60+0x2b/0x30
    [] task_clock_event_stop+0x20/0x64
    [] task_clock_event_del+0xd/0xf
    [] event_sched_out+0xab/0x11e
    [] group_sched_out+0x1d/0x66
    [] ctx_sched_out+0xaf/0xbf
    [] __perf_event_task_sched_out+0x1ed/0x34f
    [] __schedule+0x4c6/0x4cb
    [] schedule+0xf/0x11
    [] work_resched+0x5/0x30

    other info that might help us debug this:

    Chain exists of:
    &port_lock_key --> &ctx->lock --> hrtimer_bases.lock

    Possible unsafe locking scenario:

    CPU0 CPU1
    ---- ----
    lock(hrtimer_bases.lock);
    lock(&ctx->lock);
    lock(hrtimer_bases.lock);
    lock(&port_lock_key);

    *** DEADLOCK ***

    4 locks held by trinity-main/74:
    #0: (&rq->lock){-.-.-.}, at: [] __schedule+0xed/0x4cb
    #1: (&ctx->lock){......}, at: [] __perf_event_task_sched_out+0x1dc/0x34f
    #2: (hrtimer_bases.lock){-.-...}, at: [] hrtimer_try_to_cancel+0x13/0x66
    #3: (console_lock){+.+...}, at: [] vprintk_emit+0x3c7/0x3e4

    stack backtrace:
    CPU: 0 PID: 74 Comm: trinity-main Not tainted 3.15.0-rc8-06195-g939f04b #2
    00000000 81c3a310 8b995c14 81426f69 8b995c44 81425a99 8161f671 8161f570
    8161f538 8161f559 8161f538 8b995c78 8b142bb0 00000004 8b142fdc 8b142bb0
    8b995ca8 8104a62d 8b142fac 000016f2 81c3a310 00000001 00000001 00000003
    Call Trace:
    [] dump_stack+0x16/0x18
    [] print_circular_bug+0x18f/0x19c
    [] __lock_acquire+0x9ea/0xc6d
    [] lock_acquire+0x92/0x101
    [] ? serial8250_console_write+0x8c/0x10c
    [] ? wait_for_xmitr+0x76/0x76
    [] _raw_spin_lock_irqsave+0x2e/0x3e
    [] ? serial8250_console_write+0x8c/0x10c
    [] serial8250_console_write+0x8c/0x10c
    [] ? lock_release+0x191/0x223
    [] ? wait_for_xmitr+0x76/0x76
    [] call_console_drivers.constprop.31+0x87/0x118
    [] console_unlock+0x1d7/0x398
    [] vprintk_emit+0x3da/0x3e4
    [] printk+0x17/0x19
    [] clockevents_program_min_delta+0x104/0x116
    [] tick_program_event+0x1e/0x23
    [] hrtimer_force_reprogram+0x88/0x8f
    [] __remove_hrtimer+0x5b/0x79
    [] hrtimer_try_to_cancel+0x49/0x66
    [] hrtimer_cancel+0xd/0x18
    [] perf_swevent_cancel_hrtimer.part.60+0x2b/0x30
    [] task_clock_event_stop+0x20/0x64
    [] task_clock_event_del+0xd/0xf
    [] event_sched_out+0xab/0x11e
    [] group_sched_out+0x1d/0x66
    [] ctx_sched_out+0xaf/0xbf
    [] __perf_event_task_sched_out+0x1ed/0x34f
    [] ? __dequeue_entity+0x23/0x27
    [] ? pick_next_task_fair+0xb1/0x120
    [] __schedule+0x4c6/0x4cb
    [] ? trace_hardirqs_off_caller+0xd7/0x108
    [] ? trace_hardirqs_off+0xb/0xd
    [] ? rcu_irq_exit+0x64/0x77

    Fix the problem by using printk_deferred() which does not call into the
    scheduler.

    Reported-by: Fengguang Wu
    Signed-off-by: Jan Kara
    Cc: stable@vger.kernel.org
    Signed-off-by: Thomas Gleixner

    Jan Kara
     
  • Fix the broken check for calling sys_fallocate() on an active swapfile,
    introduced by commit 0790b31b69374ddadefe ("fs: disallow all fallocate
    operation on active swapfile").

    Signed-off-by: Eric Biggers
    Signed-off-by: Al Viro

    Eric Biggers
     
  • The direct-io.c rewrite to use the iov_iter infrastructure stopped updating
    the size field in struct dio_submit, and thus rendered the check for
    allowing asynchronous completions to always return false. Fix this by
    comparing it to the count of bytes in the iov_iter instead.

    Signed-off-by: Christoph Hellwig
    Reported-by: Tim Chen
    Tested-by: Tim Chen

    Christoph Hellwig
     
  • Pull ACPI fix from Rafael Wysocki:
    "One commit that fixes a problem causing PNP devices to be associated
    with wrong ACPI device objects sometimes during device enumeration due
    to an incorrect check in a matching function.

    That problem was uncovered by the ACPI device enumeration rework in
    3.14"

    * tag 'pm+acpi-3.16-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / PNP: Fix acpi_pnp_match()

    Linus Torvalds
     
  • Pull clock driver fix from Mike Turquette:
    "A single patch to re-enable audio which is broken on all DRA7
    SoC-based platforms. Missed this one from the last set of fixes"

    * tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux:
    clk: ti: clk-7xx: Correct ABE DPLL configuration

    Linus Torvalds
     
  • Pull crypto fix from Herbert Xu:
    "This adds missing SELinux labeling to AF_ALG sockets which apparently
    causes SELinux (or at least the SELinux people) to misbehave :)"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: af_alg - properly label AF_ALG socket

    Linus Torvalds
     
  • Pull SCSI barrier fix from James Bottomley:
    "This is a potential data corruption fix: If we get an error sending
    down a barrier, we simply ignore it meaning the barrier semantics get
    violated without anyone being any the wiser. If the system crashes at
    this point, the filesystem potentially becomes corrupt. Fix is to
    report errors on failed barriers"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: handle flush errors properly

    Linus Torvalds
     

31 Jul, 2014

3 commits

  • ABE DPLL frequency need to be lowered from 361267200
    to 180633600 to facilitate the ATL requironments.
    The dpll_abe_m2x2_ck clock need to be set to double
    of ABE DPLL rate in order to have correct clocks
    for audio.

    Signed-off-by: Peter Ujfalusi
    Acked-by: Tero Kristo
    Signed-off-by: Mike Turquette

    Peter Ujfalusi
     
  • Th AF_ALG socket was missing a security label (e.g. SELinux)
    which means that socket was in "unlabeled" state.

    This was recently demonstrated in the cryptsetup package
    (cryptsetup v1.6.5 and later.)
    See https://bugzilla.redhat.com/show_bug.cgi?id=1115120

    This patch clones the sock's label from the parent sock
    and resolves the issue (similar to AF_BLUETOOTH protocol family).

    Cc: stable@vger.kernel.org
    Signed-off-by: Milan Broz
    Acked-by: Paul Moore
    Signed-off-by: Herbert Xu

    Milan Broz
     
  • free_huge_page() is undefined without CONFIG_HUGETLBFS and there's no
    need to filter PageHuge() page is such a configuration either, so avoid
    exporting the symbol to fix a build error:

    In file included from kernel/kexec.c:14:0:
    kernel/kexec.c: In function 'crash_save_vmcoreinfo_init':
    kernel/kexec.c:1623:20: error: 'free_huge_page' undeclared (first use in this function)
    VMCOREINFO_SYMBOL(free_huge_page);
    ^

    Introduced by commit 8f1d26d0e59b ("kexec: export free_huge_page to
    VMCOREINFO")

    Reported-by: kbuild test robot
    Acked-by: Olof Johansson
    Cc: Atsushi Kumagai
    Cc: Baoquan He
    Cc: Vivek Goyal
    Cc: Andrew Morton
    Signed-off-by: David Rientjes
    Signed-off-by: Linus Torvalds

    David Rientjes