09 Jun, 2017

1 commit


23 Feb, 2017

3 commits


09 Feb, 2017

1 commit

  • commit a96dfddbcc04336bbed50dc2b24823e45e09e80c upstream.

    Reading a sysfs "memoryN/valid_zones" file leads to the following oops
    when the first page of a range is not backed by struct page.
    show_valid_zones() assumes that 'start_pfn' is always valid for
    page_zone().

    BUG: unable to handle kernel paging request at ffffea017a000000
    IP: show_valid_zones+0x6f/0x160

    This issue may happen on x86-64 systems with 64GiB or more memory since
    their memory block size is bumped up to 2GiB. [1] An example of such
    systems is desribed below. 0x3240000000 is only aligned by 1GiB and
    this memory block starts from 0x3200000000, which is not backed by
    struct page.

    BIOS-e820: [mem 0x0000003240000000-0x000000603fffffff] usable

    Since test_pages_in_a_zone() already checks holes, fix this issue by
    extending this function to return 'valid_start' and 'valid_end' for a
    given range. show_valid_zones() then proceeds with the valid range.

    [1] 'Commit bdee237c0343 ("x86: mm: Use 2GB memory block size on
    large-memory x86-64 systems")'

    Link: http://lkml.kernel.org/r/20170127222149.30893-3-toshi.kani@hpe.com
    Signed-off-by: Toshi Kani
    Cc: Greg Kroah-Hartman
    Cc: Zhang Zhen
    Cc: Reza Arbab
    Cc: David Rientjes
    Cc: Dan Williams
    Signed-off-by: Greg Kroah-Hartman

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Toshi Kani
     

01 Feb, 2017

1 commit

  • commit 8a1f780e7f28c7c1d640118242cf68d528c456cd upstream.

    online_{kernel|movable} is used to change the memory zone to
    ZONE_{NORMAL|MOVABLE} and online the memory.

    To check that memory zone can be changed, zone_can_shift() is used.
    Currently the function returns minus integer value, plus integer
    value and 0. When the function returns minus or plus integer value,
    it means that the memory zone can be changed to ZONE_{NORNAL|MOVABLE}.

    But when the function returns 0, there are two meanings.

    One of the meanings is that the memory zone does not need to be changed.
    For example, when memory is in ZONE_NORMAL and onlined by online_kernel
    the memory zone does not need to be changed.

    Another meaning is that the memory zone cannot be changed. When memory
    is in ZONE_NORMAL and onlined by online_movable, the memory zone may
    not be changed to ZONE_MOVALBE due to memory online limitation(see
    Documentation/memory-hotplug.txt). In this case, memory must not be
    onlined.

    The patch changes the return type of zone_can_shift() so that memory
    online operation fails when memory zone cannot be changed as follows:

    Before applying patch:
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 7864320
    managed 7864320
    # echo online_movable > memory4097/state
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 8388608
    managed 8388608

    online_movable operation succeeded. But memory is onlined as
    ZONE_NORMAL, not ZONE_MOVABLE.

    After applying patch:
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 7864320
    managed 7864320
    # echo online_movable > memory4097/state
    bash: echo: write error: Invalid argument
    # grep -A 35 "Node 2" /proc/zoneinfo
    Node 2, zone Normal

    node_scanned 0
    spanned 8388608
    present 7864320
    managed 7864320

    online_movable operation failed because of failure of changing
    the memory zone from ZONE_NORMAL to ZONE_MOVABLE

    Fixes: df429ac03936 ("memory-hotplug: more general validation of zone during online")
    Link: http://lkml.kernel.org/r/2f9c3837-33d7-b6e5-59c0-6ca4372b2d84@gmail.com
    Signed-off-by: Yasuaki Ishimatsu
    Reviewed-by: Reza Arbab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Yasuaki Ishimatsu
     

12 Jan, 2017

