1. 01 May, 2014 9 commits
  2. 30 Apr, 2014 10 commits
    • Vineet Gupta's avatar
      ARC: !PREEMPT: Ensure Return to kernel mode is IRQ safe · 8aa9e85a
      Vineet Gupta authored
      There was a very small race window where resume to kernel mode from a
      Exception Path (or pure kernel mode which is true for most of ARC
      exceptions anyways), was not disabling interrupts in restore_regs,
      clobbering the exception regs
      
      Anton found the culprit call flow (after many sleepless nights)
      
      | 1. we got a Trap from user land
      | 2. started to service it.
      | 3. While doing some stuff on user-land memory (I think it is padzero()),
      |     we got a DataTlbMiss
      | 4. On return from it we are taking "resume_kernel_mode" path
      | 5. NEED_RESHED is not set, so we go to "return from exception" path in
      |     restore regs.
      | 6. there seems to be IRQ happening
      Signed-off-by: default avatarVineet Gupta <vgupta@synopsys.com>
      Cc: <stable@vger.kernel.org>   #3.10, 3.12, 3.13, 3.14
      Cc: Anton Kolesov <Anton.Kolesov@synopsys.com>
      Cc: Francois Bedard <Francois.Bedard@synopsys.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8aa9e85a
    • Linus Torvalds's avatar
      Merge tag 'sound-3.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 71dc96e3
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A few collections of small eggs that have been gathered during the
        Easter holidays.  Mostly small ASoC fixes, with a HD-audio quirk and a
        workaround for Nvidia controller"
      
      * tag 'sound-3.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda - Suppress CORBRP clear on Nvidia controller chips
        ALSA: hda - add headset mic detect quirk for a Dell laptop
        ASoC: jz4740: Remove Makefile entry for removed file
        ASoC: Intel: Fix audio crash due to negative address offset
        ASoC: dapm: Fix widget double free with auto-disable DAPM kcontrol
        ASoC: Intel: Fix incorrect sizeof() in sst_hsw_stream_get_volume()
        ASoC: Intel: some incorrect sizeof() usages
        ASoC: cs42l73: Convert to use devm_gpio_request_one
        ASoC: cs42l52: Convert to use devm_gpio_request_one
        ASoC: tlv320aic31xx: document that the regulators are mandatory
        ASoC: fsl_spdif: Fix wrong OFFSET of STC_SYSCLK_DIV
        ASoC: alc5623: Fix regmap endianness
        ASoC: tlv320aic3x: fix shared reset pin for DT
        ASoC: rsnd: fix clock prepare/unprepare
      71dc96e3
    • Jiri Olsa's avatar
      perf tests x86: Fix stack map lookup in dwarf unwind test · 9a126728
      Jiri Olsa authored
      Previous commit 'perf x86: Fix perf to use non-executable stack, again'
      moved stack map into MAP__VARIABLE map type again. Fixing the dwarf
      unwind test stack map lookup appropriately.
      
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Link: http://lkml.kernel.org/n/tip-ttzyhbe4zls24z7ednkmhvxl@git.kernel.orgSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      9a126728
    • Mathias Krause's avatar
      perf x86: Fix perf to use non-executable stack, again · 6392b4eb
      Mathias Krause authored
      arch/x86/tests/regs_load.S is missing the linker note about the stack
      requirements, therefore making the linker fall back to an executable
      stack. As this object gets linked against the final perf binary, it'll
      needlessly end up with an executable stack. Fix this by adding the
      appropriate linker note.
      
      Also add a global linker flag to prevent future regressions, as
      suggested by Jiri. This way perf won't get an executable stack even if
      we fail to add the .GNU-stack linker note to future assembler files.
      Though, doing so might create regressions the other way around, when
      (statically) linking against libraries needing an executable stack.
      But, apparently, regressing in that direction is wanted as it is an
      indicator of poor code quality -- or just missing linker notes.
      
      Fixes: 3c8b06f9 ("perf tests x86: Introduce perf_regs_load function")
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1398617466-22749-1-git-send-email-minipli@googlemail.comSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      6392b4eb
    • Xia Kaixu's avatar
      perf tools: Remove extra '/' character in events file path · 603940b6
      Xia Kaixu authored
      The array debugfs_known_mountpoints[] will cause extra '/'
      character output.
      Remove it.
      
      pre:
      $ perf probe -l
      /sys/kernel/debug//tracing/uprobe_events file does not exist -
      please rebuild kernel with CONFIG_UPROBE_EVENTS.
      
      post:
      $ perf probe -l
      /sys/kernel/debug/tracing/uprobe_events file does not exist -
      please rebuild kernel with CONFIG_UPROBE_EVENTS.
      Signed-off-by: default avatarXia Kaixu <xiakaixu@huawei.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/535B6660.2060001@huawei.comSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      603940b6
    • Richard Yao's avatar
      perf machine: Search for modules in %s/lib/modules/%s · 61d4290c
      Richard Yao authored
      Modules installed outside of the kernel's build system should go into
      "%s/lib/modules/%s/extra", but at present, perf will only look at them
      when they are in "%s/lib/modules/%s/kernel". Lets encourage good
      citizenship by relaxing this requirement to "%s/lib/modules/%s". This
      way open source modules that are out-of-tree have no incentive to start
      populating a directory reserved for in-kernel modules and I can stop
      hex-editing my system's perf binary when profiling OSS out-of-tree
      modules.
      
      Feedback from Namhyung Kim correctly revealed that the hex-edits that I
      had been doing meant that perf was also traversing the build and source
      symlinks in %s/lib/modules/%s. That is undesireable, so we explicitly
      exclude them from traversal with a minor tweak to the traversal routine.
      Signed-off-by: default avatarRichard Yao <ryao@gentoo.org>
      Acked-by: default avatarNamhyung kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1398532675-13684-1-git-send-email-ryao@gentoo.orgSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      61d4290c
    • Jiri Olsa's avatar
      perf tests: Add static build make test · 611ec127
      Jiri Olsa authored
      Adding test for building static perf build into the automated
      suite. Also available via following commands:
      
        $ make -f tests/make make_static
        - make_static: cd . && make -f Makefile DESTDIR=/tmp/tmp.7u5MlB4njo LDFLAGS=-static
        $ make -f tests/make make_static_O
        - make_static_O: cd . && make -f Makefile O=/tmp/tmp.Ay6r3wEmtX DESTDIR=/tmp/tmp.vK0KQwO0Vi LDFLAGS=-static
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1398760413-7574-1-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      611ec127
    • Jiri Olsa's avatar
      perf tools: Fix bfd dependency libraries detection · 2cf90407
      Jiri Olsa authored
      There's false assumption in the library detection code
      assuming -liberty and -lz are always present once bfd
      is detected. The fails on Ubuntu (14.04) as reported
      by Ingo.
      
      Forcing the bdf dependency libraries detection any
      time bfd library is detected.
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Tested-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1398676935-6615-1-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      2cf90407
    • Jiri Olsa's avatar
      perf tools: Use LDFLAGS instead of ALL_LDFLAGS · e27a08f5
      Jiri Olsa authored
      We no longer use ALL_LDFLAGS, Replacing with LDFLAGS.
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1398675770-3109-1-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      e27a08f5
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · ed8c37e1
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Smattering of fixes, i915, exynos, tegra, msm, vmwgfx.
      
        A bit of framebuffer reference counting fallout fixes, i915 GM45
        regression fix, DVI regression fix, vmware info leak between processes
        fix"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/exynos: use %pad for dma_addr_t
        drm/exynos: dsi: use IS_ERR() to check devm_ioremap_resource() results
        MAINTAINERS: update maintainer entry for Exynos DP driver
        drm/exynos: balance framebuffer refcount
        drm/i915: Move all ring resets before setting the HWS page
        drm/i915: Don't WARN nor handle unexpected hpd interrupts on gmch platforms
        drm/msm/mdp4: cure for the cursor blues (v2)
        drm/msm: default to XR24 rather than AR24
        drm/msm: fix memory leak
        drm/tegra: restrict plane loops to legacy planes
        drm/i915: Allow full PPGTT with param override
        drm/i915: Discard BIOS framebuffers too small to accommodate chosen mode
        drm/vmwgfx: Make sure user-space can't DMA across buffer object boundaries v2
        drm/i915: get power domain in case the BIOS enabled eDP VDD
        drm/i915: Don't check gmch state on inherited configs
        drm/i915: Allow user modes to exceed DVI 165MHz limit
      ed8c37e1
  3. 29 Apr, 2014 6 commits
  4. 28 Apr, 2014 15 commits
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.15-rc2' of... · 2aafe1a4
      Linus Torvalds authored
      Merge tag 'trace-fixes-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
      
      Pull ftrace bugfix from Steven Rostedt:
       "Takao Indoh reported that he was able to cause a ftrace bug while
        loading a module and enabling function tracing at the same time.
      
        He uncovered a race where the module when loaded will convert the
        calls to mcount into nops, and expects the module's text to be RW.
        But when function tracing is enabled, it will convert all kernel text
        (core and module) from RO to RW to convert the nops to calls to ftrace
        to record the function.  After the convertion, it will convert all the
        text back from RW to RO.
      
        The issue is, it will also convert the module's text that is loading.
        If it converts it to RO before ftrace does its conversion, it will
        cause ftrace to fail and require a reboot to fix it again.
      
        This patch moves the ftrace module update that converts calls to
        mcount into nops to be done when the module state is still
        MODULE_STATE_UNFORMED.  This will ignore the module when the text is
        being converted from RW back to RO"
      
      * tag 'trace-fixes-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace/module: Hardcode ftrace_module_init() call into load_module()
      2aafe1a4
    • Linus Torvalds's avatar
      Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux · 87c7662b
      Linus Torvalds authored
      Pull devicetree bug fixes from Grant Likely:
       "These are some important bug fixes that need to get into v3.15.
      
        This branch contains a pair of important bug fixes for the DT code:
      
         - Fix some incorrect binding property names before they enter common
           usage
      
         - Fix bug where some platform devices will be unable to get their
           interrupt number when they depend on an interrupt controller that
           is not available at device creation time.  This is a problem
           causing mainline to fail on a number of ARM platforms"
      
      * tag 'dt-for-linus' of git://git.secretlab.ca/git/linux:
        of/irq: do irq resolution in platform_get_irq
        of: selftest: add deferred probe interrupt test
        dt: Fix binding typos in clock-names and interrupt-names
      87c7662b
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 838b4c02
      Linus Torvalds authored
      Pull powerpc fixes from Ben Herrenschmidt:
       "Here is a bunch of post-merge window fixes that have been accumulating
        in patchwork while I was on vacation or buried under other stuff last
        week.
      
        We have the now usual batch of LE fixes from Anton (sadly some new
        stuff that went into this merge window had endian issues, we'll try to
        make sure we do better next time)
      
        Some fixes and cleanups to the new 24x7 performance monitoring stuff
        (mostly typos and cleaning up printk's)
      
        A series of fixes for an issue with our runlatch bit, which wasn't set
        properly for offlined threads/cores and under KVM, causing potentially
        some counters to misbehave along with possible power management
        issues.
      
        A fix for kexec nasty race where the new kernel wouldn't "see" the
        secondary processors having reached back into firmware in time.
      
        And finally a few other misc (and pretty simple) bug fixes"
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (33 commits)
        powerpc/4xx: Fix section mismatch in ppc4xx_pci.c
        ppc/kvm: Clear the runlatch bit of a vcpu before napping
        ppc/kvm: Set the runlatch bit of a CPU just before starting guest
        ppc/powernv: Set the runlatch bits correctly for offline cpus
        powerpc/pseries: Protect remove_memory() with device hotplug lock
        powerpc: Fix error return in rtas_flash module init
        powerpc: Bump BOOT_COMMAND_LINE_SIZE to 2048
        powerpc: Bump COMMAND_LINE_SIZE to 2048
        powerpc: Rename duplicate COMMAND_LINE_SIZE define
        powerpc/perf/hv-24x7: Catalog version number is be64, not be32
        powerpc/perf/hv-24x7: Remove [static 4096], sparse chokes on it
        powerpc/perf/hv-24x7: Use (unsigned long) not (u32) values when calling plpar_hcall_norets()
        powerpc/perf/hv-gpci: Make device attr static
        powerpc/perf/hv_gpci: Probe failures use pr_debug(), and padding reduced
        powerpc/perf/hv_24x7: Probe errors changed to pr_debug(), padding fixed
        powerpc/mm: Fix tlbie to add AVAL fields for 64K pages
        powerpc/powernv: Fix little endian issues in OPAL dump code
        powerpc/powernv: Create OPAL sglist helper functions and fix endian issues
        powerpc/powernv: Fix little endian issues in OPAL error log code
        powerpc/powernv: Fix little endian issues with opal_do_notifier calls
        ...
      838b4c02
    • Linus Torvalds's avatar
      mm: don't pointlessly use BUG_ON() for sanity check · 50f5aa8a
      Linus Torvalds authored
      BUG_ON() is a big hammer, and should be used _only_ if there is some
      major corruption that you cannot possibly recover from, making it
      imperative that the current process (and possibly the whole machine) be
      terminated with extreme prejudice.
      
      The trivial sanity check in the vmacache code is *not* such a fatal
      error.  Recovering from it is absolutely trivial, and using BUG_ON()
      just makes it harder to debug for no actual advantage.
      
      To make matters worse, the placement of the BUG_ON() (only if the range
      check matched) actually makes it harder to hit the sanity check to begin
      with, so _if_ there is a bug (and we just got a report from Srivatsa
      Bhat that this can indeed trigger), it is harder to debug not just
      because the machine is possibly dead, but because we don't have better
      coverage.
      
      BUG_ON() must *die*.  Maybe we should add a checkpatch warning for it,
      because it is simply just about the worst thing you can ever do if you
      hit some "this cannot happen" situation.
      Reported-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Cc: Davidlohr Bueso <davidlohr@hp.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      50f5aa8a
    • Steven Rostedt (Red Hat)'s avatar
      ftrace/module: Hardcode ftrace_module_init() call into load_module() · a949ae56
      Steven Rostedt (Red Hat) authored
      A race exists between module loading and enabling of function tracer.
      
      	CPU 1				CPU 2
      	-----				-----
        load_module()
         module->state = MODULE_STATE_COMING
      
      				register_ftrace_function()
      				 mutex_lock(&ftrace_lock);
      				 ftrace_startup()
      				  update_ftrace_function();
      				   ftrace_arch_code_modify_prepare()
      				    set_all_module_text_rw();
      				   <enables-ftrace>
      				    ftrace_arch_code_modify_post_process()
      				     set_all_module_text_ro();
      
      				[ here all module text is set to RO,
      				  including the module that is
      				  loading!! ]
      
         blocking_notifier_call_chain(MODULE_STATE_COMING);
          ftrace_init_module()
      
           [ tries to modify code, but it's RO, and fails!
             ftrace_bug() is called]
      
      When this race happens, ftrace_bug() will produces a nasty warning and
      all of the function tracing features will be disabled until reboot.
      
      The simple solution is to treate module load the same way the core
      kernel is treated at boot. To hardcode the ftrace function modification
      of converting calls to mcount into nops. This is done in init/main.c
      there's no reason it could not be done in load_module(). This gives
      a better control of the changes and doesn't tie the state of the
      module to its notifiers as much. Ftrace is special, it needs to be
      treated as such.
      
      The reason this would work, is that the ftrace_module_init() would be
      called while the module is in MODULE_STATE_UNFORMED, which is ignored
      by the set_all_module_text_ro() call.
      
      Link: http://lkml.kernel.org/r/1395637826-3312-1-git-send-email-indou.takao@jp.fujitsu.comReported-by: default avatarTakao Indoh <indou.takao@jp.fujitsu.com>
      Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@vger.kernel.org # 2.6.38+
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      a949ae56
    • Hui Wang's avatar
      ALSA: hda - add headset mic detect quirk for a Dell laptop · e32dfbed
      Hui Wang authored
      When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0255,
      SID: 0x10280674), the headset mic can't be detected, after apply this
      patch, the headset mic can work well.
      
      BugLink: https://bugs.launchpad.net/bugs/1297581
      Cc: David Henningsson <david.henningsson@canonical.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHui Wang <hui.wang@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e32dfbed
    • Takashi Iwai's avatar
      Merge tag 'asoc-v3.15-rc2' of... · 474a5961
      Takashi Iwai authored
      Merge tag 'asoc-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v3.15
      
      A smattering of driver-specific fixes here, nothing generic.  The Cirrus
      CODEC conversions to devm_ are leak fixes - the conversion adds missing
      error handling code.
      474a5961
    • Alistair Popple's avatar
      powerpc/4xx: Fix section mismatch in ppc4xx_pci.c · e4565362
      Alistair Popple authored
      This patch fixes this section mismatch:
      
      WARNING: vmlinux.o(.text+0x1efc4): Section mismatch in reference from
      the function apm821xx_pciex_init_port_hw() to the function
      .init.text:ppc4xx_pciex_wait_on_sdr.isra.9()
      
      The function apm821xx_pciex_init_port_hw() references the function
      __init ppc4xx_pciex_wait_on_sdr.isra.9().  This is often because
      apm821xx_pciex_init_port_hw lacks a __init annotation or the
      annotation of ppc4xx_pciex_wait_on_sdr.isra.9 is wrong.
      
      apm821xx_pciex_init_port_hw is only referenced by a struct in
      __initdata, so it should be safe to add __init to
      apm821xx_pciex_init_port_hw.
      Signed-off-by: default avatarAlistair Popple <alistair@popple.id.au>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e4565362
    • Preeti U Murthy's avatar
      ppc/kvm: Clear the runlatch bit of a vcpu before napping · 582b910e
      Preeti U Murthy authored
      When the guest cedes the vcpu or the vcpu has no guest to
      run it naps. Clear the runlatch bit of the vcpu before
      napping to indicate an idle cpu.
      Signed-off-by: default avatarPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Reviewed-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      582b910e
    • Preeti U Murthy's avatar
      ppc/kvm: Set the runlatch bit of a CPU just before starting guest · fd17dc7b
      Preeti U Murthy authored
      The secondary threads in the core are kept offline before launching guests
      in kvm on powerpc: "371fefd6:KVM: PPC: Allow book3s_hv guests to use
      SMT processor modes."
      
      Hence their runlatch bits are cleared. When the secondary threads are called
      in to start a guest, their runlatch bits need to be set to indicate that they
      are busy. The primary thread has its runlatch bit set though, but there is no
      harm in setting this bit once again. Hence set the runlatch bit for all
      threads before they start guest.
      Signed-off-by: default avatarPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Reviewed-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      fd17dc7b
    • Preeti U Murthy's avatar
      ppc/powernv: Set the runlatch bits correctly for offline cpus · f2038911
      Preeti U Murthy authored
      Up until now we have been setting the runlatch bits for a busy CPU and
      clearing it when a CPU enters idle state. The runlatch bit has thus
      been consistent with the utilization of a CPU as long as the CPU is online.
      
      However when a CPU is hotplugged out the runlatch bit is not cleared. It
      needs to be cleared to indicate an unused CPU. Hence this patch has the
      runlatch bit cleared for an offline CPU just before entering an idle state
      and sets it immediately after it exits the idle state.
      Signed-off-by: default avatarPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Reviewed-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f2038911
    • Li Zhong's avatar
      powerpc/pseries: Protect remove_memory() with device hotplug lock · 42dbfc86
      Li Zhong authored
      While testing memory hot-remove, I found following dead lock:
      
      Process #1141 is drmgr, trying to remove some memory, i.e. memory499.
      It holds the memory_hotplug_mutex, and blocks when trying to remove file
      "online" under dir memory499, in kernfs_drain(), at
              wait_event(root->deactivate_waitq,
                         atomic_read(&kn->active) == KN_DEACTIVATED_BIAS);
      
      Process #1120 is trying to online memory499 by
         echo 1 > memory499/online
      
      In .kernfs_fop_write, it uses kernfs_get_active() to increase
      &kn->active, thus blocking process #1141. While itself is blocked later
      when trying to acquire memory_hotplug_mutex, which is held by process
      
      The backtrace of both processes are shown below:
      
      [<c000000001b18600>] 0xc000000001b18600
      [<c000000000015044>] .__switch_to+0x144/0x200
      [<c000000000263ca4>] .online_pages+0x74/0x7b0
      [<c00000000055b40c>] .memory_subsys_online+0x9c/0x150
      [<c00000000053cbe8>] .device_online+0xb8/0x120
      [<c00000000053cd04>] .online_store+0xb4/0xc0
      [<c000000000538ce4>] .dev_attr_store+0x64/0xa0
      [<c00000000030f4ec>] .sysfs_kf_write+0x7c/0xb0
      [<c00000000030e574>] .kernfs_fop_write+0x154/0x1e0
      [<c000000000268450>] .vfs_write+0xe0/0x260
      [<c000000000269144>] .SyS_write+0x64/0x110
      [<c000000000009ffc>] syscall_exit+0x0/0x7c
      
      [<c000000001b18600>] 0xc000000001b18600
      [<c000000000015044>] .__switch_to+0x144/0x200
      [<c00000000030be14>] .__kernfs_remove+0x204/0x300
      [<c00000000030d428>] .kernfs_remove_by_name_ns+0x68/0xf0
      [<c00000000030fb38>] .sysfs_remove_file_ns+0x38/0x60
      [<c000000000539354>] .device_remove_attrs+0x54/0xc0
      [<c000000000539fd8>] .device_del+0x158/0x250
      [<c00000000053a104>] .device_unregister+0x34/0xa0
      [<c00000000055bc14>] .unregister_memory_section+0x164/0x170
      [<c00000000024ee18>] .__remove_pages+0x108/0x4c0
      [<c00000000004b590>] .arch_remove_memory+0x60/0xc0
      [<c00000000026446c>] .remove_memory+0x8c/0xe0
      [<c00000000007f9f4>] .pseries_remove_memblock+0xd4/0x160
      [<c00000000007fcfc>] .pseries_memory_notifier+0x27c/0x290
      [<c0000000008ae6cc>] .notifier_call_chain+0x8c/0x100
      [<c0000000000d858c>] .__blocking_notifier_call_chain+0x6c/0xe0
      [<c00000000071ddec>] .of_property_notify+0x7c/0xc0
      [<c00000000071ed3c>] .of_update_property+0x3c/0x1b0
      [<c0000000000756cc>] .ofdt_write+0x3dc/0x740
      [<c0000000002f60fc>] .proc_reg_write+0xac/0x110
      [<c000000000268450>] .vfs_write+0xe0/0x260
      [<c000000000269144>] .SyS_write+0x64/0x110
      [<c000000000009ffc>] syscall_exit+0x0/0x7c
      
      This patch uses lock_device_hotplug() to protect remove_memory() called
      in pseries_remove_memblock(), which is also stated before function
      remove_memory():
      
       * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
       * and online/offline operations before this call, as required by
       * try_offline_node().
       */
      void __ref remove_memory(int nid, u64 start, u64 size)
      
      With this lock held, the other process(#1120 above) trying to online the
      memory block will retry the system call when calling
      lock_device_hotplug_sysfs(), and finally find No such device error.
      Signed-off-by: default avatarLi Zhong <zhong@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      42dbfc86
    • Anton Blanchard's avatar
      powerpc: Fix error return in rtas_flash module init · 0c930692
      Anton Blanchard authored
      module_init should return 0 or a negative errno.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0c930692
    • Anton Blanchard's avatar
      powerpc: Bump BOOT_COMMAND_LINE_SIZE to 2048 · 579a53ca
      Anton Blanchard authored
      Bump the boot wrapper BOOT_COMMAND_LINE_SIZE to match the
      kernel.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      579a53ca
    • Anton Blanchard's avatar
      powerpc: Bump COMMAND_LINE_SIZE to 2048 · a5980d06
      Anton Blanchard authored
      I've had a report that the current limit is too small for
      an automated network based installer. Bump it.
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a5980d06