08 Sep, 2021

1 commit


12 Jun, 2021

1 commit


31 May, 2021

1 commit

  • pm_runtime_get_sync(), contradictory to intuition, does not drop the
    runtime PM usage counter on errors which lead to several wrong usages in
    drivers (missing the put). pm_runtime_resume_and_get() was added as a
    better implementation so document the preference of using it, hoping it
    will stop bad patterns.

    Suggested-by: Marek Szyprowski
    Signed-off-by: Krzysztof Kozlowski
    [ rjw: Documentation change edits ]
    Signed-off-by: Rafael J. Wysocki

    Krzysztof Kozlowski
     

29 Apr, 2021

1 commit

  • Pull power supply and reset updates from Sebastian Reichel:
    "battery/charger driver changes:
    - core:
    - provide function stubs if CONFIG_POWER_SUPPLY=n
    - reduce loglevel for probe defer info
    - surface:
    - new battery and charger drivers for Surface
    - bq27xxx:
    - add bq78z100 support
    - fix current_now/power_avg for newer chips
    - cw2015:
    - add CHARGE_NOW support
    - ab8500:
    - drop pdata support
    - convert most DT bindings to YAML
    - lots of minor fixes and cleanups

    reset drivers:
    - ltc2952-poweroff:
    - make trigger delay configurable from DT
    - minor fixes and cleanups"

    * tag 'for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (97 commits)
    power: supply: cpcap-battery: fix invalid usage of list cursor
    power: supply: bq256xx: add kerneldoc for structure members
    power: supply: act8945a: correct kerneldoc
    power: supply: max17040: remove unneeded double cast
    power: supply: max17040: handle device_property_read_u8_array() failure
    power: supply: max14577: remove unneeded variable initialization
    power: supply: surface-charger: Make symbol 'surface_ac_pm_ops' static
    power: supply: surface-battery: Make some symbols static
    power: reset: restart-poweroff: Add missing MODULE_DEVICE_TABLE
    power: reset: hisi-reboot: add missing MODULE_DEVICE_TABLE
    power: supply: s3c_adc_battery: fix possible use-after-free in s3c_adc_bat_remove()
    power: supply: generic-adc-battery: fix possible use-after-free in gab_remove()
    power: supply: Add AC driver for Surface Aggregator Module
    power: supply: Add battery driver for Surface Aggregator Module
    power: supply: bq25980: Move props from battery node
    power: supply: core: Use true and false for bool variable
    power: supply: goldfish: Remove the GOLDFISH dependency
    power: reset: ltc2952: make trigger delay configurable
    power: supply: cpcap-charger: Simplify bool conversion
    power: supply: cpcap-charger: Add usleep to cpcap charger to avoid usb plug bounce
    ...

    Linus Torvalds
     

09 Apr, 2021

1 commit

  • Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to
    deal with usage counter") added a new runtime-PM API function without
    updating the documentation in runtime_pm.rst.

    Add the missing documentation.

    Signed-off-by: Alan Stern
    Fixes: dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
    Signed-off-by: Rafael J. Wysocki

    Alan Stern
     

02 Apr, 2021

1 commit

  • Changesets: 70c23e62d20c ("dt-bindings: power: supply: Fix remaining battery.txt links")
    and: 471dec8023d1 ("dt-bindings: power: Convert battery.txt to battery.yaml")
    renamed: Documentation/devicetree/bindings/power/supply/battery.txt
    to: Documentation/devicetree/bindings/power/supply/battery.yaml.

    Update its cross-reference accordingly.

    Fixes: 70c23e62d20c ("dt-bindings: power: supply: Fix remaining battery.txt links")
    Fixes: 471dec8023d1 ("dt-bindings: power: Convert battery.txt to battery.yaml")
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sebastian Reichel

    Mauro Carvalho Chehab
     

23 Feb, 2021

1 commit

  • Pull documentation updates from Jonathan Corbet:
    "It has been a relatively quiet cycle in docsland.

    - As promised, the minimum Sphinx version to build the docs is now
    1.7, and we have dropped support for Python 2 entirely. That
    allowed the removal of a bunch of compatibility code.

    - A set of treewide warning fixups from Mauro that I applied after it
    became clear nobody else was going to deal with them.

    - The automarkup mechanism can now create cross-references from
    relative paths to RST files.

    - More translations, typo fixes, and warning fixes"

    * tag 'docs-5.12' of git://git.lwn.net/linux: (75 commits)
    docs: kernel-hacking: be more civil
    docs: Remove the Microsoft rhetoric
    Documentation/admin-guide: kernel-parameters: Update nohlt section
    doc/admin-guide: fix spelling mistake: "perfomance" -> "performance"
    docs: Document cross-referencing using relative path
    docs: Enable usage of relative paths to docs on automarkup
    docs: thermal: fix spelling mistakes
    Documentation: admin-guide: Update kvm/xen config option
    docs: Make syscalls' helpers naming consistent
    coding-style.rst: Avoid comma statements
    Documentation: /proc/loadavg: add 3 more field descriptions
    Documentation/submitting-patches: Add blurb about backtraces in commit messages
    Docs: drop Python 2 support
    Move our minimum Sphinx version to 1.7
    Documentation: input: define ABS_PRESSURE/ABS_MT_PRESSURE resolution as grams
    scripts/kernel-doc: add internal hyperlink to DOC: sections
    Update Documentation/admin-guide/sysctl/fs.rst
    docs: Update DTB format references
    docs: zh_CN: add iio index.rst translation
    docs/zh_CN: add iio ep93xx_adc.rst translation
    ...

    Linus Torvalds
     

