24 Mar, 2013

1 commit

  • Found with a network device in QEMU/KVM guest not working anymore.

    Bisected to commit c13085e5
    ACPICA: Resource Mgr: Prevent infinite loops in resource walks

    That commit will check acpi_resource length strictly which causes
    acpi_set_current_resources to return failure and IRQ for PCI
    devices is not set properly.

    Set length for all those TYPE_END_TAG acpi_resources.

    [rjw: Changelog]
    Bisected-by: Yinghai Lu
    Signed-off-by: Yinghai Lu
    Signed-off-by: Rafael J. Wysocki

    Yinghai Lu
     

04 Mar, 2013

1 commit

  • USB uses the .find_bridge() callback from struct acpi_bus_type
    incorrectly, because as a result of the way it is used by USB every
    device in the system that doesn't have a bus type or parent is
    passed to usb_acpi_find_device() for inspection.

    What USB actually needs, though, is to call usb_acpi_find_device()
    for USB ports that don't have a bus type defined, but have
    usb_port_device_type as their device type, as well as for USB
    devices.

    To fix that replace the struct bus_type pointer in struct
    acpi_bus_type used for matching devices to specific subsystems
    with a .match() callback to be used for this purpose and update
    the users of struct acpi_bus_type, including USB, accordingly.
    Define the .match() callback routine for USB, usb_acpi_bus_match(),
    in such a way that it will cover both USB devices and USB ports
    and remove the now redundant .find_bridge() callback pointer from
    usb_acpi_bus.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Greg Kroah-Hartman
    Acked-by: Yinghai Lu
    Acked-by: Jeff Garzik

    Rafael J. Wysocki
     

01 Feb, 2013

1 commit


08 Dec, 2012

2 commits


04 Dec, 2012

1 commit


30 Nov, 2012

1 commit

  • During resume from system suspend the 'data' field of
    struct pnp_dev in pnpacpi_set_resources() may be a stale pointer,
    due to removal of the associated ACPI device node object in the
    previous suspend-resume cycle. This happens, for example, if a
    dockable machine is booted in the docking station and then suspended
    and resumed and suspended again. If that happens,
    pnpacpi_build_resource_template() called from pnpacpi_set_resources()
    attempts to use that pointer and crashes.

    However, pnpacpi_set_resources() actually checks the device's ACPI
    handle, attempts to find the ACPI device node object attached to it
    and returns an error code if that fails, so in fact it knows what the
    correct value of dev->data should be. Use this observation to update
    dev->data with the correct value if necessary and dump a call trace
    if that's the case (once).

    We still need to fix the root cause of this issue, but preventing
    systems from crashing because of it is an improvement too.

    Reported-and-tested-by: Zdenek Kabelac
    References: https://bugzilla.kernel.org/show_bug.cgi?id=51071
    Cc:
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

24 Nov, 2012

1 commit

  • Make pnpacpi_add_device() ignore ACPI device nodes already associated
    with struct device objects representing physical devices.

    In particular, this will prevent PNP device objects from being
    created for ACPI device nodes already associated with platform
    devices.

    This change was originally proposed by Mika Westerberg.

    [rjw: Modified the subject and changelog.]
    Signed-off-by: Adrian Hunter
    Signed-off-by: Rafael J. Wysocki

    Adrian Hunter
     

15 Nov, 2012

1 commit


22 Sep, 2012

1 commit

  • A USB port's position and connectability can't be identified on some boards
    via USB hub registers. ACPI _UPC and _PLD can help to resolve this issue
    and so it is necessary to bind USB with ACPI. This patch is to allow ACPI
    binding with USB-3.0 hub.

    Current ACPI only can bind one struct-device to one ACPI device node.
    This can not work with USB-3.0 hub, because the USB-3.0 hub has two logical
    devices. Each works for USB-2.0 and USB-3.0 devices. In the Linux USB subsystem,
    those two logical hubs are treated as two seperate devices that have two struct
    devices. But in the ACPI DSDT, these two logical hubs share one ACPI device
    node. So there is a requirement to bind multi struct-devices to one ACPI
    device node. This patch is to resolve such problem.

    Following is the ACPI device nodes' description under xhci hcd.

    Device (XHC)
    Device (RHUB)
    Device (HSP1)
    Device (HSP2)
    Device (HSP3)
    Device (HSP4)
    Device (SSP1)
    Device (SSP2)
    Device (SSP3)
    Device (SSP4)

    Topology in the Linux

    device XHC
    USB-2.0 logical hub USB-3.0 logical hub
    HSP1 SSP1
    HSP2 SSP2
    HSP3 SSP3
    HSP4 SSP4

    This patch also modifies the output of /proc/acpi/wakeup. One ACPI node
    can be associated with multiple devices:

    XHC S4 *enabled pci:0000:00:14.0
    RHUB S0 disabled usb:usb1
    disabled usb:usb2

    Signed-off-by: Lan Tianyu
    Acked-by: Sarah Sharp
    Signed-off-by: Len Brown

    Lan Tianyu
     

