21 Oct, 2019

1 commit

  • Replace the CPU device PM QoS used for the management of min and max
    frequency constraints in cpufreq (and its users) with per-policy
    frequency QoS to avoid problems with cpufreq policies covering
    more then one CPU.

    Namely, a cpufreq driver is registered with the subsys interface
    which calls cpufreq_add_dev() for each CPU, starting from CPU0, so
    currently the PM QoS notifiers are added to the first CPU in the
    policy (i.e. CPU0 in the majority of cases).

    In turn, when the cpufreq driver is unregistered, the subsys interface
    doing that calls cpufreq_remove_dev() for each CPU, starting from CPU0,
    and the PM QoS notifiers are only removed when cpufreq_remove_dev() is
    called for the last CPU in the policy, say CPUx, which as a rule is
    not CPU0 if the policy covers more than one CPU. Then, the PM QoS
    notifiers cannot be removed, because CPUx does not have them, and
    they are still there in the device PM QoS notifiers list of CPU0,
    which prevents new PM QoS notifiers from being registered for CPU0
    on the next attempt to register the cpufreq driver.

    The same issue occurs when the first CPU in the policy goes offline
    before unregistering the driver.

    After this change it does not matter which CPU is the policy CPU at
    the driver registration time and whether or not it is online all the
    time, because the frequency QoS is per policy and not per CPU.

    Fixes: 67d874c3b2c6 ("cpufreq: Register notifiers with the PM QoS framework")
    Reported-by: Dmitry Osipenko
    Tested-by: Dmitry Osipenko
    Reported-by: Sudeep Holla
    Tested-by: Sudeep Holla
    Diagnosed-by: Viresh Kumar
    Link: https://lore.kernel.org/linux-pm/5ad2624194baa2f53acc1f1e627eb7684c577a19.1562210705.git.viresh.kumar@linaro.org/T/#md2d89e95906b8c91c15f582146173dce2e86e99f
    Link: https://lore.kernel.org/linux-pm/20191017094612.6tbkwoq4harsjcqv@vireshk-i7/T/#m30d48cc23b9a80467fbaa16e30f90b3828a5a29b
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     

28 Aug, 2019

1 commit


31 May, 2019

