16 Feb, 2015

1 commit

  • Pull driver core patches from Greg KH:
    "Really tiny set of patches for this kernel. Nothing major, all
    described in the shortlog and have been in linux-next for a while"

    * tag 'driver-core-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    sysfs: fix warning when creating a sysfs group without attributes
    firmware_loader: handle timeout via wait_for_completion_interruptible_timeout()
    firmware_loader: abort request if wait_for_completion is interrupted
    firmware: Correct function name in comment
    device: Change dev_ logging functions to return void
    device: Fix dev_dbg_once macro

    Linus Torvalds
     

15 Feb, 2015

1 commit

  • Merge fourth set of updates from Andrew Morton:

    - the rest of lib/

    - checkpatch updates

    - a few misc things

    - kasan: kernel address sanitizer

    - the rtc tree

    * emailed patches from Andrew Morton : (108 commits)
    ARM: mvebu: enable Armada 38x RTC driver in mvebu_v7_defconfig
    ARM: mvebu: add Device Tree description of RTC on Armada 38x
    MAINTAINERS: add the RTC driver for the Armada38x
    drivers/rtc/rtc-armada38x: add a new RTC driver for recent mvebu SoCs
    rtc: armada38x: add the device tree binding documentation
    rtc: rtc-ab-b5ze-s3: add sub-minute alarm support
    rtc: add support for Abracon AB-RTCMC-32.768kHz-B5ZE-S3 I2C RTC chip
    of: add vendor prefix for Abracon Corporation
    drivers/rtc/rtc-rk808.c: fix rtc time reading issue
    drivers/rtc/rtc-isl12057.c: constify struct regmap_config
    drivers/rtc/rtc-at91sam9.c: constify struct regmap_config
    drivers/rtc/rtc-imxdi.c: add more known register bits
    drivers/rtc/rtc-imxdi.c: trivial clean up code
    ARM: mvebu: ISL12057 rtc chip can now wake up RN102, RN102 and RN2120
    rtc: rtc-isl12057: add isil,irq2-can-wakeup-machine property for in-tree users
    drivers/rtc/rtc-isl12057.c: add alarm support to Intersil ISL12057 RTC driver
    drivers/rtc/rtc-pcf2123.c: add support for devicetree
    kprobes: makes kprobes/enabled works correctly for optimized kprobes.
    kprobes: set kprobes_all_disarmed earlier to enable re-optimization.
    init: remove CONFIG_INIT_FALLBACK
    ...

    Linus Torvalds
     

14 Feb, 2015

2 commits

  • printk and friends can now format bitmaps using '%*pb[l]'. cpumask
    and nodemask also provide cpumask_pr_args() and nodemask_pr_args()
    respectively which can be used to generate the two printf arguments
    necessary to format the specified cpu/nodemask.

    * Line termination only requires one extra space at the end of the
    buffer. Use PAGE_SIZE - 1 instead of PAGE_SIZE - 2 when formatting.

    Signed-off-by: Tejun Heo
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • * pm-cpufreq:
    cpufreq: speedstep-smi: enable interrupts when waiting

    * pm-cpuidle:
    intel_idle: support additional Broadwell model

    * pm-devfreq:
    PM / devfreq: event: testing the wrong variable

    * pm-opp:
    PM / OPP / clk: Remove unnecessary OOM message

    * pm-tools:
    tools/power turbostat: support additional Broadwell model
    tools/power turbostat: update parameters, documentation
    tools/power turbostat: Skip printing disabled package C-states

    Rafael J. Wysocki
     

12 Feb, 2015

1 commit

  • This patch reduces the kernel size by removing error messages that duplicate
    the normal OOM message.

    A simplified version of the semantic patch that finds this problem is as
    follows: (http://coccinelle.lip6.fr)

    @@
    identifier f,print,l;
    expression e;
    constant char[] c;
    @@

    e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...);
    if (e == NULL) {
    }

    Signed-off-by: Quentin Lambert
    Acked-by: Nishanth Menon
    Signed-off-by: Rafael J. Wysocki

    Quentin Lambert
     

