1. 21 Jun, 2013 8 commits
  2. 20 Jun, 2013 12 commits
  3. 19 Jun, 2013 20 commits
    • Rafael J. Wysocki's avatar
      ACPI / LPSS: Power up LPSS devices during enumeration · b9e95fc6
      Rafael J. Wysocki authored
      Commit 7cd8407d (ACPI / PM: Do not execute _PS0 for devices without
      _PSC during initialization) introduced a regression on some systems
      with Intel Lynxpoint Low-Power Subsystem (LPSS) where some devices
      need to be powered up during initialization, but their device objects
      in the ACPI namespace have _PS0 and _PS3 only (without _PSC or power
      resources).
      
      To work around this problem, make the ACPI LPSS driver power up
      devices it knows about by using a new helper function
      acpi_device_fix_up_power() that does all of the necessary
      sanity checks and calls acpi_dev_pm_explicit_set() to put the
      device into D0.
      Reported-and-tested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b9e95fc6
    • Rafael J. Wysocki's avatar
      ACPI / PM: Fix error code path for power resources initialization · 6ee22e9d
      Rafael J. Wysocki authored
      Commit 781d737c (ACPI: Drop power resources driver) introduced a
      bug in the power resources initialization error code path causing
      a NULL pointer to be referenced in acpi_release_power_resource()
      if there's an error triggering a jump to the 'err' label in
      acpi_add_power_resource().  This happens because the list_node
      field of struct acpi_power_resource has not been initialized yet
      at this point and doing a list_del() on it is a bad idea.
      
      To prevent this problem from occuring, initialize the list_node
      field of struct acpi_power_resource upfront.
      Reported-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Tested-by: default avatarLan Tianyu <tianyu.lan@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: 3.9+ <stable@vger.kernel.org>
      Acked-by: default avatarYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      6ee22e9d
    • Rafael J. Wysocki's avatar
      ACPI / dock: Take ACPI scan lock in write_undock() · 8112006f
      Rafael J. Wysocki authored
      Since commit 3757b948 (ACPI / hotplug: Fix concurrency issues and
      memory leaks) acpi_bus_scan() and acpi_bus_trim() must always be
      called under acpi_scan_lock, but currently the following scenario
      violating that requirement is possible:
      
       write_undock()
        handle_eject_request()
         hotplug_dock_devices()
          dock_remove_acpi_device()
           acpi_bus_trim()
      
      Fix that by making write_undock() acquire acpi_scan_lock before
      calling handle_eject_request() as appropriate (begin_undock() is
      under the lock too in analogy with acpi_dock_deferred_cb()).
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: 3.9+ <stable@vger.kernel.org>
      Acked-by: default avatarToshi Kani <toshi.kani@hp.com>
      8112006f
    • Mika Westerberg's avatar
      ACPI / resources: call acpi_get_override_irq() only for legacy IRQ resources · 204ebc0a
      Mika Westerberg authored
      acpi_get_override_irq() was added because there was a problem with
      buggy BIOSes passing wrong IRQ() resource for the RTC IRQ.  The
      commit that added the workaround was 61fd47e0 (ACPI: fix two
      IRQ8 issues in IOAPIC mode).
      
      With ACPI 5 enumerated devices there are typically one or more
      extended IRQ resources per device (and these IRQs can be shared).
      However, the acpi_get_override_irq() workaround forces all IRQs in
      range 0 - 15 (the legacy ISA IRQs) to be edge triggered, active high
      as can be seen from the dmesg below:
      
      	ACPI: IRQ 6 override to edge, high
      	ACPI: IRQ 7 override to edge, high
      	ACPI: IRQ 7 override to edge, high
      	ACPI: IRQ 13 override to edge, high
      
      Also /proc/interrupts for the I2C controllers (INT33C2 and INT33C3) shows
      the same thing:
      
      	7:          4          0          0          0   IO-APIC-edge INT33C2:00, INT33C3:00
      
      The _CSR method for INT33C2 (and INT33C3) device returns following
      resource:
      
      	Interrupt (ResourceConsumer, Level, ActiveLow, Shared,,, )
      	{
      		0x00000007,
      	}
      
      which states that this is supposed to be level triggered, active low,
      shared IRQ instead.
      
      Fix this by making sure that acpi_get_override_irq() gets only called
      when we are dealing with legacy IRQ() or IRQNoFlags() descriptors.
      
      While we are there, correct pr_warning() to print the right triggering
      value.
      
      This change turns out to be necessary to make DMA work correctly on
      systems based on the Intel Lynxpoint PCH (Platform Controller Hub).
      
      [rjw: Changelog]
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: 3.9+ <stable@vger.kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      204ebc0a
    • Paul Gortmaker's avatar
      x86: Fix section mismatch on load_ucode_ap · 94978599
      Paul Gortmaker authored
      We are in the process of removing all the __cpuinit annotations.
      While working on making that change, an existing problem was
      made evident:
      
        WARNING: arch/x86/kernel/built-in.o(.text+0x198f2): Section mismatch
        in reference from the function cpu_init() to the function
        .init.text:load_ucode_ap()   The function cpu_init() references
        the function __init load_ucode_ap().  This is often because cpu_init
        lacks a __init annotation or the annotation of load_ucode_ap is wrong.
      
      This now appears because in my working tree, cpu_init() is no longer
      tagged as __cpuinit, and so the audit picks up the mismatch.  The 2nd
      hypothesis from the audit is the correct one, as there was an incorrect
      __init tag on the prototype in the header (but __cpuinit was used on
      the function itself.)
      
      The audit is telling us that the prototype's __init annotation took
      effect and the function did land in the .init.text section.  Checking
      with objdump on a mainline tree that still has __cpuinit shows that
      the __cpuinit on the function takes precedence over the __init on the
      prototype, but that won't be true once we make __cpuinit a no-op.
      
      Even though we are removing __cpuinit, we temporarily align both
      the function and the prototype on __cpuinit so that the changeset
      can be applied to stable trees  if desired.
      
      [ hpa: build fix only, no object code change ]
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: stable <stable@vger.kernel.org> # 3.9+
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Link: http://lkml.kernel.org/r/1371654926-11729-1-git-send-email-paul.gortmaker@windriver.comSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      94978599
    • David Daney's avatar
      mn10300: Fix include dependency in irqflags.h et al. · c0691143
      David Daney authored
      We need to pick up the definition of raw_smp_processor_id() from
      asm/smp.h.  For the !SMP case, we need to supply a definition of
      raw_smp_processor_id().
      
      Because of the include dependencies we cannot use smp_call_func_t in
      asm/smp.h, but we do need linux/thread_info.h
      Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c0691143
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · b9e763cd
      Linus Torvalds authored
      Pull sparc fixes from David Miller:
       "Various sparc bug fixes, in particular:
      
        1) TSB hashes have to be flushed before TLB on sparc64, from Dave
           Kleikamp.
      
        2) LEON timer interrupts can get stuck, from Andreas Larsson.
      
        3) Sparc64 needs to handle lack of address-congruence devicetree
           property, from Bob Picco"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc: tsb must be flushed before tlb
        sparc,leon: Convert to use devm_ioremap_resource
        sparc64 address-congruence property
        sparc32, leon: Enable interrupts before going idle to avoid getting stuck
        sparc32, leon: Remove separate "ticker" timer for SMP
        sparc: kernel: using strlcpy() instead of strcpy()
        arch: sparc: prom: looping issue, need additional length check in the outside looping
        sparc: remove inline marking of EXPORT_SYMBOL functions
        sparc: Switch to asm-generic/linkage.h
      b9e763cd
    • Linus Torvalds's avatar
      Merge branch 'parisc-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · aa4927b9
      Linus Torvalds authored
      Pull parisc fixes from Helge Deller:
       "This contains a kernel segfault fix when reading /proc/kpageflags or
        /proc/kpagecount, two fixes for the serial port and PCI graphic card
        support on C8000 workstations and a fix to use unshadowed registers
        for flushing D- and I-caches."
      
      * 'parisc-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Use unshadowed index register for flush instructions in flush_dcache_page_asm and flush_icache_page_asm
        parisc: provide pci_mmap_page_range() for parisc
        parisc: fix serial ports on C8000 workstation
        parisc: fix kernel BUG at arch/parisc/include/asm/mmzone.h:50 (part 2)
      aa4927b9
    • James Hogan's avatar
      metag: fix mm/hugetlb.c build breakage · 418a133b
      James Hogan authored
      Commit 106c992a ("mm/hugetlb: add more arch-defined huge_pte
      functions") added an include of <asm-generic/hugetlb.h> to each
      architecture's <asm/hugetlb.h> (except s390).  Unfortunately metag was
      missed which resulted in build errors when hugetlbfs is enabled (see
      below).
      
      Add the include for metag too to fix the build errors:
      
        mm/hugetlb.c In function 'make_huge_pte':
        mm/hugetlb.c +2250 : error: implicit declaration of function 'huge_pte_mkwrite'
        mm/hugetlb.c +2250 : error: implicit declaration of function 'huge_pte_mkdirty'
        ...
      Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
      Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      418a133b
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · 262fd6ff
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "The larger changes this time are
      
         - "ARM: 7755/1: handle user space mapped pages in flush_kernel_dcache_page"
           which fixes more data corruption problems with O_DIRECT
      
         - "ARM: 7759/1: decouple CPU offlining from reboot/shutdown" which
           gets us back to working shutdown/reboot on SMP platforms
      
         - "ARM: 7752/1: errata: LoUIS bit field in CLIDR register is incorrect"
           which fixes a shutdown regression found in v3.10 on Versatile
           Express platforms.
      
        The remainder are the quite small, maybe one or two line changes"
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7759/1: decouple CPU offlining from reboot/shutdown
        ARM: 7756/1: zImage/virt: remove hyp-stub.S during distclean
        ARM: 7755/1: handle user space mapped pages in flush_kernel_dcache_page
        ARM: 7754/1: Fix the CPU ID and the mask associated to the PJ4B
        ARM: 7753/1: map_init_section flushes incorrect pmd
        ARM: 7752/1: errata: LoUIS bit field in CLIDR register is incorrect
      262fd6ff
    • Steven Rostedt's avatar
      tracing/context-tracking: Add preempt_schedule_context() for tracing · 29bb9e5a
      Steven Rostedt authored
      Dave Jones hit the following bug report:
      
       ===============================
       [ INFO: suspicious RCU usage. ]
       3.10.0-rc2+ #1 Not tainted
       -------------------------------
       include/linux/rcupdate.h:771 rcu_read_lock() used illegally while idle!
       other info that might help us debug this:
       RCU used illegally from idle CPU! rcu_scheduler_active = 1, debug_locks = 0
       RCU used illegally from extended quiescent state!
       2 locks held by cc1/63645:
        #0:  (&rq->lock){-.-.-.}, at: [<ffffffff816b39fd>] __schedule+0xed/0x9b0
        #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8109d645>] cpuacct_charge+0x5/0x1f0
      
       CPU: 1 PID: 63645 Comm: cc1 Not tainted 3.10.0-rc2+ #1 [loadavg: 40.57 27.55 13.39 25/277 64369]
       Hardware name: Gigabyte Technology Co., Ltd. GA-MA78GM-S2H/GA-MA78GM-S2H, BIOS F12a 04/23/2010
        0000000000000000 ffff88010f78fcf8 ffffffff816ae383 ffff88010f78fd28
        ffffffff810b698d ffff88011c092548 000000000023d073 ffff88011c092500
        0000000000000001 ffff88010f78fd60 ffffffff8109d7c5 ffffffff8109d645
       Call Trace:
        [<ffffffff816ae383>] dump_stack+0x19/0x1b
        [<ffffffff810b698d>] lockdep_rcu_suspicious+0xfd/0x130
        [<ffffffff8109d7c5>] cpuacct_charge+0x185/0x1f0
        [<ffffffff8109d645>] ? cpuacct_charge+0x5/0x1f0
        [<ffffffff8108dffc>] update_curr+0xec/0x240
        [<ffffffff8108f528>] put_prev_task_fair+0x228/0x480
        [<ffffffff816b3a71>] __schedule+0x161/0x9b0
        [<ffffffff816b4721>] preempt_schedule+0x51/0x80
        [<ffffffff816b4800>] ? __cond_resched_softirq+0x60/0x60
        [<ffffffff816b6824>] ? retint_careful+0x12/0x2e
        [<ffffffff810ff3cc>] ftrace_ops_control_func+0x1dc/0x210
        [<ffffffff816be280>] ftrace_call+0x5/0x2f
        [<ffffffff816b681d>] ? retint_careful+0xb/0x2e
        [<ffffffff816b4805>] ? schedule_user+0x5/0x70
        [<ffffffff816b4805>] ? schedule_user+0x5/0x70
        [<ffffffff816b6824>] ? retint_careful+0x12/0x2e
       ------------[ cut here ]------------
      
      What happened was that the function tracer traced the schedule_user() code
      that tells RCU that the system is coming back from userspace, and to
      add the CPU back to the RCU monitoring.
      
      Because the function tracer does a preempt_disable/enable_notrace() calls
      the preempt_enable_notrace() checks the NEED_RESCHED flag. If it is set,
      then preempt_schedule() is called. But this is called before the user_exit()
      function can inform the kernel that the CPU is no longer in user mode and
      needs to be accounted for by RCU.
      
      The fix is to create a new preempt_schedule_context() that checks if
      the kernel is still in user mode and if so to switch it to kernel mode
      before calling schedule. It also switches back to user mode coming back
      from schedule in need be.
      
      The only user of this currently is the preempt_enable_notrace(), which is
      only used by the tracing subsystem.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1369423420.6828.226.camel@gandalf.local.homeSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      29bb9e5a
    • Vincent Guittot's avatar
      sched: Fix clear NOHZ_BALANCE_KICK · 873b4c65
      Vincent Guittot authored
      I have faced a sequence where the Idle Load Balance was sometime not
      triggered for a while on my platform, in the following scenario:
      
       CPU 0 and CPU 1 are running tasks and CPU 2 is idle
      
       CPU 1 kicks the Idle Load Balance
       CPU 1 selects CPU 2 as the new Idle Load Balancer
       CPU 2 sets NOHZ_BALANCE_KICK for CPU 2
       CPU 2 sends a reschedule IPI to CPU 2
      
       While CPU 3 wakes up, CPU 0 or CPU 1 migrates a waking up task A on CPU 2
      
       CPU 2 finally wakes up, runs task A and discards the Idle Load Balance
             task A quickly goes back to sleep (before a tick occurs on CPU 2)
       CPU 2 goes back to idle with NOHZ_BALANCE_KICK set
      
      Whenever CPU 2 will be selected as the ILB, no reschedule IPI will be sent
      because NOHZ_BALANCE_KICK is already set and no Idle Load Balance will be
      performed.
      
      We must wait for the sched softirq to be raised on CPU 2 thanks to another
      part the kernel to come back to clear NOHZ_BALANCE_KICK.
      
      The proposed solution clears NOHZ_BALANCE_KICK in schedule_ipi if
      we can't raise the sched_softirq for the Idle Load Balance.
      
      Change since V1:
      
      - move the clear of NOHZ_BALANCE_KICK in got_nohz_idle_kick if the ILB
        can't run on this CPU (as suggested by Peter)
      Signed-off-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1370419991-13870-1-git-send-email-vincent.guittot@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      873b4c65
    • Stephane Eranian's avatar
      perf/x86: Fix broken PEBS-LL support on SNB-EP/IVB-EP · f1a52789
      Stephane Eranian authored
      This patch fixes broken support of PEBS-LL on SNB-EP/IVB-EP.
      For some reason, the LDLAT extra reg definition for snb_ep
      showed up as duplicate in the snb table.
      
      This patch moves the definition of LDLAT back into the
      snb_ep table.
      
      Thanks to Don Zickus for tracking this one down.
      Signed-off-by: default avatarStephane Eranian <eranian@google.com>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20130607212210.GA11849@quadSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      f1a52789
    • Peter Zijlstra's avatar
      perf: Fix mmap() accounting hole · 9bb5d40c
      Peter Zijlstra authored
      Vince's fuzzer once again found holes. This time it spotted a leak in
      the locked page accounting.
      
      When an event had redirected output and its close() was the last
      reference to the buffer we didn't have a vm context to undo accounting.
      
      Change the code to destroy the buffer on the last munmap() and detach
      all redirected events at that time. This provides us the right context
      to undo the vm accounting.
      Reported-and-tested-by: default avatarVince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20130604084421.GI8923@twins.programming.kicks-ass.net
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9bb5d40c
    • Igor Mammedov's avatar
      x86: kvmclock: zero initialize pvclock shared memory area · 07868fc6
      Igor Mammedov authored
      kernel might hung in pvclock_clocksource_read() due to
      uninitialized memory might contain odd version value in
      following cycle:
      
              do {
                      version = __pvclock_read_cycles(src, &ret, &flags);
              } while ((src->version & 1) || version != src->version);
      
      if secondary kvmclock is accessed before it's registered with kvm.
      
      Clear garbage in pvclock shared memory area right after it's
      allocated to avoid this issue.
      
      Ref: https://bugzilla.kernel.org/show_bug.cgi?id=59521Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
      [See BZ for analysis.  We may want a different fix for 3.11, but
       this is the safest for now - Paolo]
      Cc: <stable@vger.kernel.org> # 3.8
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      07868fc6
    • Scott Wood's avatar
      kvm/ppc/booke: Delay kvmppc_lazy_ee_enable · f8941fbe
      Scott Wood authored
      kwmppc_lazy_ee_enable() should be called as late as possible,
      or else we get things like WARN_ON(preemptible()) in enable_kernel_fp()
      in configurations where preemptible() works.
      
      Note that book3s_pr already waits until just before __kvmppc_vcpu_run
      to call kvmppc_lazy_ee_enable().
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f8941fbe
    • Dave Kleikamp's avatar
      sparc: tsb must be flushed before tlb · 23a01138
      Dave Kleikamp authored
      This fixes a race where a cpu may re-load a tlb from a stale tsb right
      after it has been flushed by a remote function call.
      
      I still see some instability when stressing the system with parallel
      kernel builds while creating memory pressure by writing to
      /proc/sys/vm/nr_hugepages, but this patch improves the stability
      significantly.
      Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
      Acked-by: default avatarBob Picco <bob.picco@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23a01138
    • Tushar Behera's avatar
      sparc,leon: Convert to use devm_ioremap_resource · f670758f
      Tushar Behera authored
      Commit 75096579 ("lib: devres: Introduce devm_ioremap_resource()")
      introduced devm_ioremap_resource() and deprecated the use of
      devm_request_and_ioremap().
      
      While at it, also remove the error message as devm_ioremap_resource()
      also prints similar error message.
      Signed-off-by: default avatarTushar Behera <tushar.behera@linaro.org>
      CC: sparclinux@vger.kernel.org
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f670758f
    • bob picco's avatar
      sparc64 address-congruence property · 771a37ff
      bob picco authored
      The Machine Description (MD) property "address-congruence-offset" is
      optional. According to the MD specification the value is assumed 0UL when
      not present. This caused early boot failure on T5.
      Signed-off-by: default avatarBob Picco <bob.picco@oracle.com>
      CC: sparclinux@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      771a37ff
    • Andreas Larsson's avatar
      sparc32, leon: Enable interrupts before going idle to avoid getting stuck · d72ee6be
      Andreas Larsson authored
      This enables interrupts for Leon before having the CPU enter power-down mode.
      
      Commit 87fa05ae, "sparc: Use generic idle loop",
      gets the CPU stuck on idle for Leon systems. On Leon, disabling interrupts and
      powering down the processor will get the processor stuck waiting for an
      interrupt that will never be reacted to.
      Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d72ee6be