16 Feb, 2021

1 commit

  • * powercap:
    powercap: intel_rapl: Use topology interface in rapl_init_domains()
    powercap: intel_rapl: Use topology interface in rapl_add_package()
    powercap/intel_rapl: add support for AlderLake Mobile
    powercap/drivers/dtpm: Fix size of object being allocated
    powercap/drivers/dtpm: Fix an IS_ERR() vs NULL check
    powercap/drivers/dtpm: Fix some missing unlock bugs
    powercap/drivers/dtpm: Fix a double shift bug
    powercap/drivers/dtpm: Fix __udivdi3 and __aeabi_uldivmod unresolved symbols
    powercap/drivers/dtpm: Add CPU energy model based support
    powercap/drivers/dtpm: Add API for dynamic thermal power management
    Documentation/powercap/dtpm: Add documentation for dtpm
    units: Add Watt units

    * pm-misc:
    PM: Kconfig: remove unneeded "default n" options
    PM: EM: update Kconfig description and drop "default n" option

    Rafael J. Wysocki
     

28 Jan, 2021

1 commit


12 Jan, 2021

1 commit

  • Replace the lkml.org links with lore to better use a single source
    that's more likely to stay available long-term.

    Done by bash script:

    cvt_lkml_to_lore ()
    {
    tmpfile=$(mktemp ./.cvt_links.XXXXXXX)

    header=$(echo $1 | sed 's@/lkml/@/lkml/headers/@')

    wget -qO - $header > $tmpfile
    if [[ $? == 0 ]] ; then
    link=$(grep -i '^Message-Id:' $tmpfile | head -1 | \
    sed -r -e 's/^\s*Message-Id:\s*\s*$//' -e 's@^@https://lore.kernel.org/r/@')
    # echo "testlink: $link"
    if [ -n "$link" ] ; then
    wget -qO - $link > /dev/null
    if [[ $? == 0 ]] ; then
    echo $link
    fi
    fi
    fi

    rm -f $tmpfile
    }

    git grep -P -o "\bhttps?://(?:www.)?lkml.org/lkml[\/\w]+" $@ |
    while read line ; do
    echo $line
    file=$(echo $line | cut -f1 -d':')
    link=$(echo $line | cut -f2- -d':')
    newlink=$(cvt_lkml_to_lore $link)
    if [[ -n "$newlink" ]] ; then
    sed -i -e "s#\b$link\b#$newlink#" $file
    fi
    done

    Link: https://lore.kernel.org/patchwork/patch/1265849/#1462688
    Signed-off-by: Joe Perches
    Link: https://lore.kernel.org/r/77cdb7f32cfb087955bfc3600b86c40bed5d4104.camel@perches.com
    Signed-off-by: Jonathan Corbet

    Joe Perches
     

23 Dec, 2020

1 commit

  • The dynamic thermal and power management is a technique to dynamically
    adjust the power consumption of different devices in order to ensure a
    global thermal constraint.

    An userspace daemon is usually monitoring the temperature and the
    power to take immediate action on the device.

    The DTPM framework provides an unified API to userspace to act on the
    power.

    Document this framework.

    Signed-off-by: Daniel Lezcano
    Reviewed-by: Lukasz Luba
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     

11 Nov, 2020

2 commits

  • Update description and meaning of a new flag, which indicates the type of
    power scale used for a registered Energy Model (EM) device.

    Reviewed-by: Quentin Perret
    Signed-off-by: Lukasz Luba
    Signed-off-by: Rafael J. Wysocki

    Lukasz Luba
     
  • The Energy Model (EM) can store power values in milli-Watts or in abstract
    scale. This might cause issues in the subsystems which use the EM for
    estimating the device power, such as:

    - mixing of different scales in a subsystem which uses multiple
    (cooling) devices (e.g. thermal Intelligent Power Allocation (IPA))

    - assuming that energy [milli-Joules] can be derived from the EM power
    values which might not be possible since the power scale doesn't have
    to be in milli-Watts

    To avoid misconfiguration add the requisite documentation to the EM and
    related subsystems: EAS and IPA.

    Signed-off-by: Lukasz Luba
    Signed-off-by: Rafael J. Wysocki

    Lukasz Luba
     

30 Sep, 2020

