03 Aug, 2011

2 commits

  • Cmpxchg is used to implement adding new entry to the list, deleting
    all entries from the list, deleting first entry of the list and some
    other operations.

    Because this is a single list, so the tail can not be accessed in O(1).

    If there are multiple producers and multiple consumers, llist_add can
    be used in producers and llist_del_all can be used in consumers. They
    can work simultaneously without lock. But llist_del_first can not be
    used here. Because llist_del_first depends on list->first->next does
    not changed if list->first is not changed during its operation, but
    llist_del_first, llist_add, llist_add (or llist_del_all, llist_add,
    llist_add) sequence in another consumer may violate that.

    If there are multiple producers and one consumer, llist_add can be
    used in producers and llist_del_all or llist_del_first can be used in
    the consumer.

    This can be summarized as follow:

    | add | del_first | del_all
    add | - | - | -
    del_first | | L | L
    del_all | | | -

    Where "-" stands for no lock is needed, while "L" stands for lock is
    needed.

    The list entries deleted via llist_del_all can be traversed with
    traversing function such as llist_for_each etc. But the list entries
    can not be traversed safely before deleted from the list. The order
    of deleted entries is from the newest to the oldest added one. If you
    want to traverse from the oldest to the newest, you must reverse the
    order by yourself before traversing.

    The basic atomic operation of this list is cmpxchg on long. On
    architectures that don't have NMI-safe cmpxchg implementation, the
    list can NOT be used in NMI handler. So code uses the list in NMI
    handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Mathieu Desnoyers
    Cc: Andrew Morton
    Signed-off-by: Len Brown

    Huang Ying
     
  • cmpxchg() is widely used by lockless code, including NMI-safe lockless
    code. But on some architectures, the cmpxchg() implementation is not
    NMI-safe, on these architectures the lockless code may need a
    spin_trylock_irqsave() based implementation.

    This patch adds a Kconfig option: ARCH_HAVE_NMI_SAFE_CMPXCHG, so that
    NMI-safe lockless code can depend on it or provide different
    implementation according to it.

    On many architectures, cmpxchg is only NMI-safe for several specific
    operand sizes. So, ARCH_HAVE_NMI_SAFE_CMPXCHG define in this patch
    only guarantees cmpxchg is NMI-safe for sizeof(unsigned long).

    Signed-off-by: Huang Ying
    Acked-by: Mike Frysinger
    Acked-by: Paul Mundt
    Acked-by: Hans-Christian Egtvedt
    Acked-by: Benjamin Herrenschmidt
    Acked-by: Chris Metcalf
    Acked-by: Richard Henderson
    CC: Mikael Starvik
    Acked-by: David Howells
    CC: Yoshinori Sato
    CC: Tony Luck
    CC: Hirokazu Takata
    CC: Geert Uytterhoeven
    CC: Michal Simek
    Acked-by: Ralf Baechle
    CC: Kyle McMartin
    CC: Martin Schwidefsky
    CC: Chen Liqin
    CC: "David S. Miller"
    CC: Ingo Molnar
    CC: Chris Zankel
    Signed-off-by: Len Brown

    Huang Ying
     

14 Jul, 2011

