Skip to content
  1. Aug 07, 2014
    • Stephen Boyd's avatar
      cpufreq: OPP: Avoid sleeping while atomic · 3c5445ce
      Stephen Boyd authored
      We allocate the cpufreq table after calling rcu_read_lock(),
      which disables preemption. This causes scheduling while atomic
      warnings. Use GFP_ATOMIC instead of GFP_KERNEL and update for
      kcalloc while we're here.
      
      BUG: sleeping function called from invalid context at mm/slub.c:1246
      in_atomic(): 0, irqs_disabled(): 0, pid: 80, name: modprobe
      5 locks held by modprobe/80:
       #0:  (&dev->mutex){......}, at: [<c050d484>] __driver_attach+0x48/0x98
       #1:  (&dev->mutex){......}, at: [<c050d494>] __driver_attach+0x58/0x98
       #2:  (subsys mutex#5){+.+.+.}, at: [<c050c114>] subsys_interface_register+0x38/0xc8
       #3:  (cpufreq_rwsem){.+.+.+}, at: [<c05a9c8c>] __cpufreq_add_dev.isra.22+0x84/0x92c
       #4:  (rcu_read_lock){......}, at: [<c05ab24c>] dev_pm_opp_init_cpufreq_table+0x18/0x10c
      Preemption disabled at:[<  (null)>]   (null)
      
      CPU: 2 PID: 80 Comm: modprobe Not tainted 3.16.0-rc3-next-20140701-00035-g286857f216aa-dirty #217
      [<c0214da8>] (unwind_backtrace) from [<c02123f8>] (show_stack+0x10/0x14)
      [<c02123f8>] (show_stack) from [<c070141c>] (dump_stack+0x70/0xbc)
      [<c070141c>] (dump_stack) from [<c02f4cb0>] (__kmalloc+0x124/0x250)
      [<c02f4cb0>] (__kmalloc) from [<c05ab270>] (dev_pm_opp_init_cpufreq_table+0x3c/0x10c)
      [<c05ab270>] (dev_pm_opp_init_cpufreq_table) from [<bf000508>] (cpufreq_init+0x48/0x378 [cpufreq_generic])
      [<bf000508>] (cpufreq_init [cpufreq_generic]) from [<c05a9e08>] (__cpufreq_add_dev.isra.22+0x200/0x92c)
      [<c05a9e08>] (__cpufreq_add_dev.isra.22) from [<c050c160>] (subsys_interface_register+0x84/0xc8)
      [<c050c160>] (subsys_interface_register) from [<c05a9494>] (cpufreq_register_driver+0x108/0x2d8)
      [<c05a9494>] (cpufreq_register_driver) from [<bf000888>] (generic_cpufreq_probe+0x50/0x74 [cpufreq_generic])
      [<bf000888>] (generic_cpufreq_probe [cpufreq_generic]) from [<c050e994>] (platform_drv_probe+0x18/0x48)
      [<c050e994>] (platform_drv_probe) from [<c050d1f4>] (driver_probe_device+0x128/0x370)
      [<c050d1f4>] (driver_probe_device) from [<c050d4d0>] (__driver_attach+0x94/0x98)
      [<c050d4d0>] (__driver_attach) from [<c050b778>] (bus_for_each_dev+0x54/0x88)
      [<c050b778>] (bus_for_each_dev) from [<c050c894>] (bus_add_driver+0xe8/0x204)
      [<c050c894>] (bus_add_driver) from [<c050dd48>] (driver_register+0x78/0xf4)
      [<c050dd48>] (driver_register) from [<c0208870>] (do_one_initcall+0xac/0x1d8)
      [<c0208870>] (do_one_initcall) from [<c028b6b4>] (load_module+0x190c/0x21e8)
      [<c028b6b4>] (load_module) from [<c028c034>] (SyS_init_module+0xa4/0x110)
      [<c028c034>] (SyS_init_module) from [<c020f0c0>] (ret_fast_syscall+0x0/0x48)
      
      Fixes: a0dd7b79
      
       (PM / OPP: Move cpufreq specific OPP functions out of generic OPP library)
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3c5445ce
    • Markus Pargmann's avatar
      cpufreq: cpu0: Do not print error message when deferring · 713a3fa6
      Markus Pargmann authored
      
      
      -EPROBE_DEFER is no real error. We are just waiting unti the necessary
      components are ready. The driver core infrastructure will also print an
      appropriate info message.
      
      This patch changes the error message to a debug message.
      
      Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      713a3fa6
    • Himangi Saraogi's avatar
      cpufreq: integrator: Use set_cpus_allowed_ptr · 18360d6e
      Himangi Saraogi authored
      
      
      Several years ago there was an effort to convert all uses of
      set_cpus_allowed to use set_cpus_allowed_ptr with the goal of eventually
      removing the current definition of set_cpus_allowed and renaming
      set_cpus_allowed_ptr as set_cpus_allowed
      (https://lkml.org/lkml/2010/3/26/59). This is another step in this
      direction.
      
      The Coccinelle semantic patch that makes this change is as follows:
      
      // <smpl>
      @@
      expression E1,E2;
      @@
      
      - set_cpus_allowed(E1, cpumask_of_cpu(E2))
      + set_cpus_allowed_ptr(E1, cpumask_of(E2))
      
      @@
      expression E;
      identifier I;
      @@
      
      - set_cpus_allowed(E, I)
      + set_cpus_allowed_ptr(E, &I)
      // </smpl>
      
      Signed-off-by: default avatarHimangi Saraogi <himangi774@gmail.com>
      Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      18360d6e
  2. Jul 21, 2014
  3. Jul 20, 2014
    • Richard Weinberger's avatar
      um: segv: Save regs only in case of a kernel mode fault · bb6a1b2e
      Richard Weinberger authored
      
      
      ...otherwise me lose user mode regs and the resulting
      stack trace is useless.
      
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      bb6a1b2e
    • Richard Weinberger's avatar
      um: Fix hung task in fix_range_common() · 468f6597
      Richard Weinberger authored
      
      
      If do_ops() fails we have to release current->mm->mmap_sem
      otherwise the failing task will never terminate.
      
      Reported-by: default avatarToralf Förster <toralf.foerster@gmx.de>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      468f6597
    • Richard Weinberger's avatar
      um: Ensure that a stub page cannot get unmapped · 284e6d39
      Richard Weinberger authored
      
      
      Trinity discovered an execution path such that a task
      can unmap his stub page.
      
      Reported-by: default avatarToralf Förster <toralf.foerster@gmx.de>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      284e6d39
    • Richard Weinberger's avatar
      Revert "um: Fix wait_stub_done() error handling" · ae5db6d1
      Richard Weinberger authored
      This reverts commit 0974a9ca
      
      .
      The real for for that issue is to release current->mm->mmap_sem in
      fix_range_common().
      
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      ae5db6d1
    • Eric Sandeen's avatar
      btrfs: test for valid bdev before kobj removal in btrfs_rm_device · 0bfaa9c5
      Eric Sandeen authored
      commit 99994cde
      
       btrfs: dev delete should remove sysfs entry
      added a btrfs_kobj_rm_device, which dereferences device->bdev...
      right after we check whether device->bdev might be NULL.
      
      I don't honestly know if it's possible to have a NULL device->bdev
      here, but assuming that it is (given the test), we need to move
      the kobject removal to be under that test.
      
      (Coverity spotted this)
      
      Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      0bfaa9c5
    • Liu Bo's avatar
      Btrfs: fix abnormal long waiting in fsync · 98ce2ded
      Liu Bo authored
      xfstests generic/127 detected this problem.
      
      With commit 7fc34a62
      
      , now fsync will only flush
      data within the passed range.  This is the cause of the above problem,
      -- btrfs's fsync has a stage called 'sync log' which will wait for all the
      ordered extents it've recorded to finish.
      
      In xfstests/generic/127, with mixed operations such as truncate, fallocate,
      punch hole, and mapwrite, we get some pre-allocated extents, and mapwrite will
      mmap, and then msync.  And I find that msync will wait for quite a long time
      (about 20s in my case), thanks to ftrace, it turns out that the previous
      fallocate calls 'btrfs_wait_ordered_range()' to flush dirty pages, but as the
      range of dirty pages may be larger than 'btrfs_wait_ordered_range()' wants,
      there can be some ordered extents created but not getting corresponding pages
      flushed, then they're left in memory until we fsync which runs into the
      stage 'sync log', and fsync will just wait for the system writeback thread
      to flush those pages and get ordered extents finished, so the latency is
      inevitable.
      
      This adds a flush similar to btrfs_start_ordered_extent() in
      btrfs_wait_logged_extents() to fix that.
      
      Reviewed-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      98ce2ded
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d0571909
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "The locking department delivers:
      
         - A rather large and intrusive bundle of fixes to address serious
           performance regressions introduced by the new rwsem / mcs
           technology.  Simpler solutions have been discussed, but they would
           have been ugly bandaids with more risk than doing the right thing.
      
         - Make the rwsem spin on owner technology opt-in for architectures
           and enable it only on the known to work ones.
      
         - A few fixes to the lockdep userspace library"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/rwsem: Add CONFIG_RWSEM_SPIN_ON_OWNER
        locking/mutex: Disable optimistic spinning on some architectures
        locking/rwsem: Reduce the size of struct rw_semaphore
        locking/rwsem: Rename 'activity' to 'count'
        locking/spinlocks/mcs: Micro-optimize osq_unlock()
        locking/spinlocks/mcs: Introduce and use init macro and function for osq locks
        locking/spinlocks/mcs: Convert osq lock to atomic_t to reduce overhead
        locking/spinlocks/mcs: Rename optimistic_spin_queue() to optimistic_spin_node()
        locking/rwsem: Allow conservative optimistic spinning when readers have lock
        tools/liblockdep: Account for bitfield changes in lockdeps lock_acquire
        tools/liblockdep: Remove debug print left over from development
        tools/liblockdep: Fix comparison of a boolean value with a value of 2
      d0571909
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d1743b81
      Linus Torvalds authored
      Pull scheduler fix from Thomas Gleixner:
       "Prevent a possible divide by zero in the debugging code"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched: Fix possible divide by zero in avg_atom() calculation
      d1743b81
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · cb20fd07
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "Three patches addressing shortcomings in the ARM gic interrupt chip
        driver"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip: gic: Fix core ID calculation when topology is read from DT
        irqchip: gic: Add binding probe for ARM GIC400
        irqchip: gic: Add support for cortex a7 compatible string
      cb20fd07
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b495c23c
      Linus Torvalds authored
      Pull timer fix from Thomas Gleixner:
       "A single fix for a long standing issue in the alarm timer subsystem,
        which was noticed recently when people finally started to use alarm
        timers for serious work"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        alarmtimer: Fix bug where relative alarm timers were treated as absolute
      b495c23c