1 commit

  • PCI devices support two variants of the D3 power state: D3hot (main power
    present) D3cold (main power removed). Previously struct pci_dev contained:

    unsigned int d3_delay; /* D3->D0 transition time in ms */
    unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */

    "d3_delay" refers specifically to the D3hot state. Rename it to
    "d3hot_delay" to avoid ambiguity and align with the ACPI "_DSM for
    Specifying Device Readiness Durations" in the PCI Firmware spec r3.2,
    sec 4.6.9.

    There is no change to the functionality.

    Link: https://lore.kernel.org/r/20200730210848.1578826-1-kw@linux.com
    Signed-off-by: Krzysztof Wilczyński
    Signed-off-by: Bjorn Helgaas

    Krzysztof Wilczyński
     

03 Aug, 2020

1 commit

  • * pm-sleep:
    PM: sleep: spread "const char *" correctness
    PM: hibernate: fix white space in a few places
    freezer: Add unsafe version of freezable_schedule_timeout_interruptible() for NFS
    PM: sleep: core: Emit changed uevent on wakeup_sysfs_add/remove

    * pm-domains:
    PM: domains: Restore comment indentation for generic_pm_domain.child_links
    PM: domains: Fix up terminology with parent/child

    * powercap:
    powercap: Add Power Limit4 support
    powercap: idle_inject: Replace play_idle() with play_idle_precise() in comments
    powercap: intel_rapl: add support for Sapphire Rapids

    * pm-tools:
    pm-graph v5.7 - important s2idle fixes
    cpupower: Replace HTTP links with HTTPS ones
    cpupower: Fix NULL but dereferenced coccicheck errors
    cpupower: Fix comparing pointer to 0 coccicheck warns

    Rafael J. Wysocki
     

27 Jul, 2020

1 commit

  • Modern Intel Mobile platforms support power limit4 (PL4), which is
    the SoC package level maximum power limit (in Watts). It can be used
    to preemptively limits potential SoC power to prevent power spikes
    from tripping the power adapter and battery over-current protection.
    This patch enables this feature by exposing package level peak power
    capping control to userspace via RAPL sysfs interface. With this,
    application like DTPF can modify PL4 power limit, the similar way
    of other package power limit (PL1).
    As this feature is not tested on previous generations, here it is
    enabled only for the platform that has been verified to work,
    for safety concerns.

    Signed-off-by: Sumeet Pawnikar
    Co-developed-by: Zhang Rui
    Signed-off-by: Zhang Rui
    Reviewed-by: Srinivas Pandruvada
    Tested-by: Srinivas Pandruvada
    Signed-off-by: Rafael J. Wysocki

    Sumeet Pawnikar
     

24 Jun, 2020

1 commit


03 Jun, 2020

1 commit

  • Pull power management updates from Rafael Wysocki:
    "These rework the system-wide PM driver flags, make runtime switching
    of cpuidle governors easier, improve the user space hibernation
    interface code, add intel-speed-select interface documentation, add
    more debug messages to the ACPI code handling suspend to idle, update
    the cpufreq core and drivers, fix a minor issue in the cpuidle core
    and update two cpuidle drivers, improve the PM-runtime framework,
    update the Intel RAPL power capping driver, update devfreq core and
    drivers, and clean up the cpupower utility.

    Specifics:

    - Rework the system-wide PM driver flags to make them easier to
    understand and use and update their documentation (Rafael Wysocki,
    Alan Stern).

    - Allow cpuidle governors to be switched at run time regardless of
    the kernel configuration and update the related documentation
    accordingly (Hanjun Guo).

    - Improve the resume device handling in the user space hibernarion
    interface code (Domenico Andreoli).

    - Document the intel-speed-select sysfs interface (Srinivas
    Pandruvada).

    - Make the ACPI code handing suspend to idle print more debug
    messages to help diagnose issues with it (Rafael Wysocki).

    - Fix a helper routine in the cpufreq core and correct a typo in the
    struct cpufreq_driver kerneldoc comment (Rafael Wysocki, Wang
    Wenhu).

    - Update cpufreq drivers:

    - Make the intel_pstate driver start in the passive mode by
    default on systems without HWP (Rafael Wysocki).

    - Add i.MX7ULP support to the imx-cpufreq-dt driver and add
    i.MX7ULP to the cpufreq-dt-platdev blacklist (Peng Fan).

    - Convert the qoriq cpufreq driver to a platform one, make the
    platform code create a suitable device object for it and add
    platform dependencies to it (Mian Yousaf Kaukab, Geert
    Uytterhoeven).

    - Fix wrong compatible binding in the qcom driver (Ansuel Smith).

    - Build the omap driver by default for ARCH_OMAP2PLUS (Anders
    Roxell).

    - Add r8a7742 SoC support to the dt cpufreq driver (Lad
    Prabhakar).

    - Update cpuidle core and drivers:

    - Fix three reference count leaks in error code paths in the
    cpuidle core (Qiushi Wu).

    - Convert Qualcomm SPM to a generic cpuidle driver (Stephan
    Gerhold).

    - Fix up the execution order when entering a domain idle state in
    the PSCI driver (Ulf Hansson).

    - Fix a reference counting issue related to clock management and
    clean up two oddities in the PM-runtime framework (Rafael Wysocki,
    Andy Shevchenko).

    - Add ElkhartLake support to the Intel RAPL power capping driver and
    remove an unused local MSR definition from it (Jacob Pan, Sumeet
    Pawnikar).

    - Update devfreq core and drivers:

    - Replace strncpy() with strscpy() in the devfreq core and use
    lockdep asserts instead of manual checks for a locked mutex in
    it (Dmitry Osipenko, Krzysztof Kozlowski).

    - Add a generic imx bus scaling driver and make it register an
    interconnect device (Leonard Crestez, Gustavo A. R. Silva).

    - Make the cpufreq notifier in the tegra30 driver take boosting
    into account and delete an unuseful error message from that
    driver (Dmitry Osipenko, Markus Elfring).

    - Remove unneeded semicolon from the cpupower code (Zou Wei)"

    * tag 'pm-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (51 commits)
    cpuidle: Fix three reference count leaks
    PM: runtime: Replace pm_runtime_callbacks_present()
    PM / devfreq: Use lockdep asserts instead of manual checks for locked mutex
    PM / devfreq: imx-bus: Fix inconsistent IS_ERR and PTR_ERR
    PM / devfreq: Replace strncpy with strscpy
    PM / devfreq: imx: Register interconnect device
    PM / devfreq: Add generic imx bus scaling driver
    PM / devfreq: tegra30: Delete an error message in tegra_devfreq_probe()
    PM / devfreq: tegra30: Make CPUFreq notifier to take into account boosting
    PM: hibernate: Restrict writes to the resume device
    PM: runtime: clk: Fix clk_pm_runtime_get() error path
    cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver
    ACPI: EC: PM: s2idle: Extend GPE dispatching debug message
    ACPI: PM: s2idle: Print type of wakeup debug messages
    powercap: RAPL: remove unused local MSR define
    PM: runtime: Make clear what we do when conditions are wrong in rpm_suspend()
    Documentation: admin-guide: pm: Document intel-speed-select
    PM: hibernate: Split off snapshot dev option
    PM: hibernate: Incorporate concurrency handling
    Documentation: ABI: make current_governer_ro as a candidate for removal
    ...

    Linus Torvalds
     