10 commits

  • APEI firmware first mode must be turned on explicitly on some
    machines, otherwise there may be no GHES hardware error record for
    hardware error notification. APEI bit in generic _OSC call can be
    used to do that, but on some machine, a special WHEA _OSC call must be
    used. This patch adds the support to that WHEA _OSC call.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Matthew Garrett
    Signed-off-by: Len Brown

    Huang Ying
     
  • In APEI firmware first mode, hardware error is reported by hardware to
    firmware firstly, then firmware reports the error to Linux in a GHES
    error record via POLL/SCI/IRQ/NMI etc.

    This may result in some issues if OS has no full APEI support. So
    some firmware implementation will work in a back-compatible mode by
    default. Where firmware will only notify OS in old-fashion, without
    GHES record. For example, for a fatal hardware error, only NMI is
    signaled, no GHES record.

    To gain full APEI power on these machines, APEI bit in generic _OSC
    call can be specified to tell firmware that Linux has full APEI
    support. This patch adds the APEI bit support in generic _OSC call.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Matthew Garrett
    Signed-off-by: Len Brown

    Huang Ying
     
  • Some machine may have broken firmware so that GHES and firmware first
    mode should be disabled. This patch adds support to that.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Matthew Garrett
    Signed-off-by: Len Brown

    Huang Ying
     
  • GHES (Generic Hardware Error Source) is used to process hardware error
    notification in firmware first mode. But because firmware first mode
    can be turned on but can not be turned off, it is unreasonable to
    unload the GHES module with firmware first mode turned on. To avoid
    confusion, this patch makes GHES can be enabled/disabled in
    configuration time, but not built as module and unloaded at run time.

    Signed-off-by: Huang Ying
    Reviewed-by: Andi Kleen
    Reviewed-by: Matthew Garrett
    Signed-off-by: Len Brown

    Huang Ying
     
  • This patch changes APEI EINJ and ERST to use apei_exec_run for
    mandatory actions, and apei_exec_run_optional for optional actions.

    Cc: Thomas Renninger
    Signed-off-by: Huang Ying
    Signed-off-by: Len Brown

    Huang Ying
     
  • Some actions in APEI ERST and EINJ tables are optional, for example,
    ACPI_EINJ_BEGIN_OPERATION action is used to do some preparation for
    error injection, and firmware may choose to do nothing here. While
    some other actions are mandatory, for example, firmware must provide
    ACPI_EINJ_GET_ERROR_TYPE implementation.

    Original implementation treats all actions as optional (that is, can
    have no instructions), that may cause issue if firmware does not
    provide some mandatory actions. To fix this, this patch adds
    apei_exec_run_optional, which should be used for optional actions.
    The original apei_exec_run should be used for mandatory actions.

    Cc: Thomas Renninger
    Signed-off-by: Huang Ying
    Signed-off-by: Len Brown

    Huang Ying
     
  • printk is used by GHES to report hardware errors. Normally, the
    printk will be ratelimited to avoid too many hardware error reports in
    kernel log. Because there may be thousands or even millions of
    corrected hardware errors during system running.

    That is different for fatal hardware error, because system will go
    panic as soon as possible, there will be no more than several error
    records. And these error records are valuable for system fault
    diagnosis, so they should not be ratelimited.

    Signed-off-by: Huang Ying
    Signed-off-by: Len Brown

    Huang Ying
     
  • When we debug ERST table with erst-dbg, if the error record in ERST
    table is too long(>4K), it can't be read out. So this patch increases
    the buffer size to 16K to ensure such error records can be read from
    ERST table.

    Signed-off-by: Chen Gong
    Signed-off-by: Huang Ying
    Signed-off-by: Len Brown

    Chen Gong
     
  • erst_dbg module can not work when ERST is disabled. So disable module
    loading to provide clearer information to user.

    Signed-off-by: Huang Ying
    Signed-off-by: Len Brown

    Huang Ying
     
  • The firmware on some machine will report duplicated hardware error
    source ID in HEST. This is considered a firmware bug. To provide
    better warning message, this patch adds duplicated hardware error
    source ID detecting and corresponding printk.

    This patch fixes #37412 on kernel bugzilla:
    https://bugzilla.kernel.org/show_bug.cgi?id=37412

    Reported-by: marconifabio@ubuntu-it.org
    Signed-off-by: Huang Ying
    Tested-by: Mathias
    Signed-off-by: Len Brown

    Huang Ying
     

13 Jul, 2011

4 commits

  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
    powerpc/mm: Fix memory_block_size_bytes() for non-pseries
    mm: Move definition of MIN_MEMORY_BLOCK_SIZE to a header

    Linus Torvalds
     
  • * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc:
    pcmcia: pxa2xx/vpac270: free gpios on exist rather than requesting
    ARM: pxa/raumfeld: fix device name for codec ak4104
    ARM: pxa/raumfeld: display initialisation fixes
    ARM: pxa/raumfeld: adapt to upcoming hardware change
    ARM: pxa: fix gpio_to_chip() clash with gpiolib namespace
    genirq: replace irq_gc_ack() with {set,clr}_bit variants (fwd)
    arm: mach-vt8500: add forgotten irq_data conversion
    ARM: pxa168: correct nand pmu setting
    ARM: pxa910: correct nand pmu setting
    ARM: pxa: fix PGSR register address calculation

    Linus Torvalds
     
  • * 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6:
    drm/i915/ringbuffer: Idling requires waiting for the ring to be empty
    Revert "drm/i915: enable rc6 by default"
    drm/i915: Clean up i915_driver_load failure path
    drm/i915: Enable GPU reset on Ivybridge.
    drm/i915/dp: manage sink power state if possible
    drm/i915/dp: consolidate AUX retry code
    drm/i915/dp: remove DPMS mode tracking from DP
    drm/i915/dp: try to read receiver capabilities 3 times when detecting
    drm/i915/dp: read more receiver capability bits on hotplug
    drm/i915/dp: use DP DPCD defines when looking at DPCD values
    drm/i915/dp: retry link status read 3 times on failure

    Linus Torvalds
     
  • ...which is measured by the size and not the amount of space remaining.

    Waiting upon size-8, did one of two things. In the common case with more
    than 8 bytes available to write into the ring, it would return
    immediately. Otherwise, it would timeout given the impossible condition
    of waiting for more space than is available in the ring, leading to
    warnings such as:

    [drm:intel_cleanup_ring_buffer] *ERROR* failed to quiesce render ring
    whilst cleaning up: -16

    Signed-off-by: Chris Wilson
    Reviewed-by: Eric Anholt
    Signed-off-by: Keith Packard

    Chris Wilson
     