1 commit

  • commit bed570307ed78f21b77cb04a1df781dee4a8f05a upstream.

    I noticed some wakeirq flakeyness with consumer drivers not using
    autosuspend. For drivers not using autosuspend, the wakeirq may never
    get unmasked in rpm_suspend() because of irq desc->depth.

    We are configuring dedicated wakeirqs to start with IRQ_NOAUTOEN as we
    naturally don't want them running until rpm_suspend() is called.

    However, when a consumer driver initially calls pm_runtime_get(), we
    now wrongly start with disable_irq_nosync() call on the dedicated
    wakeirq that is disabled to start with.

    This causes desc->depth to toggle between 1 and 2 instead of the usual
    0 and 1. This can prevent enable_irq() from unmasking the wakeirq as
    that only happens at desc->depth 1.

    This does not necessarily show up with drivers using autosuspend as
    there is time for disable_irq_nosync() before rpm_suspend() gets called
    after the autosuspend timeout.

    Let's fix the issue by adding wirq->status that lazily gets set on
    the first rpm_suspend(). We also need PM runtime core private functions
    for dev_pm_enable_wake_irq_check() and dev_pm_disable_wake_irq_check()
    so we can enable the dedicated wakeirq on the first rpm_suspend().

    While at it, let's also fix the comments for dev_pm_enable_wake_irq()
    and dev_pm_disable_wake_irq(). Those can still be used by the consumer
    drivers as needed because the IRQ core manages the interrupt usecount
    for us.

    Fixes: 4990d4fe327b (PM / Wakeirq: Add automated device wake IRQ handling)
    Signed-off-by: Tony Lindgren
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren
     

09 Jan, 2017