07 May, 2020

1 commit

  • The single user could have called freeze_secondary_cpus() directly.

    Since this function was a source of confusion, remove it as it's
    just a pointless wrapper.

    While at it, rename enable_nonboot_cpus() to thaw_secondary_cpus() to
    preserve the naming symmetry.

    Done automatically via:

    git grep -l enable_nonboot_cpus | xargs sed -i 's/enable_nonboot_cpus/thaw_secondary_cpus/g'

    Signed-off-by: Qais Yousef
    Signed-off-by: Thomas Gleixner
    Cc: "Rafael J. Wysocki"
    Link: https://lkml.kernel.org/r/20200430114004.17477-1-qais.yousef@arm.com

    Qais Yousef
     

25 Apr, 2020

5 commits

  • Update the documentation of the driver flags for system-wide power
    management to reflect the current code flows and be more consistent.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Rename DPM_FLAG_LEAVE_SUSPENDED to DPM_FLAG_MAY_SKIP_RESUME which
    matches its purpose more closely.

    No functional impact.

    Suggested-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Wolfram Sang # for I2C
    Acked-by: Alan Stern
    Acked-by: Bjorn Helgaas

    Rafael J. Wysocki
     
  • Rename DPM_FLAG_NEVER_SKIP to DPM_FLAG_NO_DIRECT_COMPLETE which
    matches its purpose more closely.

    No functional impact.

    Suggested-by: Alan Stern
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Bjorn Helgaas # for PCI parts
    Acked-by: Jeff Kirsher
    Acked-by: Alan Stern
    Acked-by: Bjorn Helgaas
    Acked-by: Alex Deucher

    Rafael J. Wysocki
     
  • The name of dev_pm_may_skip_resume() may be easily confused with the
    power.may_skip_resume flag which is not checked by that function, so
    rename the former as dev_pm_skip_resume().

    No functional impact.

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

    Rafael J. Wysocki
     
  • The current code in device_resume_noirq() causes the entire early
    resume and resume phases of device suspend to be skipped for
    devices for which the noirq resume phase have been skipped (due
    to the LEAVE_SUSPENDED flag being set) on the premise that those
    devices should stay in runtime-suspend after system-wide resume.

    However, that may not be correct in two situations. First, the
    middle layer (subsystem) noirq resume callback may be missing for
    a given device, but its early resume callback may be present and it
    may need to do something even if it decides to skip the driver
    callback. Second, if the device's wakeup settings were adjusted
    in the suspend phase without resuming the device (that was in
    runtime suspend at that time), they most likely need to be
    adjusted again in the resume phase and so the driver callback
    in that phase needs to be run.

    For the above reason, modify the core to allow the middle layer
    ->resume_late callback to run even if its ->resume_noirq callback
    is missing (and the core has skipped the driver-level callback
    in that phase) and to allow all device callbacks to run in the
    resume phase. Also make the core set the PM-runtime status of
    devices with SMART_SUSPEND set whose resume callbacks are not
    skipped to "active" in the "noirq" resume phase and update the
    affected subsystems (PCI and ACPI) accordingly.

    After this change, middle-layer (subsystem) callbacks will always
    be invoked in all phases of system suspend and resume and driver
    callbacks will always run in the prepare, suspend, resume, and
    complete phases for all devices.

    For devices with SMART_SUSPEND set, driver callbacks will be
    skipped in the late and noirq phases of system suspend if those
    devices remain in runtime suspend in __device_suspend_late().
    Driver callbacks will also be skipped for them during the
    noirq and early phases of the "thaw" transition related to
    hibernation in that case.

    Setting LEAVE_SUSPENDED means that the driver allows its callbacks
    to be skipped in the noirq and early phases of system resume, but
    some additional conditions need to be met for that to happen (among
    other things, the power.may_skip_resume flag needs to be set for the
    device during system suspend for the driver callbacks to be skipped
    during the subsequent resume transition).

    For all devices with SMART_SUSPEND set whose driver callbacks are
    invoked during system resume, the PM-runtime status will be set to
    "active" (by the core).

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

    Rafael J. Wysocki
     