24 Jun, 2012

1 commit

  • Lower device sleep state can save more power, but has more exit
    latency too. Sometimes, to satisfy some power QoS and other
    requirement, we need to constrain the lowest device sleep state.

    In this patch, a parameter to specify lowest allowed state for
    acpi_pm_device_sleep_state is added. So that the caller can enforce
    the constraint via the parameter.

    This is needed by PCIe D3cold support, where the lowest power state
    allowed may be D3_HOT instead of default D3_COLD.

    CC: Len Brown
    CC: linux-acpi@vger.kernel.org
    Reviewed-by: Rafael J. Wysocki
    Signed-off-by: Huang Ying
    Signed-off-by: Bjorn Helgaas

    Huang Ying
     

30 Mar, 2012

1 commit

  • During testing pci root bus removal, found some root bus bridge is not freed.
    If booting with pnpacpi=off, those hostbridge could be freed without problem.
    It turns out that some devices reference are not released during acpi_pnp_match.
    that match should not hold one device ref during every calling.
    Add pu_device calling before returning.

    Signed-off-by: Yinghai Lu
    Cc: stable@vger.kernel.org
    Signed-off-by: Len Brown

    Yinghai Lu
     

08 Nov, 2011

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
    cpuidle: Single/Global registration of idle states
    cpuidle: Split cpuidle_state structure and move per-cpu statistics fields
    cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare()
    cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state
    ACPI: Fix CONFIG_ACPI_DOCK=n compiler warning
    ACPI: Export FADT pm_profile integer value to userspace
    thermal: Prevent polling from happening during system suspend
    ACPI: Drop ACPI_NO_HARDWARE_INIT
    ACPI atomicio: Convert width in bits to bytes in __acpi_ioremap_fast()
    PNPACPI: Simplify disabled resource registration
    ACPI: Fix possible recursive locking in hwregs.c
    ACPI: use kstrdup()
    mrst pmu: update comment
    tools/power turbostat: less verbose debugging

    Linus Torvalds
     

07 Nov, 2011

1 commit

  • The attached patch simplifies 29df8d8f8702f0f53c1375015f09f04bc8d023c1. As
    the "pnp_xxx" structs are not designed to cope with IORESOURCE_DISABLED, and
    hence no code can test for this value, setting this value is actually a "no op"
    and can be skipped altogether. It is sufficient to remove the checks for
    "empty" resources and continue processing.

    The patch is applied against 3.1.

    Signed-off-by: Witold Szczeponik
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Witold Szczeponik
     

01 Nov, 2011

1 commit


26 Jul, 2011

