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
     

17 Dec, 2014

1 commit


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

14 Dec, 2014

1 commit

  • This is just a small optimization. The start_pfn can be obtained directly
    by phys_index << PFN_SECTION_SHIFT. So the call of page_to_pfn() is
    redundant and remove it.

    Signed-off-by: Zhang Zhen
    Acked-by: Yasuaki Ishimatsu
    Acked-by: David Rientjes
    Cc: Dave Hansen
    Cc: Wang Nan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zhang Zhen
     

12 Dec, 2014

2 commits

  • Pull devicetree changes from Grant Likely:
    "Lots of activity in the devicetree code for v3.18. Most of it is
    related to getting all of the overlay support code in place, but there
    are other important things in there.

    Highlights:

    - OF_RECONFIG notifiers for SPI, I2C and Platform devices. Those
    subsystems can now respond to live changes to the device tree.

    - CONFIG_OF_OVERLAY method for applying live changes to the device
    tree

    - Removal of the of_allnodes list. This used to be used to iterate
    over all the nodes in the device tree, but it is unnecessary
    because the same thing can be done by iterating over the list of
    child pointers. Getting rid of of_allnodes saves some memory and
    avoids the possibility of of_allnodes being sorted differently from
    the child lists.

    - Support for retrieving original DTB blob via sysfs. Needed by
    kexec.

    - More unittests

    - Documentation and minor bug fixes"

    * tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux: (42 commits)
    of: Delete unnecessary check before calling "of_node_put()"
    of: Drop ->next pointer from struct device_node
    spi: Check for spi_of_notifier when CONFIG_OF_DYNAMIC=y
    of: support passing console options with stdout-path
    of: add optional options parameter to of_find_node_by_path()
    of: Add bindings for chosen node, stdout-path
    of: Remove unneeded and incorrect MODULE_DEVICE_TABLE
    ARM: dt: fix up PL011 device tree bindings
    of: base, fix of_property_read_string_helper kernel-doc
    of: remove select of non-existant OF_DEVICE config symbol
    spi/of: Add OF notifier handler
    spi/of: Create new device registration method and accessors
    i2c/of: Add OF_RECONFIG notifier handler
    i2c/of: Factor out Devicetree registration code
    of/overlay: Add overlay unittests
    of/overlay: Introduce DT overlay support
    of/reconfig: Add OF_DYNAMIC notifier for platform_bus_type
    of/reconfig: Always use the same structure for notifiers
    of/reconfig: Add debug output for OF_RECONFIG notifiers
    of/reconfig: Add empty stubs for the of_reconfig methods
    ...

    Linus Torvalds
     
  • * fixes:
    PM / OPP: remove double calls to find_device_opp()
    PM / OPP: set new_opp->dev_opp to a valid dev_opp
    leds: leds-gpio: Fix the "default-state" property check

    Rafael J. Wysocki
     

11 Dec, 2014