11 Feb, 2015

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "We have a few new features this time, including a new SFI-based
    cpufreq driver, a new devfreq driver for Tegra Activity Monitor, a new
    devfreq class for providing its governors with raw utilization data
    and a new ACPI driver for AMD SoCs.

    Still, the majority of changes here are reworks of existing code to
    make it more straightforward or to prepare it for implementing new
    features on top of it. The primary example is the rework of ACPI
    resources handling from Jiang Liu, Thomas Gleixner and Lv Zheng with
    support for IOAPIC hotplug implemented on top of it, but there is
    quite a number of changes of this kind in the cpufreq core, ACPICA,
    ACPI EC driver, ACPI processor driver and the generic power domains
    core code too.

    The most active developer is Viresh Kumar with his cpufreq changes.

    Specifics:

    - Rework of the core ACPI resources parsing code to fix issues in it
    and make using resource offsets more convenient and consolidation
    of some resource-handing code in a couple of places that have grown
    analagous data structures and code to cover the the same gap in the
    core (Jiang Liu, Thomas Gleixner, Lv Zheng).

    - ACPI-based IOAPIC hotplug support on top of the resources handling
    rework (Jiang Liu, Yinghai Lu).

    - ACPICA update to upstream release 20150204 including an interrupt
    handling rework that allows drivers to install raw handlers for
    ACPI GPEs which then become entirely responsible for the given GPE
    and the ACPICA core code won't touch it (Lv Zheng, David E Box,
    Octavian Purdila).

    - ACPI EC driver rework to fix several concurrency issues and other
    problems related to events handling on top of the ACPICA's new
    support for raw GPE handlers (Lv Zheng).

    - New ACPI driver for AMD SoCs analogous to the LPSS (Low-Power
    Subsystem) driver for Intel chips (Ken Xue).

    - Two minor fixes of the ACPI LPSS driver (Heikki Krogerus, Jarkko
    Nikula).

    - Two new blacklist entries for machines (Samsung 730U3E/740U3E and
    510R) where the native backlight interface doesn't work correctly
    while the ACPI one does (Hans de Goede).

    - Rework of the ACPI processor driver's handling of idle states to
    make the code more straightforward and less bloated overall (Rafael
    J Wysocki).

    - Assorted minor fixes related to ACPI and SFI (Andreas Ruprecht,
    Andy Shevchenko, Hanjun Guo, Jan Beulich, Rafael J Wysocki, Yaowei
    Bai).

    - PCI core power management modification to avoid resuming (some)
    runtime-suspended devices during system suspend if they are in the
    right states already (Rafael J Wysocki).

    - New SFI-based cpufreq driver for Intel platforms using SFI
    (Srinidhi Kasagar).

    - cpufreq core fixes, cleanups and simplifications (Viresh Kumar,
    Doug Anderson, Wolfram Sang).

    - SkyLake CPU support and other updates for the intel_pstate driver
    (Kristen Carlson Accardi, Srinivas Pandruvada).

    - cpufreq-dt driver cleanup (Markus Elfring).

    - Init fix for the ARM big.LITTLE cpuidle driver (Sudeep Holla).

    - Generic power domains core code fixes and cleanups (Ulf Hansson).

    - Operating Performance Points (OPP) core code cleanups and kernel
    documentation update (Nishanth Menon).

    - New dabugfs interface to make the list of PM QoS constraints
    available to user space (Nishanth Menon).

    - New devfreq driver for Tegra Activity Monitor (Tomeu Vizoso).

    - New devfreq class (devfreq_event) to provide raw utilization data
    to devfreq governors (Chanwoo Choi).

    - Assorted minor fixes and cleanups related to power management
    (Andreas Ruprecht, Krzysztof Kozlowski, Rickard Strandqvist, Pavel
    Machek, Todd E Brandt, Wonhong Kwon).

    - turbostat updates (Len Brown) and cpupower Makefile improvement
    (Sriram Raghunathan)"

    * tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (151 commits)
    tools/power turbostat: relax dependency on APERF_MSR
    tools/power turbostat: relax dependency on invariant TSC
    Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources
    tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
    tools/power turbostat: relax dependency on root permission
    ACPI / video: Add disable_native_backlight quirk for Samsung 510R
    ACPI / PM: Remove unneeded nested #ifdef
    USB / PM: Remove unneeded #ifdef and associated dead code
    intel_pstate: provide option to only use intel_pstate with HWP
    ACPI / EC: Add GPE reference counting debugging messages
    ACPI / EC: Add query flushing support
    ACPI / EC: Refine command storm prevention support
    ACPI / EC: Add command flushing support.
    ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag
    ACPI: add AMD ACPI2Platform device support for x86 system
    ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()
    ACPI / EC: Update revision due to raw handler mode.
    ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp.
    ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode.
    ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model
    ...

    Linus Torvalds
     

