07 Apr, 2012

2 commits


06 Apr, 2012

3 commits

  • Merge batch of fixes from Andrew Morton:
    "The simple_open() cleanup was held back while I wanted for laggards to
    merge things.

    I still need to send a few checkpoint/restore patches. I've been
    wobbly about merging them because I'm wobbly about the overall
    prospects for success of the project. But after speaking with Pavel
    at the LSF conference, it sounds like they're further toward
    completion than I feared - apparently davem is at the "has stopped
    complaining" stage regarding the net changes. So I need to go back
    and re-review those patchs and their (lengthy) discussion."

    * emailed from Andrew Morton : (16 patches)
    memcg swap: use mem_cgroup_uncharge_swap fix
    backlight: add driver for DA9052/53 PMIC v1
    C6X: use set_current_blocked() and block_sigmask()
    MAINTAINERS: add entry for sparse checker
    MAINTAINERS: fix REMOTEPROC F: typo
    alpha: use set_current_blocked() and block_sigmask()
    simple_open: automatically convert to simple_open()
    scripts/coccinelle/api/simple_open.cocci: semantic patch for simple_open()
    libfs: add simple_open()
    hugetlbfs: remove unregister_filesystem() when initializing module
    drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callback
    fs/xattr.c:setxattr(): improve handling of allocation failures
    fs/xattr.c:listxattr(): fall back to vmalloc() if kmalloc() failed
    fs/xattr.c: suppress page allocation failure warnings from sys_listxattr()
    sysrq: use SEND_SIG_FORCED instead of force_sig()
    proc: fix mount -t proc -o AAA

    Linus Torvalds
     
  • Many users of debugfs copy the implementation of default_open() when
    they want to support a custom read/write function op. This leads to a
    proliferation of the default_open() implementation across the entire
    tree.

    Now that the common implementation has been consolidated into libfs we
    can replace all the users of this function with simple_open().

    This replacement was done with the following semantic patch:

    @ open @
    identifier open_f != simple_open;
    identifier i, f;
    @@
    -int open_f(struct inode *i, struct file *f)
    -{
    (
    -if (i->i_private)
    -f->private_data = i->i_private;
    |
    -f->private_data = i->i_private;
    )
    -return 0;
    -}

    @ has_open depends on open @
    identifier fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ...
    -.open = open_f,
    +.open = simple_open,
    ...
    };

    [akpm@linux-foundation.org: checkpatch fixes]
    Signed-off-by: Stephen Boyd
    Cc: Greg Kroah-Hartman
    Cc: Al Viro
    Cc: Julia Lawall
    Acked-by: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     
  • ACPI code is shared by arch/x86 and arch/ia64. ia64 doesn't provide a plain
    "halt()" function. Use safe_halt() instead.

    Signed-off-by: Tony Luck
    Tested-by: Boris Ostrovsky
    Signed-off-by: Len Brown

    Luck, Tony
     

31 Mar, 2012