8 commits

  • Pull ACPI and power management updates from Rafael Wysocki:
    "This time we have some more new material than we used to have during
    the last couple of development cycles.

    The most important part of it to me is the introduction of a unified
    interface for accessing device properties provided by platform
    firmware. It works with Device Trees and ACPI in a uniform way and
    drivers using it need not worry about where the properties come from
    as long as the platform firmware (either DT or ACPI) makes them
    available. It covers both devices and "bare" device node objects
    without struct device representation as that turns out to be necessary
    in some cases. This has been in the works for quite a few months (and
    development cycles) and has been approved by all of the relevant
    maintainers.

    On top of that, some drivers are switched over to the new interface
    (at25, leds-gpio, gpio_keys_polled) and some additional changes are
    made to the core GPIO subsystem to allow device drivers to manipulate
    GPIOs in the "canonical" way on platforms that provide GPIO
    information in their ACPI tables, but don't assign names to GPIO lines
    (in which case the driver needs to do that on the basis of what it
    knows about the device in question). That also has been approved by
    the GPIO core maintainers and the rfkill driver is now going to use
    it.

    Second is support for hardware P-states in the intel_pstate driver.
    It uses CPUID to detect whether or not the feature is supported by the
    processor in which case it will be enabled by default. However, it
    can be disabled entirely from the kernel command line if necessary.

    Next is support for a platform firmware interface based on ACPI
    operation regions used by the PMIC (Power Management Integrated
    Circuit) chips on the Intel Baytrail-T and Baytrail-T-CR platforms.
    That interface is used for manipulating power resources and for
    thermal management: sensor temperature reporting, trip point setting
    and so on.

    Also the ACPI core is now going to support the _DEP configuration
    information in a limited way. Basically, _DEP it supposed to reflect
    off-the-hierarchy dependencies between devices which may be very
    indirect, like when AML for one device accesses locations in an
    operation region handled by another device's driver (usually, the
    device depended on this way is a serial bus or GPIO controller). The
    support added this time is sufficient to make the ACPI battery driver
    work on Asus T100A, but it is general enough to be able to cover some
    other use cases in the future.

    Finally, we have a new cpufreq driver for the Loongson1B processor.

    In addition to the above, there are fixes and cleanups all over the
    place as usual and a traditional ACPICA update to a recent upstream
    release.

    As far as the fixes go, the ACPI LPSS (Low-power Subsystem) driver for
    Intel platforms should be able to handle power management of the DMA
    engine correctly, the cpufreq-dt driver should interact with the
    thermal subsystem in a better way and the ACPI backlight driver should
    handle some more corner cases, among other things.

    On top of the ACPICA update there are fixes for race conditions in the
    ACPICA's interrupt handling code which might lead to some random and
    strange looking failures on some systems.

    In the cleanups department the most visible part is the series of
    commits targeted at getting rid of the CONFIG_PM_RUNTIME configuration
    option. That was triggered by a discussion regarding the generic
    power domains code during which we realized that trying to support
    certain combinations of PM config options was painful and not really
    worth it, because nobody would use them in production anyway. For
    this reason, we decided to make CONFIG_PM_SLEEP select
    CONFIG_PM_RUNTIME and that lead to the conclusion that the latter
    became redundant and CONFIG_PM could be used instead of it. The
    material here makes that replacement in a major part of the tree, but
    there will be at least one more batch of that in the second part of
    the merge window.

    Specifics:

    - Support for retrieving device properties information from ACPI _DSD
    device configuration objects and a unified device properties
    interface for device drivers (and subsystems) on top of that. As
    stated above, this works with Device Trees and ACPI and allows
    device drivers to be written in a platform firmware (DT or ACPI)
    agnostic way. The at25, leds-gpio and gpio_keys_polled drivers are
    now going to use this new interface and the GPIO subsystem is
    additionally modified to allow device drivers to assign names to
    GPIO resources returned by ACPI _CRS objects (in case _DSD is not
    present or does not provide the expected data). The changes in
    this set are mostly from Mika Westerberg, Rafael J Wysocki, Aaron
    Lu, and Darren Hart with some fixes from others (Fabio Estevam,
    Geert Uytterhoeven).

    - Support for Hardware Managed Performance States (HWP) as described
    in Volume 3, section 14.4, of the Intel SDM in the intel_pstate
    driver. CPUID is used to detect whether or not the feature is
    supported by the processor. If supported, it will be enabled
    automatically unless the intel_pstate=no_hwp switch is present in
    the kernel command line. From Dirk Brandewie.

    - New Intel Broadwell-H ID for intel_pstate (Dirk Brandewie).

    - Support for firmware interface based on ACPI operation regions used
    by the PMIC chips on the Intel Baytrail-T and Baytrail-T-CR
    platforms for power resource control and thermal management (Aaron
    Lu).

    - Limited support for retrieving off-the-hierarchy dependencies
    between devices from ACPI _DEP device configuration objects and
    deferred probing support for the ACPI battery driver based on the
    _DEP information to make that driver work on Asus T100A (Lan
    Tianyu).

    - New cpufreq driver for the Loongson1B processor (Kelvin Cheung).

    - ACPICA update to upstream revision 20141107 which only affects
    tools (Bob Moore).

    - Fixes for race conditions in the ACPICA's interrupt handling code
    and in the ACPI code related to system suspend and resume (Lv Zheng
    and Rafael J Wysocki).

    - ACPI core fix for an RCU-related issue in the ioremap() regions
    management code that slowed down significantly after CPUs had been
    allowed to enter idle states even if they'd had RCU callbakcs
    queued and triggered some problems in certain proprietary graphics
    driver (and elsewhere). The fix replaces synchronize_rcu() in that
    code with synchronize_rcu_expedited() which makes the issue go
    away. From Konstantin Khlebnikov.

    - ACPI LPSS (Low-Power Subsystem) driver fix to handle power
    management of the DMA engine included into the LPSS correctly. The
    problem is that the DMA engine doesn't have ACPI PM support of its
    own and it simply is turned off when the last LPSS device having
    ACPI PM support goes into D3cold. To work around that, the PM
    domain used by the ACPI LPSS driver is redesigned so at least one
    device with ACPI PM support will be on as long as the DMA engine is
    in use. From Andy Shevchenko.

    - ACPI backlight driver fix to avoid using it on "Win8-compatible"
    systems where it doesn't work and where it was used by default by
    mistake (Aaron Lu).

    - Assorted minor ACPI core fixes and cleanups from Tomasz Nowicki,
    Sudeep Holla, Huang Rui, Hanjun Guo, Fabian Frederick, and Ashwin
    Chaugule (mostly related to the upcoming ARM64 support).

    - Intel RAPL (Running Average Power Limit) power capping driver fixes
    and improvements including new processor IDs (Jacob Pan).

    - Generic power domains modification to power up domains after
    attaching devices to them to meet the expectations of device
    drivers and bus types assuming devices to be accessible at probe
    time (Ulf Hansson).

    - Preliminary support for controlling device clocks from the generic
    power domains core code and modifications of the ARM/shmobile
    platform to use that feature (Ulf Hansson).

    - Assorted minor fixes and cleanups of the generic power domains core
    code (Ulf Hansson, Geert Uytterhoeven).

    - Assorted minor fixes and cleanups of the device clocks control code
    in the PM core (Geert Uytterhoeven, Grygorii Strashko).

    - Consolidation of device power management Kconfig options by making
    CONFIG_PM_SLEEP select CONFIG_PM_RUNTIME and removing the latter
    which is now redundant (Rafael J Wysocki and Kevin Hilman). That
    is the first batch of the changes needed for this purpose.

    - Core device runtime power management support code cleanup related
    to the execution of callbacks (Andrzej Hajda).

    - cpuidle ARM support improvements (Lorenzo Pieralisi).

    - cpuidle cleanup related to the CPUIDLE_FLAG_TIME_VALID flag and a
    new MAINTAINERS entry for ARM Exynos cpuidle (Daniel Lezcano and
    Bartlomiej Zolnierkiewicz).

    - New cpufreq driver callback (->ready) to be executed when the
    cpufreq core is ready to use a given policy object and cpufreq-dt
    driver modification to use that callback for cooling device
    registration (Viresh Kumar).

    - cpufreq core fixes and cleanups (Viresh Kumar, Vince Hsu, James
    Geboski, Tomeu Vizoso).

    - Assorted fixes and cleanups in the cpufreq-pcc, intel_pstate,
    cpufreq-dt, pxa2xx cpufreq drivers (Lenny Szubowicz, Ethan Zhao,
    Stefan Wahren, Petr Cvek).

    - OPP (Operating Performance Points) framework modification to allow
    OPPs to be removed too and update of a few cpufreq drivers
    (cpufreq-dt, exynos5440, imx6q, cpufreq) to remove OPPs (added
    during initialization) on driver removal (Viresh Kumar).

    - Hibernation core fixes and cleanups (Tina Ruchandani and Markus
    Elfring).

    - PM Kconfig fix related to CPU power management (Pankaj Dubey).

    - cpupower tool fix (Prarit Bhargava)"

    * tag 'pm+acpi-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (120 commits)
    i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c
    dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    tools: cpupower: fix return checks for sysfs_get_idlestate_count()
    drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME
    MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    leds: leds-gpio: Fix multiple instances registration without 'label' property
    iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    hwrandom / exynos / PM: Use CONFIG_PM in #ifdef
    block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    USB / PM: Drop CONFIG_PM_RUNTIME from the USB core
    PM: Merge the SET*_RUNTIME_PM_OPS() macros
    ...

    Linus Torvalds
     
  • This makes CMA memory area size zero for x86 in default configuration
    (doesn't change on the other architectures). If default CMA size is
    zero, DMA_CMA is disabled. It can be enabled by passing cma= to the
    kernel.

    This makes less impact on x86. Because there is no mainline driver that
    requires it for x86, and Peter Hurley reported the performance
    regression, as this is trying to drive _all_ dma mapping allocations
    through a _very_ small window.

    Signed-off-by: Akinobu Mita
    Reported-by: Peter Hurley
    Cc: Peter Hurley
    Cc: Chuck Ebbert
    Cc: Jean Delvare
    Acked-by: Marek Szyprowski
    Cc: Konrad Rzeszutek Wilk
    Cc: David Woodhouse
    Cc: Don Dutile
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Andi Kleen
    Cc: Yinghai Lu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • This makes it less error prone and moves common resource deallocation at a
    single place.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Get the 'device_opp' allocation code into a separate routine to keep only the
    necessary part in dev_pm_opp_add_dynamic().

    Also do s/sizeof(struct device_opp)/sizeof(*dev_opp) and remove the print
    message on kzalloc() failure as checkpatch warns for that.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Reuse find_device_opp() in opp_set_availability() instead of duplicating code.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Its a local routine and need not be accessible outside of opp.c.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Somehow one of the instance of freeing resources failed to use kfree_rcu() and
    used kfree() instead. This might cause problems as the node might be referenced
    by readers under rcu locks and we must wait for the rcu grace period as well.

    While we are at it, also update comment over 'struct device_opp' to mention why
    we are waiting for both rcu and srcu grace periods.

    Fixes: 129eec55df6a (PM / OPP Introduce APIs to remove OPPs)
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • * pm-opp:
    PM / OPP: remove double calls to find_device_opp()
    PM / OPP: set new_opp->dev_opp to a valid dev_opp

    Rafael J. Wysocki
     

10 Dec, 2014

2 commits

  • By mistake we called find_device_opp() twice in of_free_opp_table(), fix it.

    Generated diff doesn't show the problem well and so here is the code snippet:

    void of_free_opp_table(struct device *dev)
    {
    struct device_opp *dev_opp = find_device_opp(dev);
    struct dev_pm_opp *opp, *tmp;

    /* Check for existing list for 'dev' */
    dev_opp = find_device_opp(dev);

    ...
    }

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • We find/allocate dev_opp after using its value to fill new_opp->dev_opp right
    now. Move this to a later point where dev_opp is valid.

    Fixes: a7470db6fec4 (PM / OPP don't match for existing OPPs when list is empty)
    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

09 Dec, 2014

4 commits

  • * pm-runtime: (25 commits)
    i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c
    dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME
    MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    hwrandom / exynos / PM: Use CONFIG_PM in #ifdef
    block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
    USB / PM: Drop CONFIG_PM_RUNTIME from the USB core
    PM: Merge the SET*_RUNTIME_PM_OPS() macros
    PM / Kconfig: Do not select PM directly from Kconfig files
    PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
    ...

    Rafael J. Wysocki
     
  • * pm-domains:
    ARM: shmobile: Convert to genpd flags for PM clocks for R-mobile
    ARM: shmobile: Convert to genpd flags for PM clocks for r8a7779
    PM / Domains: Initial PM clock support for genpd
    PM / Domains: Power on the PM domain right after attach completes
    PM / Domains: Move struct pm_domain_data to pm_domain.h
    PM / Domains: Extract code to power off/on a PM domain
    PM / Domains: Make genpd parameter of pm_genpd_present() const

    * pm-sleep:
    PM / hibernate: Deletion of an unnecessary check before the function call "vfree"
    PM / Hibernate: Migrate to ktime_t

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

    Rafael J. Wysocki
     
  • * powercap:
    powercap / RAPL: fix build dependency on iosf_mbi
    powercap / RAPL: add new model ids
    powercap / RAPL: handle atom and core differences
    powercap / RAPL: abstract per cpu type functions

    * pm-clk:
    PM / clock_ops: make __pm_clk_enable more generic
    PM / clock_ops: Add pm_clk_add_clk()

    * pm-config:
    PM: Kconfig: fix unmet dependency for CPU_PM

    * pm-opp:
    PM / OPP replace kfree_rcu() with call_srcu() in opp_set_availability()
    PM / OPP Introduce APIs to remove OPPs
    PM / OPP mark OPPs as 'static' or 'dynamic'
    PM / OPP don't match for existing OPPs when list is empty
    PM / OPP rename 'head' as 'rcu_head' or 'srcu_head' based on its type

    Rafael J. Wysocki
     
  • * device-properties:
    leds: leds-gpio: Fix multiple instances registration without 'label' property
    leds: leds-gpio: Fix legacy GPIO number case
    ACPI / property: Drop size_prop from acpi_dev_get_property_reference()
    leds: leds-gpio: Convert gpio_blink_set() to use GPIO descriptors
    ACPI / GPIO: Document ACPI GPIO mappings API
    net: rfkill: gpio: Add default GPIO driver mappings for ACPI
    ACPI / GPIO: Driver GPIO mappings for ACPI GPIOs
    input: gpio_keys_polled: Make use of device property API
    leds: leds-gpio: Make use of device property API
    gpio: Support for unified device properties interface
    Driver core: Unified interface for firmware node properties
    input: gpio_keys_polled: Add support for GPIO descriptors
    leds: leds-gpio: Add support for GPIO descriptors
    gpio: sch: Consolidate core and resume banks
    gpio / ACPI: Add support for _DSD device properties
    misc: at25: Make use of device property API
    ACPI: Allow drivers to match using Device Tree compatible property
    Driver core: Unified device properties interface for platform firmware
    ACPI: Add support for device specific properties

    Rafael J. Wysocki
     

04 Dec, 2014

2 commits

  • After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
    selected) PM_RUNTIME is always set if PM is set, so quite a few
    depend on CONFIG_PM or even may be dropped entirely in some cases.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM in the PM core code.

    Reviewed-by: Ulf Hansson
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • It's quite common for PM domains to use PM clocks. Typically from SOC
    specific code, the per device PM clock list is created and
    pm_clk_suspend|resume() are invoked to handle clock gating/ungating.

    A step towards consolidation is to integrate PM clock support into
    genpd, which is what this patch does.

    In this initial step, the calls to the pm_clk_suspend|resume() are
    handled within genpd, but the per device PM clock list still needs to
    be created from SOC specific code. It seems reasonable to have gendp to
    handle that as well, but that left to future patches to address.

    It's not every users of genpd that are keen on using PM clocks, thus we
    need to provide this a configuration option for genpd. Therefore let's
    add flag field in the genpd struct to keep this information and define
    a new GENDP_FLAG_PM_CLK bit for it.

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

    Ulf Hansson
     

30 Nov, 2014

5 commits

  • This existed before we introduced call_srcu() in opp layer to synchronize with
    srcu_notifier_call_chain() while removing OPPs. And is a potential bug which
    wasn't noticed earlier.

    Let fix it as well by using the right API to free OPP.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • OPPs are created statically (from DT) or dynamically. Currently we don't free
    OPPs that are created statically, when the module unloads. And so if the module
    is inserted back again, we get warning for duplicate OPPs as the same were
    already present.

    Also, there might be a need to remove dynamic OPPs in future and so API for that
    is also added.

    This patch adds helper APIs to remove/free existing static and dynamic OPPs.

    Because the OPPs are used both under RCU and SRCU, we have to wait for grace
    period of both. And so are using kfree_rcu() from within call_srcu().

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Static OPPs are the ones created from Device Tree entries and dynamic are the
    ones created at runtime by calling dev_pm_opp_add().

    There is a need to distinguish them as we need to free static OPPs from cpufreq
    drivers when they are removed.

    So, add another field 'dynamic' in 'struct dev_pm_opp' to keep this information.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • OPP list is guaranteed to be empty when 'dev_opp' is created. And so we don't
    need to run the comparison loop with existing OPPs.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     
  • Both 'struct dev_pm_opp' and 'struct device_opp' have member with name 'head'
    but with different types. This leads to confusion while reading the code.

    Name them 'rcu_head' and 'srcu_head'.

    Signed-off-by: Viresh Kumar
    Signed-off-by: Rafael J. Wysocki

    Viresh Kumar
     

29 Nov, 2014

1 commit


27 Nov, 2014

4 commits

  • The vunmap() function performes also input parameter validation. Thus the test
    around the call is not needed.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Signed-off-by: Greg Kroah-Hartman

    Markus Elfring
     
  • When using request_firmware_nowait() with FW_ACTION_NOHOTPLUG param to
    expose user helper interface, if the user do not react immediately, after
    120 seconds there will be a hung task warning message dumped as below:

    [ 3000.784235] INFO: task kworker/0:0:8259 blocked for more than 120 seconds.
    [ 3000.791281] Tainted: G E 3.16.0-rc1-yocto-standard #41
    [ 3000.798082] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [ 3000.806072] kworker/0:0 D cd0075c8 0 8259 2 0x00000000
    [ 3000.812765] Workqueue: events request_firmware_work_func
    [ 3000.818253] cd375e18 00000046 0000000e cd0075c8 000000f0 cd40ea00 cd375fec 1b883e89
    [ 3000.826374] 0000026b cd40ea00 80000000 00000001 cd0075c8 00000000 cd375de4 c119917f
    [ 3000.834492] cd563360 cd375df4 c119a0ab cd563360 00000000 cd375e24 c119a1d6 00000000
    [ 3000.842616] Call Trace:
    [ 3000.845252] [] ? kernfs_next_descendant_post+0x3f/0x50
    [ 3000.851543] [] ? kernfs_activate+0x6b/0xc0
    [ 3000.856790] [] ? kernfs_add_one+0xd6/0x130
    [ 3000.862047] [] schedule+0x22/0x60
    [ 3000.866548] [] schedule_timeout+0x175/0x1d0
    [ 3000.871887] [] ? __kernfs_create_file+0x71/0xa0
    [ 3000.877574] [] ? sysfs_add_file_mode_ns+0xaa/0x180
    [ 3000.883533] [] wait_for_completion+0x6f/0xb0
    [ 3000.888961] [] ? wake_up_process+0x40/0x40
    [ 3000.894219] [] _request_firmware+0x750/0x9f0
    [ 3000.899666] [] ? n_tty_receive_buf2+0x1f/0x30
    [ 3000.905200] [] request_firmware_work_func+0x22/0x50
    [ 3000.911235] [] process_one_work+0x122/0x380
    [ 3000.916571] [] worker_thread+0xf9/0x470
    [ 3000.921555] [] ? create_and_start_worker+0x50/0x50
    [ 3000.927497] [] ? create_and_start_worker+0x50/0x50
    [ 3000.933448] [] kthread+0x9f/0xc0
    [ 3000.937850] [] ret_from_kernel_thread+0x20/0x30
    [ 3000.943548] [] ? kthread_worker_fn+0x100/0x100

    This patch change the wait_for_completion() function call to
    wait_for_completion_interruptible() function call for solving the issue.

    Cc: Matt Fleming
    Signed-off-by: Kweh, Hock Leong
    Acked-by: Ming Lei
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Greg Kroah-Hartman

    Kweh, Hock Leong
     
  • Since device/firmware coredumps can contain private data, it can
    be desirable to turn them off unconditionally to be certain that
    no such data will be collected by the system.

    To achieve this, provide a "disabled" sysfs class attribute that
    can only be changed from 0 to 1 and not back. Upon disabling,
    discard existing coredumps and stop storing new ones.

    Signed-off-by: Johannes Berg
    Reviewed-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • Rafael J. Wysocki
     

25 Nov, 2014

2 commits