Skip to content
  1. Aug 28, 2014
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid · ff0c57ac
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - fixes for potential memory corruption problems in magicmouse and
         picolcd drivers (the HW would have to be manufactured to be
         deliberately evil to trigger those) which were found by Steven
         Vittitoe
      
       - fix for false error message appearing in dmesg from logitech-dj
         driver, from Benjamin Tissoires
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
        HID: picolcd: sanity check report size in raw_event() callback
        HID: magicmouse: sanity check report size in raw_event() callback
        HID: logitech-dj: prevent false errors to be shown
      ff0c57ac
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 1fb00cbc
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "The biggest of these comes from Liu Bo, who tracked down a hang we've
        been hitting since moving to kernel workqueues (it's a btrfs bug, not
        in the generic code).  His patch needs backporting to 3.16 and 3.15
        stable, which I'll send once this is in.
      
        Otherwise these are assorted fixes.  Most were integrated last week
        during KS, but I wanted to give everyone the chance to test the
        result, so I waited for rc2 to come out before sending"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (24 commits)
        Btrfs: fix task hang under heavy compressed write
        Btrfs: fix filemap_flush call in btrfs_file_release
        Btrfs: fix crash on endio of reading corrupted block
        btrfs: fix leak in qgroup_subtree_accounting() error path
        btrfs: Use right extent length when inserting overlap extent map.
        Btrfs: clone, don't create invalid hole extent map
        Btrfs: don't monopolize a core when evicting inode
        Btrfs: fix hole detection during file fsync
        Btrfs: ensure tmpfile inode is always persisted with link count of 0
        Btrfs: race free update of commit root for ro snapshots
        Btrfs: fix regression of btrfs device replace
        Btrfs: don't consider the missing device when allocating new chunks
        Btrfs: Fix wrong device size when we are resizing the device
        Btrfs: don't write any data into a readonly device when scrub
        Btrfs: Fix the problem that the replace destroys the seed filesystem
        btrfs: Return right extent when fiemap gives unaligned offset and len.
        Btrfs: fix wrong extent mapping for DirectIO
        Btrfs: fix wrong write range for filemap_fdatawrite_range()
        Btrfs: fix wrong missing device counter decrease
        Btrfs: fix unzeroed members in fs_devices when creating a fs from seed fs
        ...
      1fb00cbc
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.17-rc1-2' of... · c0fe5dcb
      Linus Torvalds authored
      Merge tag 'trace-fixes-v3.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull trace buffer epoll hang fix from Steven Rostedt:
       "Josef Bacik found a bug in the ring_buffer_poll_wait() where the
        condition variable (waiters_pending) was set before being added to the
        poll queue via poll_wait().  This allowed for a small race window to
        happen where an event could come in, check the condition variable see
        it set to true, clear it, and then wake all the waiters.  But because
        the waiter set the variable before adding itself to the queue, the
        waker could have cleared the variable after it was set and then miss
        waking it up as it wasn't added to the queue yet.
      
        Discussing this bug, we realized that a memory barrier needed to be
        added too, for the rare case that something polls for a single trace
        event to happen (and just one, no more to come in), and miss the
        wakeup due to memory ordering.  Ideally, a memory barrier needs to be
        added on the writer side too, but as that will kill tracing
        performance and this is for a situation that tracing wasn't even
        designed for (who traces one instance of an event, use a printk
        instead!), this isn't worth adding the barrier.  But we can in the
        future add the barrier for when the buffer goes from empty to the
        first event, as that would cover this case"
      
      * tag 'trace-fixes-v3.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        trace: Fix epoll hang when we race with new entries
      c0fe5dcb
  2. Aug 27, 2014
  3. Aug 26, 2014
    • Josef Bacik's avatar
      trace: Fix epoll hang when we race with new entries · 4ce97dbf
      Josef Bacik authored
      Epoll on trace_pipe can sometimes hang in a weird case.  If the ring buffer is
      empty when we set waiters_pending but an event shows up exactly at that moment
      we can miss being woken up by the ring buffers irq work.  Since
      ring_buffer_empty() is inherently racey we will sometimes think that the buffer
      is not empty.  So we don't get woken up and we don't think there are any events
      even though there were some ready when we added the watch, which makes us hang.
      This patch fixes this by making sure that we are actually on the wait list
      before we set waiters_pending, and add a memory barrier to make sure
      ring_buffer_empty() is going to be correct.
      
      Link: http://lkml.kernel.org/p/1408989581-23727-1-git-send-email-jbacik@fb.com
      
      
      
      Cc: stable@vger.kernel.org # 3.10+
      Cc: Martin Lau <kafai@fb.com>
      Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      4ce97dbf
    • Linus Torvalds's avatar
      Linux 3.17-rc2 · 52addcf9
      Linus Torvalds authored
      52addcf9
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-3.17-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · f01bfc97
      Linus Torvalds authored
      Pull NFS client fixes from Trond Myklebust:
       "Highlights:
      
         - more fixes for read/write codepath regressions
           * sleeping while holding the inode lock
           * stricter enforcement of page contiguity when coalescing requests
           * fix up error handling in the page coalescing code
      
         - don't busy wait on SIGKILL in the file locking code"
      
      * tag 'nfs-for-3.17-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
        nfs: can_coalesce_requests must enforce contiguity
        nfs: disallow duplicate pages in pgio page vectors
        nfs: don't sleep with inode lock in lock_and_join_requests
        nfs: fix error handling in lock_and_join_requests
        nfs: use blocking page_group_lock in add_request
        nfs: fix nonblocking calls to nfs_page_group_lock
        nfs: change nfs_page_group_lock argument
      f01bfc97
    • Linus Torvalds's avatar
      Merge tag 'renesas-sh-drivers-for-v3.17' of... · dd5957b7
      Linus Torvalds authored
      Merge tag 'renesas-sh-drivers-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas
      
      Pull SH driver fix from Simon Horman:
       "Confine SH_INTC to platforms that need it"
      
      * tag 'renesas-sh-drivers-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
        sh: intc: Confine SH_INTC to platforms that need it
      dd5957b7
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 497c01dd
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "Pretty much all across the field so with this we should be in
        reasonable shape for the upcoming -rc2"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: OCTEON: make get_system_type() thread-safe
        MIPS: CPS: Initialize EVA before bringing up VPEs from secondary cores
        MIPS: Malta: EVA: Rename 'eva_entry' to 'platform_eva_init'
        MIPS: EVA: Add new EVA header
        MIPS: scall64-o32: Fix indirect syscall detection
        MIPS: syscall: Fix AUDIT value for O32 processes on MIPS64
        MIPS: Loongson: Fix COP2 usage for preemptible kernel
        MIPS: NL: Fix nlm_xlp_defconfig build error
        MIPS: Remove race window in page fault handling
        MIPS: Malta: Improve system memory detection for '{e, }memsize' >= 2G
        MIPS: Alchemy: Fix db1200 PSC clock enablement
        MIPS: BCM47XX: Fix reboot problem on BCM4705/BCM4785
        MIPS: Remove duplicated include from numa.c
        MIPS: Add common plat_irq_dispatch declaration
        MIPS: MSP71xx: remove unused plat_irq_dispatch() argument
        MIPS: GIC: Remove useless parens from GICBIS().
        MIPS: perf: Mark pmu interupt IRQF_NO_THREAD
      497c01dd
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.17-rc1' of... · 01e9982a
      Linus Torvalds authored
      Merge tag 'trace-fixes-v3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull fix for ftrace function tracer/profiler conflict from Steven Rostedt:
       "The rewrite of the ftrace code that makes it possible to allow for
        separate trampolines had a design flaw with the interaction between
        the function and function_graph tracers.
      
        The main flaw was the simplification of the use of multiple tracers
        having the same filter (like function and function_graph, that use the
        set_ftrace_filter file to filter their code).  The design assumed that
        the two tracers could never run simultaneously as only one tracer can
        be used at a time.  The problem with this assumption was that the
        function profiler could be implemented on top of the function graph
        tracer, and the function profiler could run at the same time as the
        function tracer.  This caused the assumption to be broken and when
        ftrace detected this failed assumpiton it would spit out a nasty
        warning and shut itself down.
      
        Instead of using a single ftrace_ops that switches between the
        function and function_graph callbacks, the two tracers can again use
        their own ftrace_ops.  But instead of having a complex hierarchy of
        ftrace_ops, the filter fields are placed in its own structure and the
        ftrace_ops can carefully use the same filter.  This change took a bit
        to be able to allow for this and currently only the global_ops can
        share the same filter, but this new design can easily be modified to
        allow for any ftrace_ops to share its filter with another ftrace_ops.
      
        The first four patches deal with the change of allowing the ftrace_ops
        to share the filter (and this needs to go to 3.16 as well).
      
        The fifth patch fixes a bug that was also caused by the new changes
        but only for archs other than x86, and only if those archs implement a
        direct call to the function_graph tracer which they do not do yet but
        will in the future.  It does not need to go to stable, but needs to be
        fixed before the other archs update their code to allow direct calls
        to the function_graph trampoline"
      
      * tag 'trace-fixes-v3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace: Use current addr when converting to nop in __ftrace_replace_code()
        ftrace: Fix function_profiler and function tracer together
        ftrace: Fix up trampoline accounting with looping on hash ops
        ftrace: Update all ftrace_ops for a ftrace_hash_ops update
        ftrace: Allow ftrace_ops to use the hashes from other ops
      01e9982a
  4. Aug 25, 2014
    • Benjamin Tissoires's avatar
      HID: logitech-dj: prevent false errors to be shown · 5abfe85c
      Benjamin Tissoires authored
      Commit "HID: logitech: perform bounds checking on device_id early
      enough" unfortunately leaks some errors to dmesg which are not real
      ones:
      - if the report is not a DJ one, then there is not point in checking
        the device_id
      - the receiver (index 0) can also receive some notifications which
        can be safely ignored given the current implementation
      
      Move out the test regarding the report_id and also discards
      printing errors when the receiver got notified.
      
      Fixes: ad3e14d7
      
      
      
      Cc: stable@vger.kernel.org
      Reported-and-tested-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      5abfe85c
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7be141d0
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "A couple of EFI fixes, plus misc fixes all around the map"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi/arm64: Store Runtime Services revision
        firmware: Do not use WARN_ON(!spin_is_locked())
        x86_32, entry: Clean up sysenter_badsys declaration
        x86/doc: Fix the 'tlb_single_page_flush_ceiling' sysconfig path
        x86/mm: Fix sparse 'tlb_single_page_flush_ceiling' warning and make the variable read-mostly
        x86/mm: Fix RCU splat from new TLB tracepoints
      7be141d0
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 44744bb3
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "A kprobes and a perf compat ioctl fix"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf: Handle compat ioctl
        kprobes: Skip kretprobe hit in NMI context to avoid deadlock
      44744bb3
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 959dc258
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "A collection of fixes from this week, it's been pretty quiet and
        nothing really stands out as particularly noteworthy here -- mostly
        minor fixes across the field:
      
         - ODROID booting was fixed due to PMIC interrupts missing in DT
         - a collection of i.MX fixes
         - minor Tegra fix for regulators
         - Rockchip fix and addition of SoC-specific mailing list to make it
           easier to find posted patches"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        bus: arm-ccn: Fix warning message
        ARM: shmobile: koelsch: Remove non-existent i2c6 pinmux
        ARM: tegra: apalis/colibri t30: fix on-module 5v0 supplies
        MAINTAINERS: add new Rockchip SoC list
        ARM: dts: rockchip: readd missing mmc0 pinctrl settings
        ARM: dts: ODROID i2c improvements
        ARM: dts: Enable PMIC interrupts on ODROID
        ARM: dts: imx6sx: fix the pad setting for uart CTS_B
        ARM: dts: i.MX53: fix apparent bug in VPU clks
        ARM: imx: correct gpu2d_axi and gpu3d_axi clock setting
        ARM: dts: imx6: edmqmx6: change enet reset pin
        ARM: dts: vf610-twr: Fix pinctrl_esdhc1 pin definitions.
        ARM: imx: remove unnecessary ARCH_HAS_OPP select
        ARM: imx: fix TLB missing of IOMUXC base address during suspend
        ARM: imx6: fix SMP compilation again
        ARM: dt: sun6i: Add #address-cells and #size-cells to i2c controller nodes
      959dc258
    • Linus Torvalds's avatar
      Merge tag 'gpio-v3.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · fa7f78e0
      Linus Torvalds authored
      Pull gpio fixes from Linus Walleij:
      
       - a largeish fix for the IRQ handling in the new Zynq driver.  The
         quite verbose commit message gives the exact details.
       - move some defines for gpiod flags outside an ifdef to make stub
         functions work again.
       - various minor fixes that we can accept for -rc1.
      
      * tag 'gpio-v3.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
        gpio-lynxpoint: enable input sensing in resume
        gpio: move GPIOD flags outside #ifdef
        gpio: delete unneeded test before of_node_put
        gpio: zynq: Fix IRQ handlers
        gpiolib: devres: use correct structure type name in sizeof
        MAINTAINERS: Change maintainer for gpio-bcm-kona.c
      fa7f78e0
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 5e30ca1e
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Intel and radeon fixes.
      
        Post KS/LC git requests from i915 and radeon stacked up.  They are all
        fixes along with some new pci ids for radeon, and one maintainers file
        entry.
      
         - i915: display fixes and irq fixes
         - radeon: pci ids, and misc gpuvm, dpm and hdp cache"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (29 commits)
        MAINTAINERS: Add entry for Renesas DRM drivers
        drm/radeon: add additional SI pci ids
        drm/radeon: add new bonaire pci ids
        drm/radeon: add new KV pci id
        Revert "drm/radeon: Use write-combined CPU mappings of ring buffers with PCIe"
        drm/radeon: fix active_cu mask on SI and CIK after re-init (v3)
        drm/radeon: fix active cu count for SI and CIK
        drm/radeon: re-enable selective GPUVM flushing
        drm/radeon: Sync ME and PFP after CP semaphore waits v4
        drm/radeon: fix display handling in radeon_gpu_reset
        drm/radeon: fix pm handling in radeon_gpu_reset
        drm/radeon: Only flush HDP cache for indirect buffers from userspace
        drm/radeon: properly document reloc priority mask
        drm/i915: don't try to retrain a DP link on an inactive CRTC
        drm/i915: make sure VDD is turned off during system suspend
        drm/i915: cancel hotplug and dig_port work during suspend and unload
        drm/i915: fix HPD IRQ reenable work cancelation
        drm/i915: take display port power domain in DP HPD handler
        drm/i915: Don't try to enable cursor from setplane when crtc is disabled
        drm/i915: Skip load detect when intel_crtc->new_enable==true
        ...
      5e30ca1e
    • Benjamin LaHaise's avatar
      aio: fix reqs_available handling · d856f32a
      Benjamin LaHaise authored
      As reported by Dan Aloni, commit f8567a38 ("aio: fix aio request
      leak when events are reaped by userspace") introduces a regression when
      user code attempts to perform io_submit() with more events than are
      available in the ring buffer.  Reverting that commit would reintroduce a
      regression when user space event reaping is used.
      
      Fixing this bug is a bit more involved than the previous attempts to fix
      this regression.  Since we do not have a single point at which we can
      count events as being reaped by user space and io_getevents(), we have
      to track event completion by looking at the number of events left in the
      event ring.  So long as there are as many events in the ring buffer as
      there have been completion events generate, we cannot call
      put_reqs_available().  The code to check for this is now placed in
      refill_reqs_available().
      
      A test program from Dan and modified by me for verifying this bug is available
      at http://www.kvack.org/~bcrl/20140824-aio_bug.c
      
       .
      
      Reported-by: default avatarDan Aloni <dan@kernelim.com>
      Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      Acked-by: default avatarDan Aloni <dan@kernelim.com>
      Cc: Kent Overstreet <kmo@daterainc.com>
      Cc: Mateusz Guzik <mguzik@redhat.com>
      Cc: Petr Matousek <pmatouse@redhat.com>
      Cc: stable@vger.kernel.org      # v3.16 and anything that f8567a38
      
       was backported to
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d856f32a
    • Pawel Moll's avatar
      bus: arm-ccn: Fix warning message · bf87bb12
      Pawel Moll authored
      
      
      A message warning a user about wrong vc value was printing
      out port instead.
      
      Reported-by: default avatarDrew Richardson <drew.richardson@arm.com>
      Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      bf87bb12
    • Geert Uytterhoeven's avatar
      ARM: shmobile: koelsch: Remove non-existent i2c6 pinmux · 12266db7
      Geert Uytterhoeven authored
      On r8a7791, i2c6 (aka iic3) doesn't need pinmux, but the koelsch dts
      refers to non-existent pinmux configuration data:
      
      pinmux core: sh-pfc does not support function i2c6
      sh-pfc e6060000.pfc: invalid function i2c6 in map table
      
      Remove it to fix this.
      
      Fixes: commit 1d41f36a
      
       ("ARM: shmobile:
             koelsch dts: Add VDD MPU regulator for DVFS")
      
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      12266db7
    • Marcel Ziswiler's avatar
      ARM: tegra: apalis/colibri t30: fix on-module 5v0 supplies · caa9eac5
      Marcel Ziswiler authored
      
      
      Working on Gigabit/PCIe support in U-Boot for Apalis T30 I realised
      that the current device tree source includes for our modules only
      happen to work due to referencing the on-carrier 5v0 supply from USB
      which is not at all available on-module. The modules actually contain
      TPS60150 charge pumps to generate the PMIC required 5 volts from the
      one and only 3.3 volt module supply. This patch fixes this.
      
      (Note: When back-porting this to v3.16 stable releases, simply drop the
      change to tegra30-apalis.dtsi; that file was added in v3.17)
      
      Cc: <stable@vger.kernel.org> #v3.16+
      Signed-off-by: default avatarMarcel Ziswiler <marcel@ziswiler.com>
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      caa9eac5
    • Olof Johansson's avatar
      Merge tag 'v3.17-rockchip-fixes1' of... · 9d0b1f34
      Olof Johansson authored
      Merge tag 'v3.17-rockchip-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into fixes
      
      Merge "ARM: rockchip: fix for 3.17" from Heiko Stubner:
      
      Pinctrl that got accidentially dropped when reorganizing the
      dts files and addition of the new Rockchip list to MAINTAINERS.
      
      * tag 'v3.17-rockchip-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip
      
      :
        MAINTAINERS: add new Rockchip SoC list
        ARM: dts: rockchip: readd missing mmc0 pinctrl settings
      
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      9d0b1f34
  5. Aug 24, 2014
    • Liu Bo's avatar
      Btrfs: fix task hang under heavy compressed write · 9e0af237
      Liu Bo authored
      
      
      This has been reported and discussed for a long time, and this hang occurs in
      both 3.15 and 3.16.
      
      Btrfs now migrates to use kernel workqueue, but it introduces this hang problem.
      
      Btrfs has a kind of work queued as an ordered way, which means that its
      ordered_func() must be processed in the way of FIFO, so it usually looks like --
      
      normal_work_helper(arg)
          work = container_of(arg, struct btrfs_work, normal_work);
      
          work->func() <---- (we name it work X)
          for ordered_work in wq->ordered_list
                  ordered_work->ordered_func()
                  ordered_work->ordered_free()
      
      The hang is a rare case, first when we find free space, we get an uncached block
      group, then we go to read its free space cache inode for free space information,
      so it will
      
      file a readahead request
          btrfs_readpages()
               for page that is not in page cache
                      __do_readpage()
                           submit_extent_page()
                                 btrfs_submit_bio_hook()
                                       btrfs_bio_wq_end_io()
                                       submit_bio()
                                       end_workqueue_bio() <--(ret by the 1st endio)
                                            queue a work(named work Y) for the 2nd
                                            also the real endio()
      
      So the hang occurs when work Y's work_struct and work X's work_struct happens
      to share the same address.
      
      A bit more explanation,
      
      A,B,C -- struct btrfs_work
      arg   -- struct work_struct
      
      kthread:
      worker_thread()
          pick up a work_struct from @worklist
          process_one_work(arg)
      	worker->current_work = arg;  <-- arg is A->normal_work
      	worker->current_func(arg)
      		normal_work_helper(arg)
      		     A = container_of(arg, struct btrfs_work, normal_work);
      
      		     A->func()
      		     A->ordered_func()
      		     A->ordered_free()  <-- A gets freed
      
      		     B->ordered_func()
      			  submit_compressed_extents()
      			      find_free_extent()
      				  load_free_space_inode()
      				      ...   <-- (the above readhead stack)
      				      end_workqueue_bio()
      					   btrfs_queue_work(work C)
      		     B->ordered_free()
      
      As if work A has a high priority in wq->ordered_list and there are more ordered
      works queued after it, such as B->ordered_func(), its memory could have been
      freed before normal_work_helper() returns, which means that kernel workqueue
      code worker_thread() still has worker->current_work pointer to be work
      A->normal_work's, ie. arg's address.
      
      Meanwhile, work C is allocated after work A is freed, work C->normal_work
      and work A->normal_work are likely to share the same address(I confirmed this
      with ftrace output, so I'm not just guessing, it's rare though).
      
      When another kthread picks up work C->normal_work to process, and finds our
      kthread is processing it(see find_worker_executing_work()), it'll think
      work C as a collision and skip then, which ends up nobody processing work C.
      
      So the situation is that our kthread is waiting forever on work C.
      
      Besides, there're other cases that can lead to deadlock, but the real problem
      is that all btrfs workqueue shares one work->func, -- normal_work_helper,
      so this makes each workqueue to have its own helper function, but only a
      wraper pf normal_work_helper.
      
      With this patch, I no long hit the above hang.
      
      Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      9e0af237
    • Laurent Pinchart's avatar
    • Dave Airlie's avatar
      Merge branch 'drm-fixes-3.17' of git://people.freedesktop.org/~agd5f/linux into drm-next · db314f23
      Dave Airlie authored
      This pull just contains some new pci ids.
      
      * 'drm-fixes-3.17' of git://people.freedesktop.org/~agd5f/linux:
        drm/radeon: add additional SI pci ids
        drm/radeon: add new bonaire pci ids
        drm/radeon: add new KV pci id
      db314f23
  6. Aug 23, 2014