05 Sep, 2016

1 commit

  • of_clk_init() ends up calling into pm_qos_update_request() very early
    during boot where irq is expected to stay disabled.
    pm_qos_update_request() uses cancel_delayed_work_sync() which
    correctly assumes that irq is enabled on invocation and
    unconditionally disables and re-enables it.

    Gate cancel_delayed_work_sync() invocation with kevented_up() to avoid
    enabling irq unexpectedly during early boot.

    Signed-off-by: Tejun Heo
    Reported-and-tested-by: Qiao Zhou
    Link: http://lkml.kernel.org/r/d2501c4c-8e7b-bea3-1b01-000b36b5dfe9@asrmicro.com
    Signed-off-by: Rafael J. Wysocki

    Tejun Heo
     

24 Jan, 2015

1 commit

  • PM QoS requests are notoriously hard to debug and made even
    more so due to their highly dynamic nature. Having visibility
    into the internal data representation per constraint allows
    us to have much better appreciation of potential issues or
    bad usage by drivers in the system.

    So introduce for all classes of PM QoS, an entry in
    /sys/kernel/debug/pm_qos that shall show all the current
    requests as well as the snapshot of the value these requests
    boil down to. For example:
    ==> /sys/kernel/debug/pm_qos/cpu_dma_latency /sys/kernel/debug/pm_qos/memory_bandwidth
    Signed-off-by: Dave Gerlach
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Nishanth Menon
     

25 Sep, 2014

1 commit

  • Also adds a class type PM_QOS_SUM that aggregates the values by summing them.

    It can be used by memory controllers to calculate the optimum clock frequency
    based on the bandwidth needs of the different memory clients.

    Signed-off-by: Tomeu Vizoso
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Tomeu Vizoso
     

11 Feb, 2014

2 commits

  • Add a new latency tolerance device PM QoS type to be use for
    specifying active state (RPM_ACTIVE) memory access (DMA) latency
    tolerance requirements for devices. It may be used to prevent
    hardware from choosing overly aggressive energy-saving operation
    modes (causing too much latency to appear) for the whole platform.

    This feature reqiures hardware support, so it only will be
    available for devices having a new .set_latency_tolerance()
    callback in struct dev_pm_info populated, in which case the
    routine pointed to by it should implement whatever is necessary
    to transfer the effective requirement value to the hardware.

    Whenever the effective latency tolerance changes for the device,
    its .set_latency_tolerance() callback will be executed and the
    effective value will be passed to it. If that value is negative,
    which means that the list of latency tolerance requirements for
    the device is empty, the callback is expected to switch the
    underlying hardware latency tolerance control mechanism to an
    autonomous mode if available. If that value is PM_QOS_LATENCY_ANY,
    in turn, and the hardware supports a special "no requirement"
    setting, the callback is expected to use it. That allows software
    to prevent the hardware from automatically updating the device's
    latency tolerance in response to its power state changes (e.g. during
    transitions from D3cold to D0), which generally may be done in the
    autonomous latency tolerance control mode.

    If .set_latency_tolerance() is present for the device, a new
    pm_qos_latency_tolerance_us attribute will be present in the
    devivce's power directory in sysfs. Then, user space can use
    that attribute to specify its latency tolerance requirement for
    the device, if any. Writing "any" to it means "no requirement, but
    do not let the hardware control latency tolerance" and writing
    "auto" to it allows the hardware to be switched to the autonomous
    mode if there are no other requirements from the kernel side in the
    device's list.

    This changeset includes a fix from Mika Westerberg.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Add a new field, no_constraints_value, to struct pm_qos_constraints
    representing a list of PM QoS constraint requests to be returned by
    pm_qos_get_value() when that list of requests is empty.

    That field will be equal to default_value for all of the existing
    global PM QoS classes and for the resume latency device PM QoS type,
    but it will be different from default_value for the new latency
    tolerance device PM QoS type introduced by the next changeset.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

18 Oct, 2013

1 commit


14 Aug, 2013