30 Mar, 2020

2 commits

  • * pm-core:
    PM: runtime: Add pm_runtime_get_if_active()

    * pm-sleep:
    PM: sleep: wakeup: Skip wakeup_source_sysfs_remove() if device is not there
    PM / hibernate: Remove unnecessary compat ioctl overrides
    PM: hibernate: fix docs for ioctls that return loff_t via pointer
    PM: sleep: wakeup: Use built-in RCU list checking
    PM: sleep: core: Use built-in RCU list checking

    * pm-acpi:
    ACPI: PM: s2idle: Refine active GPEs check
    ACPICA: Allow acpi_any_gpe_status_set() to skip one GPE
    ACPI: PM: s2idle: Fix comment in acpi_s2idle_prepare_late()

    * pm-domains:
    cpuidle: psci: Split psci_dt_cpu_init_idle()
    PM / Domains: Allow no domain-idle-states DT property in genpd when parsing

    Rafael J. Wysocki
     
  • * pm-qos: (30 commits)
    PM: QoS: annotate data races in pm_qos_*_value()
    Documentation: power: fix pm_qos_interface.rst format warning
    PM: QoS: Make CPU latency QoS depend on CONFIG_CPU_IDLE
    Documentation: PM: QoS: Update to reflect previous code changes
    PM: QoS: Update file information comments
    PM: QoS: Drop PM_QOS_CPU_DMA_LATENCY and rename related functions
    sound: Call cpu_latency_qos_*() instead of pm_qos_*()
    drivers: usb: Call cpu_latency_qos_*() instead of pm_qos_*()
    drivers: tty: Call cpu_latency_qos_*() instead of pm_qos_*()
    drivers: spi: Call cpu_latency_qos_*() instead of pm_qos_*()
    drivers: net: Call cpu_latency_qos_*() instead of pm_qos_*()
    drivers: mmc: Call cpu_latency_qos_*() instead of pm_qos_*()
    drivers: media: Call cpu_latency_qos_*() instead of pm_qos_*()
    drivers: hsi: Call cpu_latency_qos_*() instead of pm_qos_*()
    drm: i915: Call cpu_latency_qos_*() instead of pm_qos_*()
    x86: platform: iosf_mbi: Call cpu_latency_qos_*() instead of pm_qos_*()
    cpuidle: Call cpu_latency_qos_limit() instead of pm_qos_request()
    PM: QoS: Add CPU latency QoS API wrappers
    PM: QoS: Adjust pm_qos_request() signature and reorder pm_qos.h
    PM: QoS: Simplify definitions of CPU latency QoS trace events
    ...

    Rafael J. Wysocki
     

14 Mar, 2020

1 commit


04 Mar, 2020

1 commit

  • pm_runtime_get_if_in_use() bumps up the PM-runtime usage count if it
    is not equal to zero and the device's PM-runtime status is 'active'.
    This works for drivers that do not use autoidle, but for those that
    do, the function returns zero even when the device is active.

    In order to maintain sane device state while the device is powered on
    in the hope that it'll be needed, pm_runtime_get_if_active(dev, true)
    returns a positive value if the device's PM-runtime status is 'active'
    when it is called, in which case it also increments the device's usage
    count.

    If the second argument of pm_runtime_get_if_active() is 'false', the
    function behaves just like pm_runtime_get_if_in_use(), so redefine
    the latter as a wrapper around the former.

    Signed-off-by: Sakari Ailus
    [ rjw: Changelog ]
    Signed-off-by: Rafael J. Wysocki

    Sakari Ailus
     

20 Feb, 2020

2 commits


14 Feb, 2020

1 commit


03 Feb, 2020

1 commit

  • There is some information in Documentation/power/interface.rst that
    is still missing from Documentation/admin-guide/pm/sleep-states.rst
    and really should be present in there, so update the latter by
    adding that information to it and delete the former (as it becomes
    redundant after that and it is somewhat outdated).

    While at it, clean up some assorted pieces of sleep-states.rst a bit.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