12 Jul, 2011

16 commits


11 Jul, 2011

8 commits

  • [ 191.310008] WARNING: kmemcheck: Caught 32-bit read from freed memory (f0d25f14)
    [ 191.310011] c056d2f088000000105fd2f00000000050415353040000000000000000000000
    [ 191.310020] i i i i f f f f f f f f f f f f f f f f f f f f f f f f f f f f
    [ 191.310027] ^
    [ 191.310029]
    [ 191.310032] Pid: 737, comm: modprobe Not tainted 3.0.0-rc5+ #268 Hewlett-Packard HP Compaq 6005 Pro SFF PC/3047h
    [ 191.310036] EIP: 0060:[] EFLAGS: 00010286 CPU: 0
    [ 191.310039] EIP is at hp_wmi_perform_query+0x104/0x150 [hp_wmi]
    [ 191.310041] EAX: f0d25601 EBX: f0d25f00 ECX: 000121cf EDX: 000121ce
    [ 191.310043] ESI: f0d25f10 EDI: f0f97ea8 EBP: f0f97ec4 ESP: c173f34c
    [ 191.310045] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    [ 191.310046] CR0: 8005003b CR2: f540c000 CR3: 30f30000 CR4: 000006d0
    [ 191.310048] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
    [ 191.310050] DR6: ffff4ff0 DR7: 00000400
    [ 191.310051] [] hp_wmi_dock_state+0x2b/0x40 [hp_wmi]
    [ 191.310054] [] hp_wmi_init+0x93/0x1a8 [hp_wmi]
    [ 191.310057] [] do_one_initcall+0x30/0x170
    [ 191.310061] [] sys_init_module+0xef/0x1a60
    [ 191.310064] [] sysenter_do_call+0x12/0x28
    [ 191.310067] [] 0xffffffff

    Signed-off-by: Eric Dumazet
    Signed-off-by: Matthew Garrett

    Eric Dumazet
     
  • Using buffer->output[1] without mutex_lock()

    Signed-off-by: Jose Alonso
    Signed-off-by: Matthew Garrett

    Jose Alonso
     
  • This reverts commit a3d77411e8b2ad661958c1fbee65beb476ec6d70,

    as it causes a mess in the wireless rfkill status on some models.
    It is probably a bad idea to toggle the rfkill for all dell models
    without the respect to the claim that it is hardware-controlled.

    Cc: stable@kernel.org
    Signed-off-by: Keng-Yu Lin
    Signed-off-by: Matthew Garrett

    Keng-Yu Lin
     
  • Patch 2e711c04dbbf7a7732a3f7073b1fc285d12b369d
    (PM: Remove sysdev suspend, resume and shutdown operations)
    deleted sysdev_suspend(), which was being relied on to call
    check_wakeup_irqs() in suspend. If check_wakeup_irqs() is not
    called, wake interrupts that are pending when suspend is
    entered may be lost. It also breaks IRQCHIP_MASK_ON_SUSPEND,
    which is handled in check_wakeup_irqs().

    This patch adds a call to check_wakeup_irqs() in syscore_suspend(),
    similar to what was deleted in sysdev_suspend().

    Signed-off-by: Colin Cross
    Signed-off-by: Rafael J. Wysocki

    Colin Cross
     
  • Signed-off-by: Jonathan Cameron
    Acked-by: Marek Vasut
    Signed-off-by: Eric Miao

    Jonathan Cameron
     
  • In commit f0fba2ad (ASoC: multi-component - ASoC Multi-Component
    Support), the name of the ak4104 codec driver was changed without
    amending the platform code which uses it as well.

    Signed-off-by: Daniel Mack
    Signed-off-by: Eric Miao

    Daniel Mack
     
  • The display requires some milliseconds between GPIO_TFT_VA_EN
    and GPIO_DISPLAY_ENABLE. Reorder initialisation to comply with
    the display spec.

    Also tune timings for better compliance with the spec.

    Signed-off-by: Sven Neumann
    Acked-by: Daniel Mack
    Signed-off-by: Eric Miao

    Sven Neumann
     
  • The backlight control is going to change back to PWM in the
    upcoming Raumfeld Controller hardware revision.

    Signed-off-by: Sven Neumann
    Acked-by: Daniel Mack
    Signed-off-by: Eric Miao

    Sven Neumann