2 commits

  • * Merge akpm patch series: (122 commits)
    drivers/connector/cn_proc.c: remove unused local
    Documentation/SubmitChecklist: add RCU debug config options
    reiserfs: use hweight_long()
    reiserfs: use proper little-endian bitops
    pnpacpi: register disabled resources
    drivers/rtc/rtc-tegra.c: properly initialize spinlock
    drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in twl_rtc_set_time()
    drivers/rtc: add support for Qualcomm PMIC8xxx RTC
    drivers/rtc/rtc-s3c.c: support clock gating
    drivers/rtc/rtc-mpc5121.c: add support for RTC on MPC5200
    init: skip calibration delay if previously done
    misc/eeprom: add eeprom access driver for digsy_mtc board
    misc/eeprom: add driver for microwire 93xx46 EEPROMs
    checkpatch.pl: update $logFunctions
    checkpatch: make utf-8 test --strict
    checkpatch.pl: add ability to ignore various messages
    checkpatch: add a "prefer __aligned" check
    checkpatch: validate signature styles and To: and Cc: lines
    checkpatch: add __rcu as a sparse modifier
    checkpatch: suggest using min_t or max_t
    ...

    Did this as a merge because of (trivial) conflicts in
    - Documentation/feature-removal-schedule.txt
    - arch/xtensa/include/asm/uaccess.h
    that were just easier to fix up in the merge than in the patch series.

    Linus Torvalds
     
  • When parsing PnP ACPI resource structures, it may happen that some of
    the resources are disabled (in which case "the size" of the resource
    equals zero).

    The current solution is to skip these resources completely - with the
    unfortunate side effect that they are not registered despite the fact
    that they exist, after all. (The downside of this approach is that
    these resources cannot be used as templates for setting the actual
    device's resources because they are missing from the template.) The
    kernel's APM implementation does not suffer from this problem and
    registers all resources regardless of "their size".

    This patch fixes a problem with (at least) the vintage IBM ThinkPad 600E
    (and most likely also with the 600, 600X, and 770X which have a very
    similar layout) where some of its PnP devices support options where
    either an IRQ, a DMA, or an IO port is disabled. Without this patch,
    the devices can not be configured using the
    "/sys/bus/pnp/devices/*/resources" interface.

    The manipulation of these resources is important because the 600E has
    very demanding requirements. For instance, the number of IRQs is not
    sufficient to support all devices of the 600E. Fortunately, some of the
    devices, like the sound card's MPU-401 UART, can be configured to not
    use any IRQ, hence freeing an IRQ for a device that requires one.
    (Still, the device's "ResourceTemplate" requires an IRQ resource
    descriptor which cannot be created if the resource has not been
    registered in the first place.)

    As an example, the dependent sets of the 600E's CSC0103 device (the
    MPU-401 UART) are listed, with the patch applied, as:

    Dependent: 00 - Priority preferred
    port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
    irq High-Edge
    Dependent: 01 - Priority acceptable
    port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
    irq 5,7,2/9,10,11,15 High-Edge

    (The same result is obtained when PNPBIOS is used instead of PnP ACPI.)
    Without the patch, the IRQ resource in the preferred option is not
    listed at all:

    Dependent: 00 - Priority preferred
    port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
    Dependent: 01 - Priority acceptable
    port 0x300-0x330, align 0xf, size 0x4, 16-bit address decoding
    irq 5,7,2/9,10,11,15 High-Edge

    And in fact, the 600E's DSDT lists the disabled IRQ as an option, as can
    be seen from the following excerpt from the DSDT:

    Name (_PRS, ResourceTemplate ()
    {
    StartDependentFn (0x00, 0x00)
    {
    IO (Decode16, 0x0300, 0x0330, 0x10, 0x04)
    IRQNoFlags () {}
    }
    StartDependentFn (0x01, 0x00)
    {
    IO (Decode16, 0x0300, 0x0330, 0x10, 0x04)
    IRQNoFlags () {5,7,9,10,11,15}
    }
    EndDependentFn ()
    })

    With this patch applied, a user space program - or maybe even the kernel
    - can allocate all devices' resources optimally. For the 600E, this
    means to find optimal resources for (at least) the serial port, the
    parallel port, the infrared port, the MWAVE modem, the sound card, and
    the MPU-401 UART.

    The patch applies the idea to register disabled resources to all types
    of resources, not just to IRQs, DMAs, and IO ports. At the same time,
    it mimics the behavior of the "pnp_assign_xxx" functions from
    "drivers/pnp/manager.c" where resources with "no size" are considered
    disabled.

    No regressions were observed on hardware that does not require this
    patch.

    The patch is applied against 2.6.39.

    NB: The kernel's current PnP interface does not allow for disabling individual
    resources using the "/sys/bus/pnp/devices/$device/resources" file. Assuming
    this could be done, a device could be configured to use a disabled resource
    using a simple series of calls:

    echo disable > /sys/bus/pnp/devices/$device/resources
    echo clear > /sys/bus/pnp/devices/$device/resources
    echo set irq disabled > /sys/bus/pnp/devices/$device/resources
    echo fill > /sys/bus/pnp/devices/$device/resources
    echo activate > /sys/bus/pnp/devices/$device/resources

    This patch addresses only the parsing of PnP ACPI devices.

    ChangeLog (v1 -> v2):
    - extend patch description
    - fix typo in patch itself

    Signed-off-by: Witold Szczeponik
    Cc: Len Brown
    Cc: Adam Belay
    Cc: Bjorn Helgaas
    Cc: Bjorn Helgaas
    Cc: Henrique de Moraes Holschuh
    Cc: Matthew Garrett
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Witold Szczeponik
     

10 Jun, 2011

1 commit


12 Jan, 2011

2 commits

  • Len Brown
     
  • The PNP ACPI driver squirrels the ACPI handles of PNP devices' ACPI
    companions, but this isn't correct, because those handles should be
    accessed using the DEVICE_ACPI_HANDLE() macro operating on struct
    device objects.

    Using DEVICE_ACPI_HANDLE() in the PNP ACPI driver instead of the
    driver's own copies of the ACPI handles allows us to avoid a problem
    with docking stations where a machine docked before suspend to RAM
    and undocked while suspended crashes during the subsequent resume (in
    that case the ACPI companion of the PNP device in question doesn't
    exist any more while the device is being resumed). It also allows us
    to avoid the problem where suspend to RAM fails when the machine was
    undocked while suspended before (again, the ACPI companion of the PNP
    device is not present any more while it is being suspended).

    This change doesn't fix all of the the PNP ACPI driver's problems
    with PNP devices in docking stations (generally speaking, the driver
    has no idea that devices can come and go and doesn't even attempt to
    handle such events), but at least it makes suspend work for the
    users of docking stations who don't use the PNP devices located in
    there.

    References: https://bugzilla.kernel.org/show_bug.cgi?id=15100

    Reported-and-tested-by: Toralf Förster
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Bjorn Helgaas
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