04 Dec, 2019

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "Enumeration:

    - Warn if a host bridge has no NUMA info (Yunsheng Lin)

    - Add PCI_STD_NUM_BARS for the number of standard BARs (Denis
    Efremov)

    Resource management:

    - Fix boot-time Embedded Controller GPE storm caused by incorrect
    resource assignment after ACPI Bus Check Notification (Mika
    Westerberg)

    - Protect pci_reassign_bridge_resources() against concurrent
    addition/removal (Benjamin Herrenschmidt)

    - Fix bridge dma_ranges resource list cleanup (Rob Herring)

    - Add "pci=hpmmiosize" and "pci=hpmmioprefsize" parameters to control
    the MMIO and prefetchable MMIO window sizes of hotplug bridges
    independently (Nicholas Johnson)

    - Fix MMIO/MMIO_PREF window assignment that assigned more space than
    desired (Nicholas Johnson)

    - Only enforce bus numbers from bridge EA if the bridge has EA
    devices downstream (Subbaraya Sundeep)

    - Consolidate DT "dma-ranges" parsing and convert all host drivers to
    use shared parsing (Rob Herring)

    Error reporting:

    - Restore AER capability after resume (Mayurkumar Patel)

    - Add PoisonTLPBlocked AER counter (Rajat Jain)

    - Use for_each_set_bit() to simplify AER code (Andy Shevchenko)

    - Fix AER kernel-doc (Andy Shevchenko)

    - Add "pcie_ports=dpc-native" parameter to allow native use of DPC
    even if platform didn't grant control over AER (Olof Johansson)

    Hotplug:

    - Avoid returning prematurely from sysfs requests to enable or
    disable a PCIe hotplug slot (Lukas Wunner)

    - Don't disable interrupts twice when suspending hotplug ports (Mika
    Westerberg)

    - Fix deadlocks when PCIe ports are hot-removed while suspended (Mika
    Westerberg)

    Power management:

    - Remove unnecessary ASPM locking (Bjorn Helgaas)

    - Add support for disabling L1 PM Substates (Heiner Kallweit)

    - Allow re-enabling Clock PM after it has been disabled (Heiner
    Kallweit)

    - Add sysfs attributes for controlling ASPM link states (Heiner
    Kallweit)

    - Remove CONFIG_PCIEASPM_DEBUG, including "link_state" and "clk_ctl"
    sysfs files (Heiner Kallweit)

    - Avoid AMD FCH XHCI USB PME# from D0 defect that prevents wakeup on
    USB 2.0 or 1.1 connect events (Kai-Heng Feng)

    - Move power state check out of pci_msi_supported() (Bjorn Helgaas)

    - Fix incorrect MSI-X masking on resume and revert related nvme quirk
    for Kingston NVME SSD running FW E8FK11.T (Jian-Hong Pan)

    - Always return devices to D0 when thawing to fix hibernation with
    drivers like mlx4 that used legacy power management (previously we
    only did it for drivers with new power management ops) (Dexuan Cui)

    - Clear PCIe PME Status even for legacy power management (Bjorn
    Helgaas)

    - Fix PCI PM documentation errors (Bjorn Helgaas)

    - Use dev_printk() for more power management messages (Bjorn Helgaas)

    - Apply D2 delay as milliseconds, not microseconds (Bjorn Helgaas)

    - Convert xen-platform from legacy to generic power management (Bjorn
    Helgaas)

    - Removed unused .resume_early() and .suspend_late() legacy power
    management hooks (Bjorn Helgaas)

    - Rearrange power management code for clarity (Rafael J. Wysocki)

    - Decode power states more clearly ("4" or "D4" really refers to
    "D3cold") (Bjorn Helgaas)

    - Notice when reading PM Control register returns an error (~0)
    instead of interpreting it as being in D3hot (Bjorn Helgaas)

    - Add missing link delays required by the PCIe spec (Mika Westerberg)

    Virtualization:

    - Move pci_prg_resp_pasid_required() to CONFIG_PCI_PRI (Bjorn
    Helgaas)

    - Allow VFs to use PRI (the PF PRI is shared by the VFs, but the code
    previously didn't recognize that) (Kuppuswamy Sathyanarayanan)

    - Allow VFs to use PASID (the PF PASID capability is shared by the
    VFs, but the code previously didn't recognize that) (Kuppuswamy
    Sathyanarayanan)

    - Disconnect PF and VF ATS enablement, since ATS in PFs and
    associated VFs can be enabled independently (Kuppuswamy
    Sathyanarayanan)

    - Cache PRI and PASID capability offsets (Kuppuswamy Sathyanarayanan)

    - Cache the PRI PRG Response PASID Required bit (Bjorn Helgaas)

    - Consolidate ATS declarations in linux/pci-ats.h (Krzysztof
    Wilczynski)

    - Remove unused PRI and PASID stubs (Bjorn Helgaas)

    - Removed unnecessary EXPORT_SYMBOL_GPL() from ATS, PRI, and PASID
    interfaces that are only used by built-in IOMMU drivers (Bjorn
    Helgaas)

    - Hide PRI and PASID state restoration functions used only inside the
    PCI core (Bjorn Helgaas)

    - Add a DMA alias quirk for the Intel VCA NTB (Slawomir Pawlowski)

    - Serialize sysfs sriov_numvfs reads vs writes (Pierre Crégut)

    - Update Cavium ACS quirk for ThunderX2 and ThunderX3 (George
    Cherian)

    - Fix the UPDCR register address in the Intel ACS quirk (Steffen
    Liebergeld)

    - Unify ACS quirk implementations (Bjorn Helgaas)

    Amlogic Meson host bridge driver:

    - Fix meson PERST# GPIO polarity problem (Remi Pommarel)

    - Add DT bindings for Amlogic Meson G12A (Neil Armstrong)

    - Fix meson clock names to match DT bindings (Neil Armstrong)

    - Add meson support for Amlogic G12A SoC with separate shared PHY
    (Neil Armstrong)

    - Add meson extended PCIe PHY functions for Amlogic G12A USB3+PCIe
    combo PHY (Neil Armstrong)

    - Add arm64 DT for Amlogic G12A PCIe controller node (Neil Armstrong)

    - Add commented-out description of VIM3 USB3/PCIe mux in arm64 DT
    (Neil Armstrong)

    Broadcom iProc host bridge driver:

    - Invalidate iProc PAXB address mapping before programming it
    (Abhishek Shah)

    - Fix iproc-msi and mvebu __iomem annotations (Ben Dooks)

    Cadence host bridge driver:

    - Refactor Cadence PCIe host controller to use as a library for both
    host and endpoint (Tom Joseph)

    Freescale Layerscape host bridge driver:

    - Add layerscape LS1028a support (Xiaowei Bao)

    Intel VMD host bridge driver:

    - Add VMD bus 224-255 restriction decode (Jon Derrick)

    - Add VMD 8086:9A0B device ID (Jon Derrick)

    - Remove Keith from VMD maintainer list (Keith Busch)

    Marvell ARMADA 3700 / Aardvark host bridge driver:

    - Use LTSSM state to build link training flag since Aardvark doesn't
    implement the Link Training bit (Remi Pommarel)

    - Delay before training Aardvark link in case PERST# was asserted
    before the driver probe (Remi Pommarel)

    - Fix Aardvark issues with Root Control reads and writes (Remi
    Pommarel)

    - Don't rely on jiffies in Aardvark config access path since
    interrupts may be disabled (Remi Pommarel)

    - Fix Aardvark big-endian support (Grzegorz Jaszczyk)

    Marvell ARMADA 370 / XP host bridge driver:

    - Make mvebu_pci_bridge_emul_ops static (Ben Dooks)

    Microsoft Hyper-V host bridge driver:

    - Add hibernation support for Hyper-V virtual PCI devices (Dexuan
    Cui)

    - Track Hyper-V pci_protocol_version per-hbus, not globally (Dexuan
    Cui)

    - Avoid kmemleak false positive on hv hbus buffer (Dexuan Cui)

    Mobiveil host bridge driver:

    - Change mobiveil csr_read()/write() function names that conflict
    with riscv arch functions (Kefeng Wang)

    NVIDIA Tegra host bridge driver:

    - Fix Tegra CLKREQ dependency programming (Vidya Sagar)

    Renesas R-Car host bridge driver:

    - Remove unnecessary header include from rcar (Andrew Murray)

    - Tighten register index checking for rcar inbound range programming
    (Marek Vasut)

    - Fix rcar inbound range alignment calculation to improve packing of
    multiple entries (Marek Vasut)

    - Update rcar MACCTLR setting to match documentation (Yoshihiro
    Shimoda)

    - Clear bit 0 of MACCTLR before PCIETCTLR.CFINIT per manual
    (Yoshihiro Shimoda)

    - Add Marek Vasut and Yoshihiro Shimoda as R-Car maintainers (Simon
    Horman)

    Rockchip host bridge driver:

    - Make rockchip 0V9 and 1V8 power regulators non-optional (Robin
    Murphy)

    Socionext UniPhier host bridge driver:

    - Set uniphier to host (RC) mode always (Kunihiko Hayashi)

    Endpoint drivers:

    - Fix endpoint driver sign extension problem when shifting page
    number to phys_addr_t (Alan Mikhak)

    Misc:

    - Add NumaChip SPDX header (Krzysztof Wilczynski)

    - Replace EXTRA_CFLAGS with ccflags-y (Krzysztof Wilczynski)

    - Remove unused includes (Krzysztof Wilczynski)

    - Removed unused sysfs attribute groups (Ben Dooks)

    - Remove PTM and ASPM dependencies on PCIEPORTBUS (Bjorn Helgaas)

    - Add PCIe Link Control 2 register field definitions to replace magic
    numbers in AMDGPU and Radeon CIK/SI (Bjorn Helgaas)

    - Fix incorrect Link Control 2 Transmit Margin usage in AMDGPU and
    Radeon CIK/SI PCIe Gen3 link training (Bjorn Helgaas)

    - Use pcie_capability_read_word() instead of pci_read_config_word()
    in AMDGPU and Radeon CIK/SI (Frederick Lawler)

    - Remove unused pci_irq_get_node() Greg Kroah-Hartman)

    - Make asm/msi.h mandatory and simplify PCI_MSI_IRQ_DOMAIN Kconfig
    (Palmer Dabbelt, Michal Simek)

    - Read all 64 bits of Switchtec part_event_bitmap (Logan Gunthorpe)

    - Fix erroneous intel-iommu dependency on CONFIG_AMD_IOMMU (Bjorn
    Helgaas)

    - Fix bridge emulation big-endian support (Grzegorz Jaszczyk)

    - Fix dwc find_next_bit() usage (Niklas Cassel)

    - Fix pcitest.c fd leak (Hewenliang)

    - Fix typos and comments (Bjorn Helgaas)

    - Fix Kconfig whitespace errors (Krzysztof Kozlowski)"

    * tag 'pci-v5.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (160 commits)
    PCI: Remove PCI_MSI_IRQ_DOMAIN architecture whitelist
    asm-generic: Make msi.h a mandatory include/asm header
    Revert "nvme: Add quirk for Kingston NVME SSD running FW E8FK11.T"
    PCI/MSI: Fix incorrect MSI-X masking on resume
    PCI/MSI: Move power state check out of pci_msi_supported()
    PCI/MSI: Remove unused pci_irq_get_node()
    PCI: hv: Avoid a kmemleak false positive caused by the hbus buffer
    PCI: hv: Change pci_protocol_version to per-hbus
    PCI: hv: Add hibernation support
    PCI: hv: Reorganize the code in preparation of hibernation
    MAINTAINERS: Remove Keith from VMD maintainer
    PCI/ASPM: Remove PCIEASPM_DEBUG Kconfig option and related code
    PCI/ASPM: Add sysfs attributes for controlling ASPM link states
    PCI: Fix indentation
    drm/radeon: Prefer pcie_capability_read_word()
    drm/radeon: Replace numbers with PCI_EXP_LNKCTL2 definitions
    drm/radeon: Correct Transmit Margin masks
    drm/amdgpu: Prefer pcie_capability_read_word()
    PCI: uniphier: Set mode register to host mode
    drm/amdgpu: Replace numbers with PCI_EXP_LNKCTL2 definitions
    ...

    Linus Torvalds
     