1 commit

  • commit 2e700f8d85975f516ccaad821278c1fe66b2cc98 upstream.

    When you use the firmware usermode helper fallback with a timeout value set to a
    value greater than INT_MAX (2147483647) a cast overflow issue causes the
    timeout value to go negative and breaks all usermode helper loading. This
    regression was introduced through commit 68ff2a00dbf5 ("firmware_loader:
    handle timeout via wait_for_completion_interruptible_timeout()") on kernel
    v4.0.

    The firmware_class drivers relies on the firmware usermode helper
    fallback as a mechanism to look for firmware if the direct filesystem
    search failed only if:

    a) You've enabled CONFIG_FW_LOADER_USER_HELPER_FALLBACK (not many distros):

    Then all of these callers will rely on the fallback mechanism in case
    the firmware is not found through an initial direct filesystem lookup:

    o request_firmware()
    o request_firmware_into_buf()
    o request_firmware_nowait()

    b) If you've only enabled CONFIG_FW_LOADER_USER_HELPER (most distros):

    Then only callers using request_firmware_nowait() with the second
    argument set to false, this explicitly is requesting the UMH firmware
    fallback to be relied on in case the first filesystem lookup fails.

    Using Coccinelle SmPL grammar we have identified only two drivers
    explicitly requesting the UMH firmware fallback mechanism:

    - drivers/firmware/dell_rbu.c
    - drivers/leds/leds-lp55xx-common.c

    Since most distributions only enable CONFIG_FW_LOADER_USER_HELPER the
    biggest impact of this regression are users of the dell_rbu and
    leds-lp55xx-common device driver which required the UMH to find their
    respective needed firmwares.

    The default timeout for the UMH is set to 60 seconds always, as of
    commit 68ff2a00dbf5 ("firmware_loader: handle timeout via
    wait_for_completion_interruptible_timeout()") the timeout was bumped
    to MAX_JIFFY_OFFSET ((LONG_MAX >> 1)-1). Additionally the MAX_JIFFY_OFFSET
    value was also used if the timeout was configured by a user to 0.

    The following works:

    echo 2147483647 > /sys/class/firmware/timeout

    But both of the following set the timeout to MAX_JIFFY_OFFSET even if
    we display 0 back to userspace:

    echo 2147483648 > /sys/class/firmware/timeout
    cat /sys/class/firmware/timeout
    0

    echo 0> /sys/class/firmware/timeout
    cat /sys/class/firmware/timeout
    0

    A max value of INT_MAX (2147483647) seconds is therefore implicit due to the
    another cast with simple_strtol().

    This fixes the secondary cast (the first one is simple_strtol() but its an
    issue only by forcing an implicit limit) by re-using the timeout variable and
    only setting retval in appropriate cases.

    Lastly worth noting systemd had ripped out the UMH firmware fallback
    mechanism from udev since udev 2014 via commit be2ea723b1d023b3d
    ("udev: remove userspace firmware loading support"), so as of systemd v217.

    Signed-off-by: Yves-Alexis Perez
    Fixes: 68ff2a00dbf5 "firmware_loader: handle timeout via wait_for_completion_interruptible_timeout()"
    Cc: Luis R. Rodriguez
    Cc: Ming Lei
    Cc: Bjorn Andersson
    Cc: Greg Kroah-Hartman
    Acked-by: Luis R. Rodriguez
    Reviewed-by: Bjorn Andersson
    [mcgrof@kernel.org: gave commit log a whole lot of love]
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Greg Kroah-Hartman

    Yves-Alexis Perez
     

06 Jan, 2017

2 commits

  • commit dc39d06fcd7a4a82d72eae7b71e94e888b96d29e upstream.

    The OPP structure must not be used out of the rcu protected section.
    Cache the values to be used in separate variables instead.

    Signed-off-by: Viresh Kumar
    Reviewed-by: Stephen Boyd
    Tested-by: Dave Gerlach
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Viresh Kumar
     
  • commit 91291d9ad92faa65a56a9a19d658d8049b78d3d4 upstream.

    Joonyoung Shim reported an interesting problem on his ARM octa-core
    Odoroid-XU3 platform. During system suspend, dev_pm_opp_put_regulator()
    was failing for a struct device for which dev_pm_opp_set_regulator() is
    called earlier.

    This happened because an earlier call to
    dev_pm_opp_of_cpumask_remove_table() function (from cpufreq-dt.c file)
    removed all the entries from opp_table->dev_list apart from the last CPU
    device in the cpumask of CPUs sharing the OPP.

    But both dev_pm_opp_set_regulator() and dev_pm_opp_put_regulator()
    routines get CPU device for the first CPU in the cpumask. And so the OPP
    core failed to find the OPP table for the struct device.

    This patch attempts to fix this problem by returning a pointer to the
    opp_table from dev_pm_opp_set_regulator() and using that as the
    parameter to dev_pm_opp_put_regulator(). This ensures that the
    dev_pm_opp_put_regulator() doesn't fail to find the opp table.

    Note that similar design problem also exists with other
    dev_pm_opp_put_*() APIs, but those aren't used currently by anyone and
    so we don't need to update them for now.

    Reported-by: Joonyoung Shim
    Signed-off-by: Stephen Boyd
    Signed-off-by: Viresh Kumar
    [ Viresh: Wrote commit log and tested on exynos 5250 ]
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Stephen Boyd
     

14 Nov, 2016

1 commit

  • Pull driver core fixes from Greg KH:
    "Here are two driver core fixes for 4.9-rc5.

    The first resolves an issue with some drivers not liking to be unbound
    and bound again (if CONFIG_DEBUG_TEST_DRIVER_REMOVE is enabled), which
    solves some reported problems with graphics and storage drivers. The
    other resolves a smatch error with the 4.9-rc1 driver core changes
    around this feature.

    Both have been in linux-next with no reported issues"

    * tag 'driver-core-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    driver core: fix smatch warning on dev->bus check
    driver core: skip removal test for non-removable drivers

    Linus Torvalds
     

11 Nov, 2016

1 commit

  • Consider two devices, A and B, where B is a child of A, and B utilizes
    asynchronous suspend (it does not matter whether A is sync or async). If
    B fails to suspend_noirq() or suspend_late(), or is interrupted by a
    wakeup (pm_wakeup_pending()), then it aborts and sets the async_error
    variable. However, device A does not (immediately) check the async_error
    variable; it may continue to run its own suspend_noirq()/suspend_late()
    callback. This is bad.

    We can resolve this problem by doing our error and wakeup checking
    (particularly, for the async_error flag) after waiting for children to
    suspend, instead of before. This also helps align the logic for the noirq and
    late suspend cases with the logic in __device_suspend().

    It's easy to observe this erroneous behavior by, for example, forcing a
    device to sleep a bit in its suspend_noirq() (to ensure the parent is
    waiting for the child to complete), then return an error, and watch the
    parent suspend_noirq() still get called. (Or similarly, fake a wakeup
    event at the right (or is it wrong?) time.)

    Fixes: de377b397272 (PM / sleep: Asynchronous threads for suspend_late)
    Fixes: 28b6fd6e3779 (PM / sleep: Asynchronous threads for suspend_noirq)
    Reported-by: Jeffy Chen
    Signed-off-by: Brian Norris
    Signed-off-by: Rafael J. Wysocki

    Brian Norris
     

31 Oct, 2016

2 commits

  • Commit d42a09802174 (driver core: skip removal test for non-removable
    drivers) introduced a smatch warning:

    drivers/base/dd.c:386 really_probe()
    warn: variable dereferenced before check 'dev->bus' (see line 373)

    Fix the warning by removing the dev->bus NULL check. dev->bus will never
    be NULL, so the check was unnecessary.

    Reported-by: Dan Carpenter
    Signed-off-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Rob Herring
     
  • Some drivers do not support removal/unbinding. These drivers should have
    drv->suppress_bind_attrs set to true, so use that to skip the removal
    test.

    This doesn't fix anything reported so far, but should prevent some other
    cases. Some drivers will need fixes to set suppress_bind_attrs to avoid
    this test.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=177021
    Fixes: bea5b158ff0d ("driver core: add test of driver remove calls during probe")
    Reported-by: Laszlo Ersek
    Signed-off-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Rob Herring
     

27 Oct, 2016

1 commit

  • The current state of driver removal is not great.
    CONFIG_DEBUG_TEST_DRIVER_REMOVE finds lots of errors. The help text
    currently undersells exactly how many errors this option will find. Add
    a bit more description to indicate this option shouldn't be turned on
    unless you actually want to debug driver removal. The text can be
    changed later when more drivers are fixed up.

    Signed-off-by: Laura Abbott
    Signed-off-by: Greg Kroah-Hartman

    Laura Abbott
     

08 Oct, 2016

1 commit

  • If store_mem_state() is called to online memory which is already online,
    it will return 1, the value it got from device_online().

    This is wrong because store_mem_state() is a device_attribute .store
    function. Thus a non-negative return value represents input bytes read.

    Set the return value to -EINVAL in this case.

    Link: http://lkml.kernel.org/r/1472743777-24266-1-git-send-email-arbab@linux.vnet.ibm.com
    Signed-off-by: Reza Arbab
    Cc: Greg Kroah-Hartman
    Cc: Vlastimil Babka
    Cc: Vitaly Kuznetsov
    Cc: David Rientjes
    Cc: Yaowei Bai
    Cc: Joonsoo Kim
    Cc: Dan Williams
    Cc: Xishi Qiu
    Cc: David Vrabel
    Cc: Chen Yucong
    Cc: Andrew Banman
    Cc: Seth Jennings
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Reza Arbab
     

06 Oct, 2016

1 commit

  • Pull pin control updates from Linus Walleij:
    "This is the bulk of pin control changes for the v4.9 cycle.

    General improvements:

    - nicer debugfs output with one pin/config pair per line.

    - continued efforts to strictify module vs bool.

    - constification and similar from Coccinelle engineers.

    - return error from pinctrl_bind_pins()

    - pulling in the ability to selectively disable mapping of unusable
    IRQs from the GPIO subsystem.

    New drivers:

    - new driver for the Aspeed pin controller family: AST2400 (G4) and
    AST2500 (G5) are supported. These are used by OpenBMC on the IBM
    Witherspoon platform.

    - new subdriver for the Allwinner sunxi GR8.

    Driver improvements:

    - drop default IRQ trigger types assigned during IRQ mapping on AT91
    and Nomadik. This error was identified by improvements in the IRQ
    core by Marc Zyngier.

    - active high/low types on the GPIO IRQs for the ST pin controller.

    - IRQ support on GPIOs on the STM32 pin controller.

    - Renesas Super-H/ARM sh-pfc: continued massive developments.

    - misc MXC improvements.

    - SPDIF on the Allwiner A31 SoC

    - IR remote and SPI NOR flash, NAND flash, I2C pins on the AMLogic
    SoC.

    - PWM pins on the Meson.

    - do not map unusable IRQs (taken by BIOS) on the Intel Cherryview.

    - add GPIO IRQ wakeup support to the Intel driver so we can wake up
    from button pushes.

    Deprecation:

    - delete the obsolete STiH415/6 SoC support"

    * tag 'pinctrl-v4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (75 commits)
    pinctrl: qcom: fix masking of pinmux functions
    pinctrl: intel: Configure GPIO chip IRQ as wakeup interrupts
    pinctrl: cherryview: Convert to use devm_gpiochip_add_data()
    pinctrl: cherryview: Do not add all southwest and north GPIOs to IRQ domain
    gpiolib: Make it possible to exclude GPIOs from IRQ domain
    pinctrl: nomadik: don't default-flag IRQs as falling
    pinctrl: st: Remove obsolete platforms from pinctrl-st dt doc
    pinctrl: st: Remove STiH415/6 SoC pinctrl driver support.
    pinctrl: amlogic: gxbb: add i2c pins
    pinctrl: amlogic: gxbb: add nand pins
    pinctrl: stm32: add IRQ_DOMAIN_HIERARCHY dependency
    pinctrl: amlogic: gxbb: add spi nor pins
    pinctrl: sh-pfc: r8a7794: Implement voltage switching for SDHI
    pinctrl: sh-pfc: r8a7791: Implement voltage switching for SDHI
    pinctrl: sh-pfc: Add PORT_GP_24 helper macro
    pinctrl: Fix "st,syscfg" definition for STM32 pinctrl
    driver: base: pinctrl: return error from pinctrl_bind_pins()
    pinctrl: meson-gxbb: add the missing SDIO interrupt pin
    pinctrl: aspeed: fix regmap error handling
    pinctrl: mediatek: constify gpio_chip structures
    ...

    Linus Torvalds
     

05 Oct, 2016

1 commit

  • Pull regmap updates from Mark Brown:
    "Another quiet release, a few small extensions to the set of register
    maps we support and an improvement in the debugfs code:

    - allow viewing of cached contents for write only registers via
    debugfs.

    - support a wider range of read/write flag masks in register formats.

    - support more little endian formats"

    * tag 'regmap-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
    regmap: Add missing little endian functions
    regmap: Allow longer flag masks for read and write
    regmap: debugfs: Add support for dumping write only device registers
    regmap: Add a function to check if a regmap register is cached

    Linus Torvalds
     

04 Oct, 2016

4 commits

  • Mark Brown
     
  • Pull driver core updates from Greg KH:
    "Here are the "big" driver core patches for 4.9-rc1. Also in here are a
    number of debugfs fixes that cropped up due to the changes that
    happened in 4.8 for that filesystem. Overall, nothing major, just a
    few fixes and cleanups.

    All of these have been in linux-next with no reported issues"

    * tag 'driver-core-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (23 commits)
    drivers: dma-coherent: Move spinlock in dma_alloc_from_coherent()
    drivers: dma-coherent: Fix DMA coherent size for less than page
    MAINTAINERS: extend firmware_class maintainer list
    debugfs: propagate release() call result
    driver-core: platform: Catch errors from calls to irq_get_irq_data
    sysfs print name of undiscoverable attribute group
    carl9170: fix debugfs crashes
    b43legacy: fix debugfs crash
    b43: fix debugfs crash
    debugfs: introduce a public file_operations accessor
    device core: Remove deprecated create_singlethread_workqueue
    drivers/base dmam_declare_coherent_memory leaks
    platform: don't return 0 from platform_get_irq[_byname]() on error
    cpu: clean up register_cpu func
    dma-mapping: use vma_pages().
    drivers: dma-coherent: use vma_pages().
    attribute_container: Fix typo
    base: soc: make it explicitly non-modular
    drivers: base: dma-mapping: page align the size when unmap_kernel_range
    platform driver: fix use-after-free in platform_device_del()
    ...

    Linus Torvalds
     
  • Pull irq updates from Thomas Gleixner:
    "The irq departement proudly presents:

    - A rework of the core infrastructure to optimally spread interrupt
    for multiqueue devices. The first version was a bit naive and
    failed to take thread siblings and other details into account.
    Developed in cooperation with Christoph and Keith.

    - Proper delegation of softirqs to ksoftirqd, so if ksoftirqd is
    active then no further softirq processsing on interrupt return
    happens. Otherwise we try to delegate and still run another batch
    of network packets in the irq return path, which then tries to
    delegate to ksoftirqd .....

    - A proper machine parseable sysfs based alternative for
    /proc/interrupts.

    - ACPI support for the GICV3-ITS and ARM interrupt remapping

    - Two new irq chips from the ARM SoC zoo: STM32-EXTI and MVEBU-PIC

    - A new irq chip for the JCore (SuperH)

    - The usual pile of small fixlets in core and irqchip drivers"

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits)
    softirq: Let ksoftirqd do its job
    genirq: Make function __irq_do_set_handler() static
    ARM/dts: Add EXTI controller node to stm32f429
    ARM/STM32: Select external interrupts controller
    drivers/irqchip: Add STM32 external interrupts support
    Documentation/dt-bindings: Document STM32 EXTI controller bindings
    irqchip/mips-gic: Use for_each_set_bit to iterate over local IRQs
    pci/msi: Retrieve affinity for a vector
    genirq/affinity: Remove old irq spread infrastructure
    genirq/msi: Switch to new irq spreading infrastructure
    genirq/affinity: Provide smarter irq spreading infrastructure
    genirq/msi: Add cpumask allocation to alloc_msi_entry
    genirq: Expose interrupt information through sysfs
    irqchip/gicv3-its: Use MADT ITS subtable to do PCI/MSI domain initialization
    irqchip/gicv3-its: Factor out PCI-MSI part that might be reused for ACPI
    irqchip/gicv3-its: Probe ITS in the ACPI way
    irqchip/gicv3-its: Refactor ITS DT init code to prepare for ACPI
    irqchip/gicv3-its: Cleanup for ITS domain initialization
    PCI/MSI: Setup MSI domain on a per-device basis using IORT ACPI table
    ACPI: Add new IORT functions to support MSI domain handling
    ...

    Linus Torvalds
     
  • Pull ACPI updates from Rafael Wysocki:
    "First off, the ACPICA code in the kernel is updated to upstream
    revision 20160831 that brings in a few bug fixes and cleanups. In
    particular, it is possible to mask GPEs now (and the sysfs interface
    for GPE control is fixed on top of that), problems related to the
    table loading mechanism are fixed and all code related to FADT version
    2 (which has never been part of the ACPI specification) is dropped.

    On the new features front, there is a new watchdog driver based on the
    ACPI WDAT (ACPI Watchdog Action Table), needed on some platforms to
    replace the iTCO watchdog that doesn't work there, and some UART
    devices get new definitions of built-in properties (to be accessed via
    the generic device properties API).

    Also, included is a fix for an ACPI-related PCI resorces allocation
    issue and a few problems in the EC driver and in the button and
    battery drivers are fixed.

    In addition to that, the ACPI CPPC library is updated to make batching
    of requests sent over the PCC channel possible (which reduces the PCC
    usage overhead substantially in some cases) and to support functional
    fixed hardware (FFH) type of CPPC registers access (which will allow
    CPPC to be used on x86 too in the future).

    As usual, there are some assorted fixes and cleanups too.

    Specifics:

    - Update of the ACPICA code in the kernel to upstream revision
    20160831 with the following major changes:

    * New mechanism for GPE masking.
    * Fixes for issues related to the LoadTable operator and table
    loading.
    * Fixes for issues related to so-called module-level code (MLC),
    that is AML that doesn't belong to any methods.
    * Change of the return value of the _OSI method to reflect the
    Windows behavior.
    * GAS (Generic Address Structure) support fix related to 32-bit
    FADT addresses.
    * Elimination of unnecessary FADT version 2 support.
    * ACPI tools fixes and cleanups.

    From Bob Moore, Lv Zheng, and Jung-uk Kim.

    - ACPI sysfs interface updates to fix GPE handling (on top of the new
    GPE masking mechanism in ACPICA) and issues related to table
    loading (Lv Zheng).

    - New watchdog driver based on the ACPI WDAT (ACPI Watchdog Action
    Table), needed on some platforms to replace the iTCO watchdog that
    doesn't work there and related updates of the intel_pmc_ipc,
    i2c/i801 and MFD/lcp_ich drivers (Mika Westerberg).

    - Driver core fix to prevent it from leaking secondary fwnode objects
    during device removal (Lukas Wunner).

    - New definitions of built-in properties for UART in ACPI-based x86
    SoC drivers and a 8250_dw driver quirk for the APM X-Gene SoC
    (Heikki Krogerus).

    - New device ID for the Vulcan SPI controller and constification of
    local strucures in the AMD SoC (APD) ACPI driver (Kamlakant Patel,
    Julia Lawall).

    - Fix for a bug causing the allocation of PCI resorces to fail if
    ACPI-enumerated child platform devices are registered below the PCI
    devices in question (Mika Westerberg).

    - Change of the default polarity for PCI legacy IRQs to high on
    systems booting wth ACPI on platforms with a GIC interrupt
    controller model fixing the discrepancy between the specification
    and HW behavior (Lorenzo Pieralisi).

    - Fixes for the handling of system suspend/resume in the ACPI EC
    driver and update of that driver to make it cope with the cases
    when the EC device defined in the ECDT has to be used throughout
    the entire system life cycle (Lv Zheng).

    - Update of the ACPI CPPC library to allow it to batch requests sent
    over the PCC channel (to reduce overhead), to support the fixed
    functional hardware (FFH) CPPC registers access type, to notify the
    mailbox framework about TX completions when the interrupt flag is
    set for the PCC mailbox, and to support HW-Reduced Communication
    Subspace type 2 (Ashwin Chaugule, Prashanth Prakash, Srinivas
    Pandruvada, Hoan Tran).

    - ACPI button driver fix and documentation update related to the
    handling of laptop lids (Lv Zheng).

    - ACPI battery driver initialization fix (Carlos Garnacho).

    - ACPI GPIO enumeration documentation update (Mika Westerberg).

    - Assorted updates of the core ACPI bus type code (Lukas Wunner, Lv
    Zheng).

    - Assorted cleanups of the ACPI table parsing code and the
    x86-specific ACPI code (Al Stone).

    - Fixes for assorted ACPI-related issues found in linux-next (Wei
    Yongjun)"

    * tag 'acpi-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (98 commits)
    ACPI / documentation: Use recommended name in GPIO property names
    watchdog: wdat_wdt: Fix warning for using 0 as NULL
    watchdog: wdat_wdt: fix return value check in wdat_wdt_probe()
    platform/x86: intel_pmc_ipc: Do not create iTCO watchdog when WDAT table exists
    i2c: i801: Do not create iTCO watchdog when WDAT table exists
    mfd: lpc_ich: Do not create iTCO watchdog when WDAT table exists
    ACPI / bus: Adjust ACPI subsystem initialization for new table loading mode
    ACPICA: Parser: Fix a regression in LoadTable support
    ACPICA: Tables: Fix "UNLOAD" code path lock issues
    ACPI / watchdog: Add support for WDAT hardware watchdog
    ACPI / platform: Pay attention to parent device's resources
    PCI: Add pci_find_resource()
    ACPI / CPPC: Support PCC with interrupt flag
    ACPI / sysfs: Update sysfs signature handling code
    ACPI / sysfs: Fix an issue for LoadTable opcode
    ACPICA: Tables: Fix a regression in acpi_tb_find_table()
    ACPI / tables: Remove duplicated include from tables.c
    ACPI / APD: constify local structures
    x86: ACPI: make variable names clearer in acpi_parse_madt_lapic_entries()
    x86: ACPI: remove extraneous white space after semicolon
    ...

    Linus Torvalds
     