11 Dec, 2010

1 commit


27 Oct, 2010

1 commit

  • This is cleanup mostly, nothing urgent.
    I came up with it when looking at dynamic debug which can
    enable pr_debug messages at runtime or boot param
    for a specific module.

    Advantages:
    - Any pnp code can make use of the moduleparam.h interface, the modules
    will show up as pnp.param.
    - Passing pnp.ddebug as kernel boot param will enable all pnp debug messages
    with my previous patch and CONFIG_DYNAMIC_DEBUG enabled.

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

    Thomas Renninger
     

25 Oct, 2010

1 commit


02 Oct, 2010

1 commit


01 Oct, 2010

1 commit

  • If primary ID (HID) is invalid try locating first valid ID on compatible
    ID list before giving up.

    This helps, for example, to recognize i8042 AUX port on Sony Vaio VPCZ1
    which uses SNYSYN0003 as HID. Without the patch users are forced to
    boot with i8042.nopnp to make use of their touchpads.

    Tested-by: Jan-Hendrik Zab
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Len Brown

    Dmitry Torokhov
     

19 Jul, 2010

1 commit

  • This patch (as1354) adds remote-wakeup support to the pnpacpi driver.
    The new can_wakeup method also allows other PNP protocol drivers
    (pnpbios or iaspnp) to add wakeup support, but I don't know enough
    about how they work to actually do it.

    Signed-off-by: Alan Stern
    Reviewed-by: Bjorn Helgaas
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     

29 Apr, 2010

1 commit

  • ACPI _CRS Address Space Descriptors have _MIN, _MAX, and _LEN. Linux has
    been computing Address Spaces as [_MIN to _MIN + _LEN - 1]. Based on the
    tests in the bug reports below, Windows apparently uses [_MIN to _MAX].

    Per spec (ACPI 4.0, Table 6-40), for _CRS fixed-size, fixed location
    descriptors, "_LEN must be (_MAX - _MIN + 1)", and when that's true, it
    doesn't matter which way we compute the end. But of course, there are
    BIOSes that don't follow this rule, and we're better off if Linux handles
    those exceptions the same way as Windows.

    This patch makes Linux use [_MIN to _MAX], as Windows seems to do. This
    effectively reverts 3162b6f0c5e and replaces it with simpler code.

    https://bugzilla.kernel.org/show_bug.cgi?id=14337 (round)
    https://bugzilla.kernel.org/show_bug.cgi?id=15480 (truncate)

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

    Bjorn Helgaas
     

07 Apr, 2010

1 commit


04 Apr, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

15 Mar, 2010

2 commits

  • Add support for bus number resources. This is for bridges with a range of
    bus numbers behind them. Previously, PNP ignored bus number resources.

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

    Bjorn Helgaas
     
  • Add support for resource windows. This is for bridge resources, i.e.,
    regions where a bridge forwards transactions from the primary to the
    secondary side. This does not add support for *setting* windows via
    the /proc interface.

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

    Bjorn Helgaas
     

16 Dec, 2009

1 commit

  • Add pnp_acpi_device(pnp_dev), which takes a PNP device and returns the
    associated ACPI device (or NULL, if the device is not a PNPACPI device).

    This allows us to write a PNP driver that can manage both traditional
    PNPBIOS and ACPI devices, treating ACPI-only functionality as an optional
    extension.

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

    Bjorn Helgaas
     

11 Dec, 2009

1 commit


26 Sep, 2009

3 commits


27 Aug, 2009

1 commit

  • Completed a major update for the acpi_get_object_info external interface.
    Changes include:
    - Support for variable, unlimited length HID, UID, and CID strings
    - Support Processor objects the same as Devices (HID,UID,CID,ADR,STA, etc.)
    - Call the _SxW power methods on behalf of a device object
    - Determine if a device is a PCI root bridge
    - Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO.
    These changes will require an update to all callers of this interface.
    See the ACPICA Programmer Reference for details.

    Also, update all invocations of acpi_get_object_info interface

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

    Bob Moore
     

24 Jun, 2009

1 commit


02 Jun, 2009

1 commit