1 commit

  • Based on 3 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [kishon] [vijay] [abraham]
    [i] [kishon]@[ti] [com] this program is distributed in the hope that
    it will be useful but without any warranty without even the implied
    warranty of merchantability or fitness for a particular purpose see
    the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [graeme] [gregory]
    [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
    [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
    [hk] [hemahk]@[ti] [com] this program is distributed in the hope
    that it will be useful but without any warranty without even the
    implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1105 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

27 Jul, 2017

1 commit

  • _CPC is a optinal object for processor device so it's
    fine for processor devices in DSDT without CPPC data,
    but when booting the system with CPPC enabled in the
    kernel but without its support in the firmware, I got
    lots of warnings on a 64 core system:

    [ 6.346016] acpi ACPI0007:00: CPPC data invalid or not present
    [ 6.346028] acpi ACPI0007:01: CPPC data invalid or not present
    [ 6.346039] acpi ACPI0007:02: CPPC data invalid or not present
    [ 6.346050] acpi ACPI0007:03: CPPC data invalid or not present
    [ 6.346063] acpi ACPI0007:04: CPPC data invalid or not present
    ...
    [ 6.346737] acpi ACPI0007:3f: CPPC data invalid or not present

    This isn't much useful and a little bit noise, so
    switch the dev_warn() to dev_dbg().

    Signed-off-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Hanjun Guo
     

26 May, 2017

1 commit

  • Converting the hotplug locking, i.e. get_online_cpus(), to a percpu rwsem
    unearthed a circular lock dependency which was hidden from lockdep due to
    the lockdep annotation of get_online_cpus() which prevents lockdep from
    creating full dependency chains.

    CPU0 CPU1
    ---- ----
    lock((&wfc.work));
    lock(cpu_hotplug_lock.rw_sem);
    lock((&wfc.work));
    lock(cpu_hotplug_lock.rw_sem);

    This dependency is established via acpi_processor_start() which calls into
    the work queue code. And the work queue code establishes the reverse
    dependency.

    This is not a problem of get_online_cpus() recursion, it's a possible
    deadlock undetected by lockdep so far.

    The cure is to use cpu_hotplug_disable() instead of get_online_cpus() to
    protect the probing from acpi_processor_start().

    There is a side effect to this: cpu_hotplug_disable() makes a concurrent
    cpu hotplug attempt via the sysfs interfaces fail with -EBUSY, but that
    probing usually happens during the boot process where no interaction is
    possible. Any later invocations are infrequent enough and concurrent
    hotplug attempts are so unlikely that the danger of user space visible
    regressions is very close to zero. Anyway, thats preferrable over a real
    deadlock.

    Signed-off-by: Thomas Gleixner
    Acked-by: Ingo Molnar
    Acked-by: Rafael J. Wysocki
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Sebastian Siewior
    Cc: Steven Rostedt
    Cc: linux-acpi@vger.kernel.org
    Cc: Len Brown
    Link: http://lkml.kernel.org/r/20170524081548.851588594@linutronix.de

    Thomas Gleixner
     

15 Apr, 2017

2 commits

  • acpi_processor_get_throttling() requires to invoke the getter function on
    the target CPU. This is achieved by temporarily setting the affinity of the
    calling user space thread to the requested CPU and reset it to the original
    affinity afterwards.

    That's racy vs. CPU hotplug and concurrent affinity settings for that
    thread resulting in code executing on the wrong CPU and overwriting the
    new affinity setting.

    acpi_processor_get_throttling() is invoked in two ways:

    1) The CPU online callback, which is already running on the target CPU and
    obviously protected against hotplug and not affected by affinity
    settings.

    2) The ACPI driver probe function, which is not protected against hotplug
    during modprobe.

    Switch it over to work_on_cpu() and protect the probe function against CPU
    hotplug.

    Signed-off-by: Thomas Gleixner
    Cc: Fenghua Yu
    Cc: Tony Luck
    Cc: Herbert Xu
    Cc: "Rafael J. Wysocki"
    Cc: Peter Zijlstra
    Cc: Benjamin Herrenschmidt
    Cc: Sebastian Siewior
    Cc: Lai Jiangshan
    Cc: linux-acpi@vger.kernel.org
    Cc: Viresh Kumar
    Cc: Michael Ellerman
    Cc: Tejun Heo
    Cc: "David S. Miller"
    Cc: Len Brown
    Link: http://lkml.kernel.org/r/20170412201042.785920903@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • When acpi_install_notify_handler() fails the cooling device stays
    registered and the sysfs files created via acpi_pss_perf_init() are
    leaked and the function returns success.

    Undo acpi_pss_perf_init() and return a proper error code.

    Signed-off-by: Thomas Gleixner
    Cc: Fenghua Yu
    Cc: Tony Luck
    Cc: Herbert Xu
    Cc: "Rafael J. Wysocki"
    Cc: Peter Zijlstra
    Cc: Benjamin Herrenschmidt
    Cc: Sebastian Siewior
    Cc: Lai Jiangshan
    Cc: linux-acpi@vger.kernel.org
    Cc: Viresh Kumar
    Cc: Michael Ellerman
    Cc: Tejun Heo
    Cc: "David S. Miller"
    Cc: Len Brown
    Link: http://lkml.kernel.org/r/20170412201042.695499645@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

04 Oct, 2016