02 Oct, 2016

3 commits

  • * pm-cpuidle:
    ARM: cpuidle: Fix error return code

    * pm-opp:
    PM / OPP: Don't support OPP if it provides supported-hw but platform does not
    PM / OPP: avoid maybe-uninitialized warning

    * pm-avs:
    PM / AVS: SmartReflex: Neaten logging

    Rafael J. Wysocki
     
  • * pm-domains:
    PM / Domains: Rename pm_genpd_sync_poweron|poweroff()
    PM / Domains: Don't measure latency of ->power_on|off() during system PM
    PM / Domains: Remove redundant system PM callbacks
    PM / Domains: Simplify detaching a device from its genpd
    PM / Domains: Allow holes in genpd_data.domains array
    PM / Domains: Add support for removing nested PM domains by provider
    PM / Domains: Add support for removing PM domains
    PM / Domains: Store the provider in the PM domain structure
    PM / Domains: Prepare for adding support to remove PM domains
    PM / Domains: Verify the PM domain is present when adding a provider
    PM / Domains: Don't expose xlate and provider helper functions
    PM / Domains: Don't expose generic_pm_domain structure to clients
    staging: board: Remove calls to of_genpd_get_from_provider()
    ARM: EXYNOS: Remove calls to of_genpd_get_from_provider()
    PM / Domains: Add new helper functions for device-tree
    PM / Domains: Always enable debugfs support if available

    Rafael J. Wysocki
     
  • * device-properties:
    serial: 8250_dw: Add quirk for APM X-Gene SoC
    ACPI / LPSS: Provide build-in properties of the UART
    ACPI / APD: Provide build-in properties of the UART
    driver core: Don't leak secondary fwnode on device removal

    Rafael J. Wysocki
     