8 commits

  • Pull ACPI & Power Management changes from Len Brown:
    - ACPI 5.0 after-ripples, ACPICA/Linux divergence cleanup
    - cpuidle evolving, more ARM use
    - thermal sub-system evolving, ditto
    - assorted other PM bits

    Fix up conflicts in various cpuidle implementations due to ARM cpuidle
    cleanups (ARM at91 self-refresh and cpu idle code rewritten into
    "standby" in asm conflicting with the consolidation of cpuidle time
    keeping), trivial SH include file context conflict and RCU tracing fixes
    in generic code.

    * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (77 commits)
    ACPI throttling: fix endian bug in acpi_read_throttling_status()
    Disable MCP limit exceeded messages from Intel IPS driver
    ACPI video: Don't start video device until its associated input device has been allocated
    ACPI video: Harden video bus adding.
    ACPI: Add support for exposing BGRT data
    ACPI: export acpi_kobj
    ACPI: Fix logic for removing mappings in 'acpi_unmap'
    CPER failed to handle generic error records with multiple sections
    ACPI: Clean redundant codes in scan.c
    ACPI: Fix unprotected smp_processor_id() in acpi_processor_cst_has_changed()
    ACPI: consistently use should_use_kmap()
    PNPACPI: Fix device ref leaking in acpi_pnp_match
    ACPI: Fix use-after-free in acpi_map_lsapic
    ACPI: processor_driver: add missing kfree
    ACPI, APEI: Fix incorrect APEI register bit width check and usage
    Update documentation for parameter *notrigger* in einj.txt
    ACPI, APEI, EINJ, new parameter to control trigger action
    ACPI, APEI, EINJ, limit the range of einj_param
    ACPI, APEI, Fix ERST header length check
    cpuidle: power_usage should be declared signed integer
    ...

    Linus Torvalds
     
  • Conflicts:
    drivers/acpi/acpica/hwsleep.c

    Text conflict between:

    2feec47d4c5f80b05f1650f5a24865718978eea4
    (ACPICA: ACPI 5: Support for new FADT SleepStatus, SleepControl registers)

    which removed #include "actables.h"

    and

    09f98a825a821f7a3f1b162f9ed023f37213a63b
    (x86, acpi, tboot: Have a ACPI os prepare sleep instead of calling tboot_sleep.)

    which removed #include

    The resolution is to remove them both.

    Signed-off-by: Len Brown

    Len Brown
     
  • Conflicts:
    drivers/acpi/sleep.c

    This was a text conflict between
    a2ef5c4fd44ce3922435139393b89f2cce47f576
    (ACPI: Move module parameter gts and bfs to sleep.c)

    which added #include

    and

    b24e5098853653554baf6ec975b9e855f3d6e5c0
    (ACPI, PCI: Move acpi_dev_run_wake() to ACPI core)

    which added #include

    The resolution was to take them both.

    Signed-off-by: Len Brown

    Len Brown
     
  • Conflicts:
    drivers/acpi/apei/apei-base.c

    This was a conflict between

    15afae604651d4e17652d2ffb56f5e36f991cfef
    (CPI, APEI: Fix incorrect APEI register bit width check and usage)

    and

    653f4b538f66d37db560e0f56af08117136d29b7
    (ACPICA: Expand OSL memory read/write interfaces to 64 bits)

    The former changed a parameter in the call to acpi_os_read_memory64()
    and the later replaced all calls to acpi_os_read_memory64()
    with calls to acpi_os_read_memory().

    Signed-off-by: Len Brown

    Len Brown
     
  • … 'red-hat-bz-727865', 'thermal', 'throttling', 'turbostat' and 'video' into release

    Signed-off-by: Len Brown <len.brown@intel.com>

    Len Brown
     
  • Using a u64 here creates an endian bug. We store a u32 number in the
    top byte which is a larger number than intended on big endian systems.
    There is no reason to use a 64 bit data type here, I guess it was just
    an oversight.

    I removed the initialization to zero as well. It's needed with a u64
    but with a u32, the variable gets initialized properly inside the call
    to acpi_os_read_port().

    Signed-off-by: Dan Carpenter
    Signed-off-by: Len Brown

    Dan Carpenter
     
  • Quoth Dmitry Torokhov:
    In addition to bus notifier we do install device notifier explicitly
    so it might fire up early. The easiest fox would be to move
    acpi_video_bus_start_devices() after input_allocate_device() but
    before input_register_device() - unregistered input devices can handle
    input_event() calls just fine.

    May fix crashes reported in:
    https://bugzilla.kernel.org/show_bug.cgi?id=40672

    Signed-off-by: Igor Murzov
    Signed-off-by: Len Brown

    Igor Murzov
     
  • It is always better to check return values, so add some new checks and
    correct existing ones.

    v2: Be consistent and don't mix errors from -E* and AE_* namespaces.

    Signed-off-by: Igor Murzov
    Signed-off-by: Len Brown

    Igor Murzov
     

30 Mar, 2012