21 Nov, 2019

5 commits

  • The struct pci_driver.suspend_late() hook is one of the legacy PCI power
    management callbacks, and there are no remaining users of it. Remove it.

    Link: https://lore.kernel.org/r/20191101204558.210235-7-helgaas@kernel.org
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • The struct pci_driver.resume_early() hook is one of the legacy PCI power
    management callbacks, and there are no remaining users of it. Remove it.

    Link: https://lore.kernel.org/r/20191101204558.210235-6-helgaas@kernel.org
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • Documentation/power/pci.rst is wrapped to fit in 80 columns, but directory
    structure changes made a few lines longer. Wrap them so they all fit in 80
    columns again.

    Link: https://lore.kernel.org/r/20191014230016.240912-7-helgaas@kernel.org
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • Per PCIe r5.0 sec 7.5.2.1, PME may be generated from D0, so update
    Documentation/power/pci.rst to reflect that.

    Link: https://lore.kernel.org/r/20191016194450.68959-1-helgaas@kernel.org
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rafael J. Wysocki

    Bjorn Helgaas
     
  • According to the documentation, pci_pm_thaw_noirq() did not put the device
    into the full-power state and restore its standard configuration registers.
    This is incorrect, so update the documentation to match the code.

    Link: https://lore.kernel.org/r/20191014230016.240912-3-helgaas@kernel.org
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Rafael J. Wysocki

    Bjorn Helgaas
     

20 Nov, 2019

1 commit


17 Sep, 2019

1 commit

  • * pm-opp:
    PM / OPP: Correct Documentation about library location
    opp: of: Support multiple suspend OPPs defined in DT
    dt-bindings: opp: Support multiple opp-suspend properties
    opp: core: add regulators enable and disable
    opp: Don't decrement uninitialized list_kref

    * pm-qos:
    PM: QoS: Get rid of unused flags

    * acpi-pm:
    ACPI: PM: Print debug messages on device power state changes

    * pm-domains:
    PM / Domains: Verify PM domain type in dev_pm_genpd_set_performance_state()
    PM / Domains: Simplify genpd_lookup_dev()
    PM / Domains: Align in-parameter names for some genpd functions

    * pm-tools:
    pm-graph: make setVal unbuffered again for python2 and python3
    cpupower: update German translation
    tools/power/cpupower: fix 64bit detection when cross-compiling
    cpupower: Add missing newline at end of file
    pm-graph v5.5

    Rafael J. Wysocki