28 Sep, 2016

2 commits

  • We don't need to hold the spinlock while zeroing the allocated memory.
    In case we handle big buffers this is a severe issue as other CPUs might
    be spinning half a second or longer.

    Signed-off-by: Bastian Hecht
    Signed-off-by: George G. Davis
    Signed-off-by: Mark Craske
    Signed-off-by: Greg Kroah-Hartman

    Bastian Hecht
     
  • We fix a bug in dma_mmap_from_coherent() that appears when we map non page
    aligned DMA memory. It cuts off the non aligned part (this is different to
    dma_alloc_coherent() that always rounds up to full pages). So for mappings
    of less than a page we get -ENXIO as dma_mmap_from_coherent() assumes we
    want to map zero pages.

    Signed-off-by: George G. Davis
    Signed-off-by: Jiada Wang
    Signed-off-by: Mark Craske
    Signed-off-by: Greg Kroah-Hartman

    George G. Davis
     

27 Sep, 2016

1 commit


26 Sep, 2016

1 commit

  • The OPP framework allows each OPP to set a opp-supported-hw property
    which provides values that are matched against supported_hw values
    provided by the platform to limit support for certain OPPs on specific
    hardware. Currently, if the platform does not set supported_hw values,
    all OPPs are interpreted as supported, even if they have provided their
    own opp-supported-hw values.

    If an OPP has provided opp-supported-hw, it is indicating that there is
    some specific hardware configuration it is supported by. These constraints
    should be honored, and if no supported_hw has been provided by the
    platform, there is no way to determine if that OPP is actually supported,
    so it should be marked as not supported.

    Signed-off-by: Dave Gerlach
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Dave Gerlach
     

