1. 05 6月, 2014 21 次提交
  2. 01 6月, 2014 1 次提交
  3. 29 5月, 2014 1 次提交
    • S
      printk/of_serial: fix serial console cessation part way through boot. · 7fa21dd8
      Stephen Chivers 提交于
      Commit 5f5c9ae5
      "serial_core: Unregister console in uart_remove_one_port()"
      fixed a crash where a serial port was removed but
      not deregistered as a console.
      
      There is a side effect of that commit for platforms having serial consoles
      and of_serial configured (CONFIG_SERIAL_OF_PLATFORM). The serial console
      is disabled midway through the boot process.
      
      This cessation of the serial console affects PowerPC computers
      such as the MVME5100 and SAM440EP.
      
      The sequence is:
      
      	bootconsole [udbg0] enabled
      	....
      	serial8250/16550 driver initialises and registers its UARTS,
      	one of these is the serial console.
      	console [ttyS0] enabled
      	....
      	of_serial probes "platform" devices, registering them as it goes.
      	One of these is the serial console.
      	console [ttyS0] disabled.
      
      The disabling of the serial console is due to:
      
      	a.  unregister_console in printk not clearing the
      	    CONS_ENABLED bit in the console flags,
      	    even though it has announced that the console is disabled; and
      
      	b.  of_platform_serial_probe in of_serial not setting the port type
      	    before it registers with serial8250_register_8250_port.
      
      This patch ensures that the serial console is re-enabled when of_serial
      registers a serial port that corresponds to the designated console.
      Signed-off-by: NStephen Chivers <schivers@csc.com>
      Tested-by: NStephen Chivers <schivers@csc.com>
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [unregister_console]
      Cc: stable <stable@vger.kernel.org> # 3.15
      
      ===
      The above failure was identified in Linux-3.15-rc2.
      
      Tested using MVME5100 and SAM440EP PowerPC computers with
      kernels built from Linux-3.15-rc5 and tty-next.
      
      The continued operation of the serial console is vital for computers
      such as the MVME5100 as that Single Board Computer does not
      have any grapical/display hardware.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7fa21dd8
  4. 28 5月, 2014 3 次提交
    • T
      rtmutex: Fix deadlock detector for real · 397335f0
      Thomas Gleixner 提交于
      The current deadlock detection logic does not work reliably due to the
      following early exit path:
      
      	/*
      	 * Drop out, when the task has no waiters. Note,
      	 * top_waiter can be NULL, when we are in the deboosting
      	 * mode!
      	 */
      	if (top_waiter && (!task_has_pi_waiters(task) ||
      			   top_waiter != task_top_pi_waiter(task)))
      		goto out_unlock_pi;
      
      So this not only exits when the task has no waiters, it also exits
      unconditionally when the current waiter is not the top priority waiter
      of the task.
      
      So in a nested locking scenario, it might abort the lock chain walk
      and therefor miss a potential deadlock.
      
      Simple fix: Continue the chain walk, when deadlock detection is
      enabled.
      
      We also avoid the whole enqueue, if we detect the deadlock right away
      (A-A). It's an optimization, but also prevents that another waiter who
      comes in after the detection and before the task has undone the damage
      observes the situation and detects the deadlock and returns
      -EDEADLOCK, which is wrong as the other task is not in a deadlock
      situation.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/20140522031949.725272460@linutronix.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      397335f0
    • S
      powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode · 011e4b02
      Srivatsa S. Bhat 提交于
      If we try to perform a kexec when the machine is in ST (Single-Threaded) mode
      (ppc64_cpu --smt=off), the kexec operation doesn't succeed properly, and we
      get the following messages during boot:
      
      [    0.089866] POWER8 performance monitor hardware support registered
      [    0.089985] power8-pmu: PMAO restore workaround active.
      [    5.095419] Processor 1 is stuck.
      [   10.097933] Processor 2 is stuck.
      [   15.100480] Processor 3 is stuck.
      [   20.102982] Processor 4 is stuck.
      [   25.105489] Processor 5 is stuck.
      [   30.108005] Processor 6 is stuck.
      [   35.110518] Processor 7 is stuck.
      [   40.113369] Processor 9 is stuck.
      [   45.115879] Processor 10 is stuck.
      [   50.118389] Processor 11 is stuck.
      [   55.120904] Processor 12 is stuck.
      [   60.123425] Processor 13 is stuck.
      [   65.125970] Processor 14 is stuck.
      [   70.128495] Processor 15 is stuck.
      [   75.131316] Processor 17 is stuck.
      
      Note that only the sibling threads are stuck, while the primary threads (0, 8,
      16 etc) boot just fine. Looking closer at the previous step of kexec, we observe
      that kexec tries to wakeup (bring online) the sibling threads of all the cores,
      before performing kexec:
      
      [ 9464.131231] Starting new kernel
      [ 9464.148507] kexec: Waking offline cpu 1.
      [ 9464.148552] kexec: Waking offline cpu 2.
      [ 9464.148600] kexec: Waking offline cpu 3.
      [ 9464.148636] kexec: Waking offline cpu 4.
      [ 9464.148671] kexec: Waking offline cpu 5.
      [ 9464.148708] kexec: Waking offline cpu 6.
      [ 9464.148743] kexec: Waking offline cpu 7.
      [ 9464.148779] kexec: Waking offline cpu 9.
      [ 9464.148815] kexec: Waking offline cpu 10.
      [ 9464.148851] kexec: Waking offline cpu 11.
      [ 9464.148887] kexec: Waking offline cpu 12.
      [ 9464.148922] kexec: Waking offline cpu 13.
      [ 9464.148958] kexec: Waking offline cpu 14.
      [ 9464.148994] kexec: Waking offline cpu 15.
      [ 9464.149030] kexec: Waking offline cpu 17.
      
      Instrumenting this piece of code revealed that the cpu_up() operation actually
      fails with -EBUSY. Thus, only the primary threads of all the cores are online
      during kexec, and hence this is a sure-shot receipe for disaster, as explained
      in commit e8e5c215 (powerpc/kexec: Fix orphaned offline CPUs across kexec),
      as well as in the comment above wake_offline_cpus().
      
      It turns out that cpu_up() was returning -EBUSY because the variable
      'cpu_hotplug_disabled' was set to 1; and this disabling of CPU hotplug was done
      by migrate_to_reboot_cpu() inside kernel_kexec().
      
      Now, migrate_to_reboot_cpu() was originally written with the assumption that
      any further code will not need to perform CPU hotplug, since we are anyway in
      the reboot path. However, kexec is clearly not such a case, since we depend on
      onlining CPUs, atleast on powerpc.
      
      So re-enable cpu-hotplug after returning from migrate_to_reboot_cpu() in the
      kexec path, to fix this regression in kexec on powerpc.
      
      Also, wrap the cpu_up() in powerpc kexec code within a WARN_ON(), so that we
      can catch such issues more easily in the future.
      
      Fixes: c97102ba (kexec: migrate to reboot cpu)
      Cc: stable@vger.kernel.org
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      011e4b02
    • J
      kernfs: move the last knowledge of sysfs out from kernfs · 26fc9cd2
      Jianyu Zhan 提交于
      There is still one residue of sysfs remaining: the sb_magic
      SYSFS_MAGIC. However this should be kernfs user specific,
      so this patch moves it out. Kerrnfs user should specify their
      magic number while mouting.
      Signed-off-by: NJianyu Zhan <nasa4836@gmail.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      26fc9cd2
  5. 26 5月, 2014 3 次提交
    • R
      PM / sleep: Introduce command line argument for sleep state enumeration · 0399d4db
      Rafael J. Wysocki 提交于
      On some systems the platform doesn't support neither
      PM_SUSPEND_MEM nor PM_SUSPEND_STANDBY, so PM_SUSPEND_FREEZE is the
      only available system sleep state.  However, some user space frameworks
      only use the "mem" and (sometimes) "standby" sleep state labels, so
      the users of those systems need to modify user space in order to be
      able to use system suspend at all and that is not always possible.
      
      For this reason, add a new kernel command line argument,
      relative_sleep_states, allowing the users of those systems to change
      the way in which the kernel assigns labels to system sleep states.
      Namely, for relative_sleep_states=1, the "mem", "standby" and "freeze"
      labels will enumerate the available system sleem states from the
      deepest to the shallowest, respectively, so that "mem" is always
      present in /sys/power/state and the other state strings may or may
      not be presend depending on what is supported by the platform.
      
      Update system sleep states documentation to reflect this change.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0399d4db
    • R
      PM / sleep: Use valid_state() for platform-dependent sleep states only · 43e8317b
      Rafael J. Wysocki 提交于
      Use the observation that, for platform-dependent sleep states
      (PM_SUSPEND_STANDBY, PM_SUSPEND_MEM), a given state is either
      always supported or always unsupported and store that information
      in pm_states[] instead of calling valid_state() every time we
      need to check it.
      
      Also do not use valid_state() for PM_SUSPEND_FREEZE, which is always
      valid, and move the pm_test_level validity check for PM_SUSPEND_FREEZE
      directly into enter_state().
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      43e8317b
    • R
      PM / sleep: Add state field to pm_states[] entries · 27ddcc65
      Rafael J. Wysocki 提交于
      To allow sleep states corresponding to the "mem", "standby" and
      "freeze" lables to be different from the pm_states[] indexes of
      those strings, introduce struct pm_sleep_state, consisting of
      a string label and a state number, and turn pm_states[] into an
      array of objects of that type.
      
      This modification should not lead to any functional changes.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      27ddcc65
  6. 24 5月, 2014 1 次提交
    • B
      resources: Clarify sanity check message · e4c72966
      Bjorn Helgaas 提交于
      The resource map sanity check message is a bit confusing.  Change it to be
      more readable:
      
        -resource map sanity check conflict: 0xfed10000 0xfed15fff 0xfed10000 0xfed13fff pnp 00:01
        +resource sanity check: requesting [mem 0xfed10000-0xfed15fff], which spans more than pnp 00:01 [mem 0xfed10000-0xfed13fff]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      e4c72966
  7. 22 5月, 2014 10 次提交