10 Feb, 2015

2 commits

  • * pm-domains:
    PM: Convert dev_pm_put_subsys_data() into a void function
    PM: Update function header for dev_pm_get_subsys_data()
    PM / Domains: Handle errors from genpd's ->attach_dev() callback
    PM / Domains: Re-order initialization of generic_pm_domain_data
    PM / Domains: Free pm_subsys_data in error path in __pm_genpd_add_device()
    PM / Domains: Eliminate the mutex for the generic_pm_domain_data
    PM / Domains: Don't check for an existing device when adding a new
    PM / Domains: Don't allow an existing generic_pm_domain_data
    PM / Domains: Remove reference counting for the generic_pm_domain_data
    PM / Domains: Rename __pm_genpd_alloc|free_dev_data()
    PM / Domains: Remove pm_genpd_dev_need_restore() API

    Rafael J. Wysocki
     
  • * pm-qos:
    PM / QoS: Use lockdep asserts to find missing hold of power.lock
    PM / QoS: Add debugfs support to view the list of constraints

    * pm-opp:
    PM / OPP: Assert RCU lock in exported functions
    PM / OPP: Update kernel documentation
    PM / OPP: Ensure consistent naming of static functions
    PM / OPP: export dev_pm_opp_get_notifier

    * pm-devfreq:
    PM / devfreq: event: Add documentation for exynos-ppmu devfreq-event driver
    devfreq: Fix build break of devfreq-event class
    PM / devfreq: event: Add devfreq_event class
    PM / devfreq: tegra: add devfreq driver for Tegra Activity Monitor

    Rafael J. Wysocki
     

08 Feb, 2015

2 commits


05 Feb, 2015

2 commits

  • SMBus access functions assume that 16-bit values are formatted as
    little endian numbers. The direct i2c access functions in regmap,
    however, assume that 16-bit values are formatted as big endian numbers.
    As a result, the current code returns different values if an i2c chip's
    16-bit registers are accessed through i2c access functions vs. SMBus
    access functions.

    Use regmap_smbus_read_word_swapped and regmap_smbus_write_word_swapped
    for 16-bit SMBus accesses if a chip is configured as REGMAP_ENDIAN_BIG.
    If the chip is configured as REGMAP_ENDIAN_LITTLE, keep using
    regmap_smbus_write_word_data and regmap_smbus_read_word_data. Otherwise
    reject registration if the controller does not support direct i2c accesses.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Mark Brown

    Guenter Roeck
     
  • We'll need to call it from regmap-i2c.c, which can be built as module.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Mark Brown

    Guenter Roeck
     

04 Feb, 2015