24 Sep, 2016

5 commits

  • These are internal static functions to genpd. Let's conform to the naming
    rules, by dropping the "pm_" prefix from these.

    Signed-off-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • Measure latency does by itself contribute to an increased latency, thus we
    should avoid it when it isn't needed.

    Currently genpd measures latencies in the system PM phase for the
    ->power_on|off() callbacks, except in the syscore case when it's not
    allowed to use ktime_get() as timekeeping may be suspended.

    Since there should be plenty of occasions during runtime PM to perform
    these measurements, let's rely on that and drop them from system PM. This
    will also make it consistent for how measurements are done of the runtime
    PM callbacks (as those may be invoked during system PM).

    Signed-off-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • In cases when the PM domain haven't assigned a system PM callback, the PM
    core fall-backs to check for the callback at the driver level instead.
    This makes it redundant to assign a pm_generic_* helper function to a
    corresponding system PM callback at a PM domain level.

    Therefore, let's remove these assignments in pm_genpd_init().

    Signed-off-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • There's no need to validate the PM domain by using genpd_lookup_dev() when
    removing the device via genpd's genpd_dev_pm_detach() function. That's
    because this function can't be called, unless there is a valid PM domain
    for the device.

    To simplify the behaviour, let's move code from pm_genpd_remove_device()
    into a new internal function, genpd_remove_device(), which is called from
    pm_genpd_remove_device() and genpd_dev_pm_detach().

    Signed-off-by: Ulf Hansson
    Reviewed-by: Lina Iyer
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • Pull regmap fix from Mark Brown:
    "A fix for an issue with double locking that was introduced earlier
    this release. I'd missed in review that we were already in a locked
    region when trying to drop part of the cache"

    * tag 'regmap-fix-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
    regmap: fix deadlock on _regmap_raw_write() error path

    Linus Torvalds
     