1 commit

  • Pull CPU hotplug updates from Thomas Gleixner:
    "Yet another batch of cpu hotplug core updates and conversions:

    - Provide core infrastructure for multi instance drivers so the
    drivers do not have to keep custom lists.

    - Convert custom lists to the new infrastructure. The block-mq custom
    list conversion comes through the block tree and makes the diffstat
    tip over to more lines removed than added.

    - Handle unbalanced hotplug enable/disable calls more gracefully.

    - Remove the obsolete CPU_STARTING/DYING notifier support.

    - Convert another batch of notifier users.

    The relayfs changes which conflicted with the conversion have been
    shipped to me by Andrew.

    The remaining lot is targeted for 4.10 so that we finally can remove
    the rest of the notifiers"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
    cpufreq: Fix up conversion to hotplug state machine
    blk/mq: Reserve hotplug states for block multiqueue
    x86/apic/uv: Convert to hotplug state machine
    s390/mm/pfault: Convert to hotplug state machine
    mips/loongson/smp: Convert to hotplug state machine
    mips/octeon/smp: Convert to hotplug state machine
    fault-injection/cpu: Convert to hotplug state machine
    padata: Convert to hotplug state machine
    cpufreq: Convert to hotplug state machine
    ACPI/processor: Convert to hotplug state machine
    virtio scsi: Convert to hotplug state machine
    oprofile/timer: Convert to hotplug state machine
    block/softirq: Convert to hotplug state machine
    lib/irq_poll: Convert to hotplug state machine
    x86/microcode: Convert to hotplug state machine
    sh/SH-X3 SMP: Convert to hotplug state machine
    ia64/mca: Convert to hotplug state machine
    ARM/OMAP/wakeupgen: Convert to hotplug state machine
    ARM/shmobile: Convert to hotplug state machine
    arm64/FP/SIMD: Convert to hotplug state machine
    ...

    Linus Torvalds
     

20 Sep, 2016

1 commit


09 Sep, 2016

2 commits


30 Jul, 2016

1 commit

  • Pull smp hotplug updates from Thomas Gleixner:
    "This is the next part of the hotplug rework.

    - Convert all notifiers with a priority assigned

    - Convert all CPU_STARTING/DYING notifiers

    The final removal of the STARTING/DYING infrastructure will happen
    when the merge window closes.

    Another 700 hundred line of unpenetrable maze gone :)"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    timers/core: Correct callback order during CPU hot plug
    leds/trigger/cpu: Move from CPU_STARTING to ONLINE level
    powerpc/numa: Convert to hotplug state machine
    arm/perf: Fix hotplug state machine conversion
    irqchip/armada: Avoid unused function warnings
    ARC/time: Convert to hotplug state machine
    clocksource/atlas7: Convert to hotplug state machine
    clocksource/armada-370-xp: Convert to hotplug state machine
    clocksource/exynos_mct: Convert to hotplug state machine
    clocksource/arm_global_timer: Convert to hotplug state machine
    rcu: Convert rcutree to hotplug state machine
    KVM/arm/arm64/vgic-new: Convert to hotplug state machine
    smp/cfd: Convert core to hotplug state machine
    x86/x2apic: Convert to CPU hotplug state machine
    profile: Convert to hotplug state machine
    timers/core: Convert to hotplug state machine
    hrtimer: Convert to hotplug state machine
    x86/tboot: Convert to hotplug state machine
    arm64/armv8 deprecated: Convert to hotplug state machine
    hwtracing/coresight-etm4x: Convert to hotplug state machine
    ...

    Linus Torvalds
     

22 Jul, 2016

1 commit

  • ACPI 6.0 introduced an optional object _LPI that provides an alternate
    method to describe Low Power Idle states. It defines the local power
    states for each node in a hierarchical processor topology. The OSPM can
    use _LPI object to select a local power state for each level of processor
    hierarchy in the system. They used to produce a composite power state
    request that is presented to the platform by the OSPM.

    Since multiple processors affect the idle state for any non-leaf hierarchy
    node, coordination of idle state requests between the processors is
    required. ACPI supports two different coordination schemes: Platform
    coordinated and OS initiated.

    This patch adds initial support for Platform coordination scheme of LPI.

    Signed-off-by: Sudeep Holla
    Signed-off-by: Rafael J. Wysocki

    Sudeep Holla
     