13 commits

  • It is simpler to handle timeout by wait_for_completion_interruptible_timeout(),
    so remove previous delay work for timeout.

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • If current request is interrupted by signal, such as 'ctrl + c',
    this request has to be aborted for the following reasons:

    - the buf need to be removed from pending list
    - same requests from other contexts need to be completed

    Reported-by: Sasha Levin
    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • Use the correct function name in the kernel-doc comment above it.

    Signed-off-by: Borislav Petkov
    Acked-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Borislav Petkov
     
  • Clients using the dev_pm_put_subsys_data() API isn't interested of a
    return value. They care only of decreasing a reference to the device's
    pm_subsys_data. So, let's convert the API to a void function, which
    anyway seems like reasonable thing to do.

    Signed-off-by: Ulf Hansson
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • The commit "PM: Make dev_pm_get_subsys_data() always return 0 on success"
    changed the return value from dev_pm_get_subsys_data(). Let's update the
    comment in the function header to reflect this change as well.

    Signed-off-by: Ulf Hansson
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • The optional genpd's ->attach_dev() callback is invoked from
    __pm_genpd_add_device(). Let's add error handling from the response
    from this callback and propagate the error code.

    When __pm_genpd_add_device() is invoked through the generic OF-based PM
    domain look-up path, the device is being probed. Returning an error
    will mean the device won't be attached to its PM domain. Errors of
    -EPROBE_DEFER get special treatment and is propagated to the driver
    core.

    Therefore this change also enables the ->attach_dev() callback to
    be able to request for a deferred probe sequence.

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

    Ulf Hansson
     
  • Move the initialization of the struct generic_pm_domain_data into
    genpd_alloc_dev_data(), including the assignment of the device's
    ->pm_domain() callback. Make corresponding changes to
    genpd_free_dev_data().

    These changes will make the related code more readable. It will also
    decrease the critical regions for where genpd's mutex is being held and
    for where the device's power related spinlock is being held.

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

    Ulf Hansson
     
  • The error path in __pm_genpd_add_device() didn't decrease the reference
    to the struct pm_subsys_data.

    Let's move the calls to dev_pm_get|put_subsys_data() into
    genpd_alloc|free_dev_data() to fix this issue and thus prevent a
    potential memory leakage.

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

    Ulf Hansson
     
  • While adding devices to their PM domains, dev_pm_qos_add_notifier() was
    invoked while allocating the generic_pm_domain_data for the device.

    Since the generic_pm_domain_data's device pointer will be assigned
    after allocation, the ->genpd_dev_pm_qos_notifier() callback could be
    called prior having a valid pointer to the device. Similar scenario
    existed while removing a device from a genpd.

    To cope with these scenarios a mutex was used to protect the pointer to
    the device.

    By re-order the sequence for when dev_pm_qos_add|remove_notifier() are
    invoked, we make sure the ->genpd_dev_pm_qos_notifier() callback are
    always called with a valid device pointer available.

    In this way, we eliminate the need for protecting the pointer and thus
    we can remove the mutex from the struct generic_pm_domain_data.

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

    Ulf Hansson
     
  • When adding a device to a genpd, we no longer need to walk genpd's list
    of existing devices to verify it hasn't already been added.

    Instead we can now rely on the verification of not allowing existing
    generic_pm_domain_data for a device, since that has the same meaning.

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

    Ulf Hansson
     
  • When adding a device to a genpd, a struct generic_pm_domain_data is
    allocated per device.

    Verify that there are no existing generic_pm_domain_data for the device
    we are about to add, since that tells us it has already been added to a
    genpd.

    When genpd supported PM domain device callbacks, this was a valid
    scenario. Now it isn't so let's return an error code.

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

    Ulf Hansson
     
  • The reference counting was needed when genpd supported PM domain device
    callbacks. Since this option has been removed, let's also remove the
    reference counting of the struct generic_pm_domain_data.

    Signed-off-by: Ulf Hansson
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     
  • In a step to get consistent names of functions in genpd, rename
    the internal __pm_genpd_alloc|free_dev_data() into
    gendp_alloc|free_dev_data().

    As discussed on the linux-pm list, let's move towards the following
    name rules:

    Internal functions:
    genpd_*
    _genpd_*
    __genpd_*

    External functions:
    pm_genpd_*
    _pm_genpd_*
    __pm_genpd_*

    Signed-off-by: Ulf Hansson
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Ulf Hansson
     

02 Feb, 2015

1 commit


27 Jan, 2015

1 commit


24 Jan, 2015

6 commits


30 Dec, 2014

2 commits


19 Dec, 2014

2 commits

  • Pull more ACPI and power management updates from Rafael Wysocki:
    "These are regression fixes (leds-gpio, ACPI backlight driver,
    operating performance points library, ACPI device enumeration
    messages, cpupower tool), other bug fixes (ACPI EC driver, ACPI device
    PM), some cleanups in the operating performance points (OPP)
    framework, continuation of CONFIG_PM_RUNTIME elimination, a couple of
    minor intel_pstate driver changes, a new MAINTAINERS entry for it and
    an ACPI fan driver change needed for better support of thermal
    management in user space.

    Specifics:

    - Fix a regression in leds-gpio introduced by a recent commit that
    inadvertently changed the name of one of the properties used by the
    driver (Fabio Estevam).

    - Fix a regression in the ACPI backlight driver introduced by a
    recent fix that missed one special case that had to be taken into
    account (Aaron Lu).

    - Drop the level of some new kernel messages from the ACPI core
    introduced by a recent commit to KERN_DEBUG which they should have
    used from the start and drop some other unuseful KERN_ERR messages
    printed by ACPI (Rafael J Wysocki).

    - Revert an incorrect commit modifying the cpupower tool (Prarit
    Bhargava).

    - Fix two regressions introduced by recent commits in the OPP library
    and clean up some existing minor issues in that code (Viresh
    Kumar).

    - Continue to replace CONFIG_PM_RUNTIME with CONFIG_PM throughout the
    tree (or drop it where that can be done) in order to make it
    possible to eliminate CONFIG_PM_RUNTIME (Rafael J Wysocki, Ulf
    Hansson, Ludovic Desroches).

    There will be one more "CONFIG_PM_RUNTIME removal" batch after this
    one, because some new uses of it have been introduced during the
    current merge window, but that should be sufficient to finally get
    rid of it.

    - Make the ACPI EC driver more robust against race conditions related
    to GPE handler installation failures (Lv Zheng).

    - Prevent the ACPI device PM core code from attempting to disable
    GPEs that it has not enabled which confuses ACPICA and makes it
    report errors unnecessarily (Rafael J Wysocki).

    - Add a "force" command line switch to the intel_pstate driver to
    make it possible to override the blacklisting of some systems in
    that driver if needed (Ethan Zhao).

    - Improve intel_pstate code documentation and add a MAINTAINERS entry
    for it (Kristen Carlson Accardi).

    - Make the ACPI fan driver create cooling device interfaces witn
    names that reflect the IDs of the ACPI device objects they are
    associated with, except for "generic" ACPI fans (PNP ID "PNP0C0B").

    That's necessary for user space thermal management tools to be able
    to connect the fans with the parts of the system they are supposed
    to be cooling properly. From Srinivas Pandruvada"

    * tag 'pm+acpi-3.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
    MAINTAINERS: add entry for intel_pstate
    ACPI / video: update the skip case for acpi_video_device_in_dod()
    power / PM: Eliminate CONFIG_PM_RUNTIME
    NFC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / EC: Fix unexpected ec_remove_handlers() invocations
    Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()"
    tracing / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    x86 / PM: Replace CONFIG_PM_RUNTIME in io_apic.c
    PM: Remove the SET_PM_RUNTIME_PM_OPS() macro
    mmc: atmel-mci: use SET_RUNTIME_PM_OPS() macro
    PM / Kconfig: Replace PM_RUNTIME with PM in dependencies
    ARM / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    sound / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    phy / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    video / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    tty / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    spi: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    ACPI / PM: Do not disable wakeup GPEs that have not been enabled
    ACPI / utils: Drop error messages from acpi_evaluate_reference()
    ...

    Linus Torvalds
     
  • * pm-opp:
    PM / OPP: do error handling at the bottom of dev_pm_opp_add_dynamic()
    PM / OPP: handle allocation of device_opp in a separate routine
    PM / OPP: reuse find_device_opp() instead of duplicating code
    PM / OPP: Staticize __dev_pm_opp_remove()
    PM / OPP: replace kfree with kfree_rcu while freeing 'struct device_opp'

    * pm-cpufreq:
    MAINTAINERS: add entry for intel_pstate
    intel_pstate: Add a few comments
    intel_pstate: add kernel parameter to force loading

    * pm-tools:
    Revert "tools: cpupower: fix return checks for sysfs_get_idlestate_count()"

    Rafael J. Wysocki
     

18 Dec, 2014

3 commits

  • A lot of callers are missing the fact that dev_pm_opp_get_opp_count
    needs to be called under RCU lock. Given that RCU locks can safely be
    nested, instead of providing *_locked() API, let's take RCU lock inside
    dev_pm_opp_get_opp_count() and leave callers as is.

    Signed-off-by: Dmitry Torokhov
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Dmitry Torokhov
     
  • Not having OPP defined for a device is not a crime, we should not splat
    warning in this case. Also, it seems that we are ready to accept invalid
    dev (find_device_opp will return ERR_PTR(-EINVAL) then) so let's not
    crash in dev_name() in such case.

    Signed-off-by: Dmitry Torokhov
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Dmitry Torokhov
     
  • Certain OPP APIs need to be called under RCU lock; let's add a few
    rcu_lockdep_assert() calls to warn about potential misuse.

    Signed-off-by: Dmitry Torokhov
    Acked-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Dmitry Torokhov