22 commits

  • ACPI 5.0 adds the BGRT, a table that contains a pointer to the firmware
    boot splash and associated metadata. This simple driver exposes it via
    /sys/firmware/acpi in order to allow bootsplash applications to draw their
    splash around the firmware image and reduce the number of jarring graphical
    transitions during boot.

    Signed-off-by: Matthew Garrett
    Signed-off-by: Len Brown

    Matthew Garrett
     
  • Drivers may wish to add entries to /sys/firmware/acpi, so export acpi_kobj
    in order to let them do that.

    Signed-off-by: Matthew Garrett
    Signed-off-by: Len Brown

    Matthew Garrett
     
  • Make sure the removal of mappings uses the same logic that put the
    mappings in place.

    Signed-off-by: Myron Stowe
    Signed-off-by: Len Brown

    Myron Stowe
     
  • The function apei_estatus_print() and apei_estatus_check() forget to move ahead
    the gdata pointer when dealing with multiple generic error data sections.

    Signed-off-by: Jiang Liu
    Signed-off-by: Len Brown

    Jiang Liu
     
  • Clean the redundant codes of apci_bus_get_power_flags().

    Signed-off-by: Alex He
    Signed-off-by: Len Brown

    Alex He
     
  • The acpi_processor_cst_has_changed() function is invoked from a
    CPU_ONLINE or CPU_DEAD function, which might well execute on CPU 0
    even though the CPU being hotplugged is some other CPU. In addition,
    acpi_processor_cst_has_changed() invokes smp_processor_id() without
    protection, resulting in splats when onlining CPUs.

    This commit therefore changes the smp_processor_id() to pr->id, as is
    used elsewhere in the code, for example, in acpi_processor_add().

    Signed-off-by: Paul E. McKenney
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Srivatsa S. Bhat
    Tested-by: Yong Zhang
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Paul E. McKenney
     
  • ... so that acpi_unmap()'s behavior gets in sync with acpi_map()'s.

    Signed-off-by: Jan Beulich
    Signed-off-by: Len Brown

    Jan Beulich
     
  • The function acpi_processor_add is stored in the ops.add field of a
    acpi_driver structure. This function is then called in
    acpi_bus_driver_init. On failure, this function clears the field
    device->driver_data, but does not free its contents. Thus the free has to
    be done by the add function. In acpi_processor_add, the corresponding
    value is pr. This value is currently freed on failure before storing it in
    device->driver_data, but not after. This free is added in the error
    handling code at the end of the function. The per_cpu variable
    processors is also cleared so that it does not refer to a dangling pointer.

    Signed-off-by: Julia Lawall
    Reviewed-by: Srivatsa S. Bhat
    Acked-by: Deepthi Dharwar
    Signed-off-by: Len Brown

    Julia Lawall
     
  • The current code incorrectly assumes that
    (1) the APEI register bit width is always 8, 16, 32, or 64 and
    (2) the APEI register bit width is always equal to the APEI
    register access width.

    ERST serialization instructions entries such as:

    [030h 0048 1] Action : 00 [Begin Write Operation]
    [031h 0049 1] Instruction : 03 [Write Register Value]
    [032h 0050 1] Flags (decoded below) : 01
    Preserve Register Bits : 1
    [033h 0051 1] Reserved : 00

    [034h 0052 12] Register Region : [Generic Address Structure]
    [034h 0052 1] Space ID : 00 [SystemMemory]
    [035h 0053 1] Bit Width : 03
    [036h 0054 1] Bit Offset : 00
    [037h 0055 1] Encoded Access Width : 03 [DWord Access:32]
    [038h 0056 8] Address : 000000007F2D7038

    [040h 0064 8] Value : 0000000000000001
    [048h 0072 8] Mask : 0000000000000007

    break this assumption by yielding:
    [Firmware Bug]: APEI: Invalid bit width in GAR [0x7f2d7038/3/0]

    I have found no ACPI specification requirements corresponding
    with the above assumptions. There is even a good example in
    the Serialization Instruction Entries section (ACPI 4.0 section
    17.4,1.2, ACPI 4.0a section 2.5.1.2, ACPI 5.0 section 18.5.1.2)
    that mentions a serialization instruction with a bit range of
    [6:2] which is 5 bits wide, _not_ 8, 16, 32, or 64 bits wide.

    Compile and boot tested with 3.3.0-rc7 on a IBM HX5.

    Signed-off-by: Gary Hade
    Signed-off-by: Len Brown

    Gary Hade
     
  • Some APEI firmware implementation will access injected address
    specified in param1 to trigger the error when injecting memory
    error, which means if one SRAR error is injected, the crash
    always happens because it is executed in kernel context. This
    new parameter can disable trigger action and control is taken
    over by the user. In this way, an SRAR error can happen in user
    context instead of crashing the system. This function is highly
    depended on BIOS implementation so please ensure you know the
    BIOS trigger procedure before you enable this switch.

    v2:
    notrigger should be created together with param1/param2

    Tested-by: Tony Luck
    Signed-off-by: Chen Gong
    Signed-off-by: Len Brown

    Chen Gong
     
  • On the platforms with ACPI4.x support, parameter extension
    is not always doable, which means only parameter extension
    is enabled, einj_param can take effect.

    v2->v1: stopping early in einj_get_parameter_address for einj_param

    Signed-off-by: Chen Gong
    Acked-by: Tony Luck
    Signed-off-by: Len Brown

    Chen Gong
     
  • This fixes a trivial copy & paste error in ERST header length check.
    It's just for future safety because sizeof(struct acpi_table_einj)
    equals to sizeof(struct acpi_table_erst) with current ACPI5.0
    specification. It applies to v3.3-rc6.

    Signed-off-by: Jiang Liu
    Acked-by: Huang Ying
    Signed-off-by: Len Brown

    Jiang Liu
     
  • Currently when a CPU is off-lined it enters either MWAIT-based idle or,
    if MWAIT is not desired or supported, HLT-based idle (which places the
    processor in C1 state). This patch allows processors without MWAIT
    support to stay in states deeper than C1.

    Signed-off-by: Boris Ostrovsky
    Signed-off-by: Len Brown

    Boris Ostrovsky
     
  • acpi_processor_install_hotplug_notify() registers processor objects to
    receive ACPI CPU hotplug event notifications. This patch additionally
    registers processor device objects (ACPI0007) to receive the notifications
    as well.

    Signed-off-by: Toshi Kani
    Reviewed-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Toshi Kani
     
  • Print physical address info in a style consistent with the %pR style used
    elsewhere in the kernel.

    Signed-off-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Bjorn Helgaas
     
  • An HP laptop (Pavilion G4-1016tx) has the following code in _TMP:

    Store (\_SB.PCI0.LPCB.EC0.RTMP, Local0)
    If (LGreaterEqual (Local0, S4TP))
    {
    Store (One, HTS4)
    }

    S4TP is initialised at 0 and not programmed further until either _HOT or
    _CRT is called. If we evaluate _TMP before the trip points then HTS4 will
    always be set, causing the firmware to generate a message on boot
    complaining that the system shut down because of overheating. The simplest
    solution is just to reverse the checking of trip points and _TMP in thermal
    init.

    Signed-off-by: Matthew Garrett
    Signed-off-by: Len Brown

    Matthew Garrett
     
  • acpi_dev_run_wake() is a generic function which can be used by
    other subsystem too. Rename it to acpi_pm_device_run_wake, to be
    consistent with acpi_pm_device_sleep_wake.

    Then move it to ACPI core.

    Acked-by: Rafael J. Wysocki
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Lin Ming
     
  • Devices may share same list of power resources in _PR0, for example

    Device(Dev0)
    {
    Name (_PR0, Package (0x01)
    {
    P0PR,
    P1PR
    })
    }

    Device(Dev1)
    {
    Name (_PR0, Package (0x01)
    {
    P0PR,
    P1PR
    }
    }

    Assume Dev0 and Dev1 were runtime suspended.
    Then Dev0 is resumed first and it goes into D0 state.
    But Dev1 is left in D0_Uninitialised state.

    This is wrong. In this case, Dev1 must be resumed too.

    In order to hand this case, each power resource maintains a list of
    devices which relies on it.

    When power resource is ON, it will check if the devices on its list
    can be resumed. The device can only be resumed when all the power
    resouces of its _PR0 are ON.

    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Lin Ming
     
  • If a device has _PR3, it means the device supports D3_COLD.
    Add the ability to validate and enter D3_COLD state in ACPI.

    Signed-off-by: Zhang Rui
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Zhang Rui
     
  • Repair a common problem with objects that are defined to return
    a variable-length Package of sub-objects. If there is only one
    sub-object, some BIOS code mistakenly simply declares the single
    object instead of a Package with one sub-object. This function
    attempts to repair this error by wrapping a Package object around
    the original object, creating the correct and expected Package
    with one sub-object.

    Signed-off-by: Bob Moore
    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Bob Moore
     
  • Some ACPI interrupt actions may need to wait, and it's easiest to
    have a thread context for this. So turn the ACPI interrupt
    into a threaded interrupt.

    Signed-off-by: Andi Kleen
    Signed-off-by: Len Brown

    Andi Kleen
     
  • WARN() is not supposed to have side effects, so move the request_regions
    outside.

    Signed-off-by: Andi Kleen
    Signed-off-by: Len Brown

    Andi Kleen
     

29 Mar, 2012

3 commits

  • …m/linux/kernel/git/dhowells/linux-asm_system

    Pull "Disintegrate and delete asm/system.h" from David Howells:
    "Here are a bunch of patches to disintegrate asm/system.h into a set of
    separate bits to relieve the problem of circular inclusion
    dependencies.

    I've built all the working defconfigs from all the arches that I can
    and made sure that they don't break.

    The reason for these patches is that I recently encountered a circular
    dependency problem that came about when I produced some patches to
    optimise get_order() by rewriting it to use ilog2().

    This uses bitops - and on the SH arch asm/bitops.h drags in
    asm-generic/get_order.h by a circuituous route involving asm/system.h.

    The main difficulty seems to be asm/system.h. It holds a number of
    low level bits with no/few dependencies that are commonly used (eg.
    memory barriers) and a number of bits with more dependencies that
    aren't used in many places (eg. switch_to()).

    These patches break asm/system.h up into the following core pieces:

    (1) asm/barrier.h

    Move memory barriers here. This already done for MIPS and Alpha.

    (2) asm/switch_to.h

    Move switch_to() and related stuff here.

    (3) asm/exec.h

    Move arch_align_stack() here. Other process execution related bits
    could perhaps go here from asm/processor.h.

    (4) asm/cmpxchg.h

    Move xchg() and cmpxchg() here as they're full word atomic ops and
    frequently used by atomic_xchg() and atomic_cmpxchg().

    (5) asm/bug.h

    Move die() and related bits.

    (6) asm/auxvec.h

    Move AT_VECTOR_SIZE_ARCH here.

    Other arch headers are created as needed on a per-arch basis."

    Fixed up some conflicts from other header file cleanups and moving code
    around that has happened in the meantime, so David's testing is somewhat
    weakened by that. We'll find out anything that got broken and fix it..

    * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits)
    Delete all instances of asm/system.h
    Remove all #inclusions of asm/system.h
    Add #includes needed to permit the removal of asm/system.h
    Move all declarations of free_initmem() to linux/mm.h
    Disintegrate asm/system.h for OpenRISC
    Split arch_align_stack() out from asm-generic/system.h
    Split the switch_to() wrapper out of asm-generic/system.h
    Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h
    Create asm-generic/barrier.h
    Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h
    Disintegrate asm/system.h for Xtensa
    Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt]
    Disintegrate asm/system.h for Tile
    Disintegrate asm/system.h for Sparc
    Disintegrate asm/system.h for SH
    Disintegrate asm/system.h for Score
    Disintegrate asm/system.h for S390
    Disintegrate asm/system.h for PowerPC
    Disintegrate asm/system.h for PA-RISC
    Disintegrate asm/system.h for MN10300
    ...

    Linus Torvalds
     
  • Pull x86 platform driver updates from Matthew Garrett:
    "Some significant updates to samsung-laptop, additional hardware
    support for Toshibas, misc updates to various hardware and a new
    backlight driver for some Apple machines."

    Fix up trivial conflicts: geode Geos update happening next to net5501
    support, and MSIC thermal platform support added twice.

    * 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: (77 commits)
    acer-wmi: add quirk table for video backlight vendor mode
    drivers/platform/x86/amilo-rfkill.c::amilo_rfkill_probe() avoid NULL deref
    samsung-laptop: unregister ACPI video module for some well known laptops
    acer-wmi: No wifi rfkill on Sony machines
    thinkpad-acpi: recognize Lenovo as version string in newer V-series BIOS
    asus-wmi: don't update power and brightness when using scalar
    eeepc-wmi: split et2012 specific hacks
    eeepc-wmi: refine quirks handling
    asus-nb-wmi: set panel_power correctly
    asus-wmi: move WAPF variable into quirks_entry
    asus-wmi: store backlight power status for AIO machine
    asus-wmi: add scalar board brightness adj. support
    samsung-laptop: cleanup return type: mode_t vs umode_t
    drivers, samsung-laptop: fix usage of isalnum
    drivers, samsung-laptop: fix initialization of sabi_data in sabi_set_commandb
    asus-wmi: on/off bit is not set when reading the value
    eeepc-wmi: add extra keymaps for EP121
    asus-nb-wmi: ignore useless keys
    acer-wmi: support Lenovo ideapad S205 Brazos wifi switch
    acer-wmi: fix out of input parameter size when set
    ...

    Linus Torvalds
     
  • Remove all #inclusions of asm/system.h preparatory to splitting and killing
    it. Performed with the following command:

    perl -p -i -e 's!^#\s*include\s*.*\n!!' `grep -Irl '^#\s*include\s*' *`

    Signed-off-by: David Howells

    David Howells
     

27 Mar, 2012

2 commits

  • Move linux specific module parameter gts and bfs out of ACPICA core
    code to sleep.c.

    Signed-off-by: Lin Ming
    Signed-off-by: Len Brown

    Lin Ming
     
  • Enhanced the sleep/wake interfaces to optionally execute the
    _GTS method (Going To Sleep), and the _BFS method (Back From
    Sleep). Windows apparently does not execute these methods, and
    therefore these methods are often untested. It has been seen on
    some systems where the execution of these methods causes errors
    and also prevents the machine from entering S5. It is therefore
    suggested that host operating systems do not execute these methods
    by default. In the future, perhaps these methods can be optionally
    executed based on the age of the system and/or what is the newest
    version of Windows that the BIOS asks for via _OSI.

    Signed-off-by: Lin Ming
    Signed-off-by: Bob Moore
    Signed-off-by: Len Brown

    Lin Ming