23 Sep, 2016

1 commit


22 Sep, 2016

1 commit

  • Commit 815806e39bf6 ("regmap: drop cache if the bus transfer error")
    added a call to regcache_drop_region() to error path in
    _regmap_raw_write(). However that path runs with regmap lock taken,
    and regcache_drop_region() tries to re-take it, causing a deadlock.
    Fix that by calling map->cache_ops->drop() directly.

    Signed-off-by: Nikita Yushchenko
    Signed-off-by: Mark Brown

    Nikita Yushchenko
     

21 Sep, 2016

1 commit


17 Sep, 2016

2 commits

  • When CONFIG_OPTIMIZE_INLINING is set and we are building with -Wmaybe-uninitialized
    enabled, we can get a warning for the opp core driver:

    drivers/base/power/opp/core.c: In function 'dev_pm_opp_set_rate':
    drivers/base/power/opp/core.c:560:8: warning: 'ou_volt_min' may be used uninitialized in this function [-Wmaybe-uninitialized]

    This has only now appeared as a result of commit 797da5598f3a ("PM / devfreq:
    Add COMPILE_TEST for build coverage"), which makes the driver visible in
    some configurations that didn't have it before.

    The warning is a false positive that I got with gcc-6.1.1, but there is
    a simple workaround in removing the local variables that we get warnings
    for (all three are affected depending on the configuration). This also
    makes the code easier to read.

    Signed-off-by: Arnd Bergmann
    Reviewed-by: Stephen Boyd
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Arnd Bergmann
     
  • In platforms such as Rockchip's, the array of domains isn't always
    filled without holes, as which domains are present depend on the
    particular SoC revision.

    By allowing holes to be in the array, such SoCs can still use a single
    set of constants to index the array of power domains.

    Fixes: 0159ec670763 (PM / Domains: Verify the PM domain is present when adding a provider)
    Signed-off-by: Tomeu Vizoso
    Acked-by: Jon Hunter
    Acked-by: Ulf Hansson
    Reviewed-by: Heiko Stuebner
    Tested-by: Heiko Stuebner
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Tomeu Vizoso
     

16 Sep, 2016

1 commit

  • This with the longer read and write masks allow supporting more
    exotic devices. For example a little endian SPI device:

    static const struct regmap_config foo_regmap_config = {
    .reg_bits = 16,
    .reg_stride = 4,
    .val_bits = 16,
    .write_flag_mask = 0x8000,
    .reg_format_endian = REGMAP_ENDIAN_LITTLE,
    .val_format_endian = REGMAP_ENDIAN_LITTLE,
    ...
    };

    Signed-off-by: Tony Lindgren
    Signed-off-by: Mark Brown

    Tony Lindgren