15 Jul, 2016

1 commit

  • As part of the hotplug cleanup, the CPU_STARTING/DYING actions are going
    away soon. This driver needlessly uses those two macro, and so this patch
    replaces that code with something more sensible.

    Commit:

    8da8373447d6a57a5a9f55233d35beb15d92d0d2 ("ACPI / processor: Fix STARTING/DYING action in acpi_cpu_soft_notify()")

    added checks for those two actions, because the notification callback can
    sleep, causing a hung CPU. This patch instead checks for the ONLINE/DEAD
    actions, which are the ones that are handled by the driver in the first
    place.

    Signed-off-by: Richard Cochran
    Signed-off-by: Anna-Maria Gleixner
    Reviewed-by: Sebastian Andrzej Siewior
    Cc: Len Brown
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: linux-acpi@vger.kernel.org
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153335.964962885@linutronix.de
    Signed-off-by: Ingo Molnar

    Richard Cochran
     

22 Feb, 2016

1 commit

  • acpi_processor_sleep is neither related nor used by CPUIdle framework.
    It's used in system suspend/resume path as a syscore operation. It makes
    more sense to move it to acpi/sleep.c where all the S-state transition
    (a.k.a. Linux system suspend/hiberate) related code are present.

    Also make it depend on CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT so that
    it's not compiled on architecture like ARM64 where S-states are not
    yet defined in ACPI.

    Signed-off-by: Sudeep Holla
    Signed-off-by: Rafael J. Wysocki

    Sudeep Holla
     

21 Dec, 2015

1 commit

  • The processor cooling device is no longer present for passive thermal
    control.

    Commit 239708a3af44 ("ACPI: Split out ACPI PSS from ACPI Processor driver")
    moved the processing to a new function acpi_pss_perf_init(), but
    missed "return 0" after successful creation. This causes the error
    handling functions to be called, which will delete the previously
    created processor cooling device.

    Fixes: 239708a3af44 (ACPI: Split out ACPI PSS from ACPI Processor driver)
    Signed-off-by: Srinivas Pandruvada
    Cc: 4.3+ # 4.3+
    Signed-off-by: Rafael J. Wysocki

    Srinivas Pandruvada
     

13 Oct, 2015

1 commit


01 Sep, 2015

1 commit

  • * acpi-scan:
    ACPI / bus: Move ACPI bus type registration
    ACPI / scan: Move bus operations and notification routines to bus.c
    ACPI / scan: Move device matching code to bus.c
    ACPI / scan: Move sysfs-related device code to a separate file

    * acpi-processor:
    PCC: Disable compilation by default
    ACPI: Decouple ACPI idle and ACPI processor drivers
    ACPI: Split out ACPI PSS from ACPI Processor driver
    PCC: Initialize PCC Mailbox earlier at boot
    ACPI / processor: remove leftover __refdata annotations

    * acpi-assorted:
    ACPI: fix acpi_debugfs_init prototype
    ACPI: Remove FSF mailing addresses

    Rafael J. Wysocki
     

25 Aug, 2015

1 commit

  • The ACPI processor driver is currently tied too closely
    to the ACPI P-states (PSS) and other related constructs
    for controlling CPU performance.

    The newer ACPI specification (v5.1 onwards) introduces
    alternative methods to PSS. These new mechanisms are
    described within each ACPI Processor object and so they
    need to be scanned whenever a new Processor object is detected.
    This patch introduces a new Kconfig symbol to allow for
    finer configurability among the two options for controlling
    performance states. There is no change in functionality and
    the option is auto-selected by the architectures which support it.

    A future commit will introduce support for CPPC: A newer method of
    controlling CPU performance. The OS is not expected to support
    CPPC and PSS at the same time, so the Kconfig option lets us make
    the two mutually exclusive at compile time.

    Signed-off-by: Ashwin Chaugule
    [ rjw: Changelog ]
    Signed-off-by: Rafael J. Wysocki

    Ashwin Chaugule