1 commit

  • pm_qos_update_request_timeout() updates a qos and then schedules
    a delayed work item to bring the qos back down to the default
    after the timeout. When the work item runs, pm_qos_work_fn() will
    call pm_qos_update_request() and deadlock because it tries to
    cancel itself via cancel_delayed_work_sync(). Future callers of
    that qos will also hang waiting to cancel the work that is
    canceling itself. Let's extract the little bit of code that does
    the real work of pm_qos_update_request() and call it from the
    work function so that we don't deadlock.

    Before ed1ac6e (PM: don't use [delayed_]work_pending()) this didn't
    happen because the work function wouldn't try to cancel itself.

    Signed-off-by: Stephen Boyd
    Reviewed-by: Tejun Heo
    Cc: 3.9+ # 3.9+
    Signed-off-by: Rafael J. Wysocki

    Stephen Boyd
     

24 Jun, 2013

2 commits


21 Jun, 2013

1 commit

  • The valid start index for pm_qos_array is not 0, but
    PM_QOS_CPU_DMA_LATENCY. There is a null_pm_qos at index 0 of
    pm_qos_array. However, null_pm_qos is not created as misc device so
    that inclusion of 0 index for checking pm_qos_class especially for
    file operations is not proper here.

    [rjw: Changelog, a bit]
    Signed-off-by: Sahara
    Signed-off-by: Rafael J. Wysocki

    Sahara
     

26 Jan, 2013

1 commit


30 Nov, 2012

1 commit

  • * pm-sleep:
    PM / Freezer: Fixup compile error of try_to_freeze_nowarn()
    driver core / PM: move the calling to device_pm_remove behind the calling to bus_remove_device
    PM / Hibernate: use rb_entry
    PM / sysfs: replace strict_str* with kstrto*

    Rafael J. Wysocki
     

15 Nov, 2012

1 commit


23 Oct, 2012

1 commit

  • Introduce struct pm_qos_flags_request and struct pm_qos_flags
    representing PM QoS flags request type and PM QoS flags constraint
    type, respectively. With these definitions the data structures
    will be arranged so that the list member of a struct pm_qos_flags
    object will contain the head of a list of struct pm_qos_flags_request
    objects representing all of the "flags" requests present for the
    given device. Then, the effective_flags member of a struct
    pm_qos_flags object will contain the bitwise OR of the flags members
    of all the struct pm_qos_flags_request objects in the list.

    Additionally, introduce helper function pm_qos_update_flags()
    allowing the caller to manage the list of struct pm_qos_flags_request
    pointed to by the list member of struct pm_qos_flags.

    The flags are of type s32 so that the request's "value" field
    is always of the same type regardless of what kind of request it
    is (latency requests already have value fields of type s32).

    Signed-off-by: Rafael J. Wysocki
    Reviewed-by: Jean Pihet
    Acked-by: mark gross

    Rafael J. Wysocki
     

08 Sep, 2012

1 commit


29 Mar, 2012

1 commit

  • The new API, pm_qos_update_request_timeout() is to provide a timeout
    with pm_qos_update_request.

    For example, pm_qos_update_request_timeout(req, 100, 1000), means that
    QoS request on req with value 100 will be active for 1000 microseconds.
    After 1000 microseconds, the QoS request thru req is reset. If there
    were another pm_qos_update_request(req, x) during the 1000 us, this
    new request with value x will override as this is another request on the
    same req handle. A new request on the same req handle will always
    override the previous request whether it is the conventional request or
    it is the new timeout request.

    Signed-off-by: MyungJoo Ham
    Signed-off-by: Kyungmin Park
    Acked-by: Mark Gross
    Signed-off-by: Rafael J. Wysocki

    MyungJoo Ham
     

30 Jan, 2012

1 commit

  • - Replace class ID #define with enumeration
    - Loop through PM QoS objects during initialization (rather than
    initializing them one-by-one)

    Signed-off-by: Alex Frid
    Reviewed-by: Antti Miettinen
    Reviewed-by: Diwakar Tundlam
    Reviewed-by: Scott Williams
    Reviewed-by: Yu-Huan Hsu
    Acked-by: markgross
    Signed-off-by: Rafael J. Wysocki

    Alex Frid
     

08 Nov, 2011

1 commit

  • Since commit 4a31a334, the name of this misc device is not initialized,
    which leads to a funny device named /dev/(null) being created and
    /proc/misc containing an entry with just a number but no name. The latter
    leads to complaints by cryptsetup, which caused me to investigate this
    matter.

    Signed-off-by: Dominik Brodowski
    Signed-off-by: Rafael J. Wysocki

    Dominik Brodowski
     

07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

05 Nov, 2011

1 commit


01 Nov, 2011

1 commit


25 Aug, 2011

6 commits

  • Add a global notification chain that gets called upon changes to the
    aggregated constraint value for any device.
    The notification callbacks are passing the full constraint request data
    in order for the callees to have access to it. The current use is for the
    platform low-level code to access the target device of the constraint.

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • In preparation for the per-device constratins support:
    - rename update_target to pm_qos_update_target
    - generalize and export pm_qos_update_target for usage by the upcoming
    per-device latency constraints framework:
    * operate on struct pm_qos_constraints for constraints management,
    * introduce an 'action' parameter for constraints add/update/remove,
    * the return value indicates if the aggregated constraint value has
    changed,
    - update the internal code to operate on struct pm_qos_constraints
    - add a NULL pointer check in the API functions

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • In preparation for the per-device constratins support, re-organize
    the data strctures:
    - add a struct pm_qos_constraints which contains the constraints
    related data
    - update struct pm_qos_object contents to the PM QoS internal object
    data. Add a pointer to struct pm_qos_constraints
    - update the internal code to use the new data structs.

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • Move around the PM QoS misc devices management code
    for better readability.

    Signed-off-by: Jean Pihet
    Acked-by: markgross
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • - Misc fixes to improve code readability:
    * rename struct pm_qos_request_list to struct pm_qos_request,
    * rename pm_qos_req parameter to req in internal code,
    consistenly use req in the API parameters,
    * update the in-kernel API callers to the new parameters names,
    * rename of fields names (requests, list, node, constraints)

    Signed-off-by: Jean Pihet
    Acked-by: markgross
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • The PM QoS implementation files are better named
    kernel/power/qos.c and include/linux/pm_qos.h.

    The PM QoS support is compiled under the CONFIG_PM option.

    Signed-off-by: Jean Pihet
    Acked-by: markgross
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet