1. 09 Feb, 2023 3 commits
    • Srinivas Pandruvada's avatar
      thermal: intel: powerclamp: Add two module parameters · ebf51971
      Srinivas Pandruvada authored
      In some use cases, it is desirable to only inject idle on certain set
      of CPUs. For example on Alder Lake systems, it is possible that we force
      idle only on P-Cores for thermal reasons. Also the idle percent can be
      more than 50% if we only choose partial set of CPUs in the system.
      
      Introduce 2 new module parameters for this purpose. They can be only
      changed when the cooling device is inactive.
      
      cpumask (Read/Write): A bit mask of CPUs to inject idle. The format of
      this bitmask is same as used in other subsystems like in
      /proc/irq/*/smp_affinity. The mask is comma separated 32 bit groups.
      Each CPU is one bit. For example for 256 CPU system the full mask is:
      ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff
      The rightmost mask is for CPU 0-32.
      
      max_idle (Read/Write): Maximum injected idle time to the total CPU time
      ratio in percent range from 1 to 100. Even if the cooling device max_state
      is always 100 (100%), this parameter allows to add a max idle percent
      limit. The default is 50, to match the current implementation of powerclamp
      driver. Also doesn't allow value more than 75, if the cpumask includes
      every CPU present in the system.
      
      Also when the cpumask doesn't include every CPU, there is no use of
      compensation using package C-state idle counters. Hence don't start
      package C-state polling thread even for a single package or a single die
      system in this case.
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ebf51971
    • Srinivas Pandruvada's avatar
      Documentation: admin-guide: Move intel_powerclamp documentation · 707bf8e1
      Srinivas Pandruvada authored
      Create a folder "thermal" under Documentation/admin-guide and move
      intel_powerclamp documentation to this folder.
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      707bf8e1
    • Srinivas Pandruvada's avatar
      thermal: intel: powerclamp: Fix duration module parameter · 966d0ab6
      Srinivas Pandruvada authored
      After the switch to use the powercap/idle-inject framework in the Intel
      powerclamp driver, the idle duration unit is microsecond.
      
      However, the module parameter for idle duration is in milliseconds, so
      convert it to microseconds in the "set" callback and back to milliseconds
      in a new "get" callback.
      
      While here, also use mutex protection for setting and getting "duration".
      
      The other uses of "duration" are already protected by the mutex.
      
      Fixes: 8526eb7f ("thermal: intel: powerclamp: Use powercap idle-inject feature")
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      966d0ab6
  2. 07 Feb, 2023 1 commit
  3. 03 Feb, 2023 2 commits
    • Daniel Lezcano's avatar
      thermal: intel: quark_dts: Use generic trip points · 72ffc28f
      Daniel Lezcano authored
      Make the intel_quark_dts_thermal driver register an array of generic
      trip points along with the thermal zone and drop the trip points
      thermal zone callbacks that are not used any more from it.
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@kernel.org>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      72ffc28f
    • Srinivas Pandruvada's avatar
      thermal: intel: powerclamp: Use powercap idle-inject feature · 8526eb7f
      Srinivas Pandruvada authored
      There are two idle injection implementation in the Linux kernel. One
      via intel_powerclamp and the other using powercap/idle_inject. Both
      implementation end up in calling play_idle* function from a FIFO
      priority thread. Both can't be used at the same time.
      
      It is better to use one idle injection framework for better
      maintainability. In this way, there is only one caller for play_idle.
      
      Here powercap/idle_inject can be used for both per-core and for system
      wide idle injection. This framework has a well defined interface which
      allow registry for per-core or for all CPUs (system wide).
      
      This reduces code complexity in the intel powerclamp driver as all the
      per CPU kthreads, delayed work and calls to play_idle can be removed.
      
      The changes include:
       - Remove unneeded include files
       - Remove per CPU kthread workers: balancing_work and idle_injection_work.
       - Reuse the compensation related code by moving from previous worker
         thread to idle_injection callback.
       - Adjust the idle_duration and runtime by using powercap/idle_inject
         interface.
       - Remove all variables, which are not required once powercap/idle_inject
         is used.
       - Add mutex to avoid race during removal of idle injection during module
         unload and user action to change idle inject percent. Also for
         protection during dynamic adjustment of run and idle time from
         update() callback.
       - Remove online/offline callbacks to designate control CPU
       - Use cpu_present_mask global variable for CPU mask
       - Remove hot plug locks
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8526eb7f
  4. 02 Feb, 2023 16 commits
  5. 27 Jan, 2023 5 commits
    • Rafael J. Wysocki's avatar
      thermal: intel: int340x: Use generic trip points table · f4118dbe
      Rafael J. Wysocki authored
      Modify int340x_thermal_zone_add() to register the thermal zone along
      with a trip points table, which allows the trip-related zone callbacks
      to be dropped, because they are not needed any more.
      
      In order to consolidate the code, use ACPI trip library functions to
      populate generic trip points in int340x_thermal_read_trips() and to
      update them in int340x_thermal_update_trips().
      Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Co-developed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f4118dbe
    • Rafael J. Wysocki's avatar
      thermal: intel: int340x: Use zone lock for synchronization · 9e9b7e18
      Rafael J. Wysocki authored
      Because the ->get_trip_temp() and ->get_trip_type() thermal zone
      callbacks are only invoked from __thermal_zone_get_trip() which is
      always called by the thermal core under the zone lock, it is sufficient
      for int340x_thermal_update_trips() to acquire the zone lock for mutual
      exclusion with those callbacks.
      
      Accordingly, modify int340x_thermal_update_trips() to use the zone lock
      instead of the internal trip_mutex and drop the latter which is not
      necessary any more.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9e9b7e18
    • Rafael J. Wysocki's avatar
      thermal: intel: int340x: Rework updating trip points · b1bf9dbf
      Rafael J. Wysocki authored
      It is generally invalid to change the trip point indices after they have
      been exposed via sysfs.
      
      Moreover, the thermal objects in the ACPI namespace cannot go away and
      appear on the fly.  In practice, the only thing that can happen when the
      INT3403_PERF_TRIP_POINT_CHANGED notification is sent by the platform
      firmware is a change of the return values of those thermal objects.
      
      For this reason, add a special function for updating the trip point
      temperatures after re-evaluating the respective ACPI thermal objects
      and change int3403_notify() to invoke it instead of
      int340x_thermal_read_trips() that would change the trip point indices
      on errors.  Also remove the locking from the latter, because it is only
      called before registering the thermal zone and it cannot race with the
      zone's callbacks.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b1bf9dbf
    • Rafael J. Wysocki's avatar
      thermal: ACPI: Initialize trips if temperature is out of range · 97efecfd
      Rafael J. Wysocki authored
      In some cases it is still useful to register a trip point if the
      temperature returned by the corresponding ACPI thermal object (for
      example, _HOT) is invalid to start with, because the same ACPI
      thermal object may start to return a valid temperature after a
      system configuration change (for example, from an AC power source
      to battery an vice versa).
      
      For this reason, if the ACPI thermal object evaluated by
      thermal_acpi_trip_init() successfully returns a temperature value that
      is out of the range of values taken into account, initialize the trip
      point using THERMAL_TEMP_INVALID as the temperature value instead of
      returning an error to allow the user of the trip point to decide what
      to do with it.
      
      Also update pch_wpt_add_acpi_psv_trip() to reject trip points with
      invalid temperature values.
      
      Fixes: 7a0e3974 ("thermal: ACPI: Add ACPI trip point routines")
      Reported-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      97efecfd
    • Rafael J. Wysocki's avatar
      a5c926ac
  6. 26 Jan, 2023 2 commits
  7. 25 Jan, 2023 1 commit
  8. 24 Jan, 2023 5 commits
  9. 23 Jan, 2023 1 commit
  10. 22 Jan, 2023 2 commits
    • Linus Torvalds's avatar
      Linux 6.2-rc5 · 2241ab53
      Linus Torvalds authored
      2241ab53
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux · 95f184d0
      Linus Torvalds authored
      Pull another io_uring fix from Jens Axboe:
       "Just a single fix for a regression that happened in this release due
        to a poll change. Normally I would've just deferred it to next week,
        but since the original fix got picked up by stable, I think it's
        better to just send this one off separately.
      
        The issue is around the poll race fix, and how it mistakenly also got
        applied to multishot polling. Those don't need the race fix, and we
        should not be doing any reissues for that case. Exhaustive test cases
        were written and committed to the liburing regression suite for the
        reported issue, and additions for similar issues"
      
      * tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux:
        io_uring/poll: don't reissue in case of poll race on multishot request
      95f184d0
  11. 21 Jan, 2023 2 commits
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · f6714402
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char/misc and other subsystem driver fixes for
        6.2-rc5 to resolve a few reported issues. They include:
      
         - long time pending fastrpc fixes (should have gone into 6.1, my
           fault)
      
         - mei driver/bus fixes and new device ids
      
         - interconnect driver fixes for reported problems
      
         - vmci bugfix
      
         - w1 driver bugfixes for reported problems
      
        Almost all of these have been in linux-next with no reported problems,
        the rest have all passed 0-day bot testing in my tree and on the
        mailing lists where they have sat too long due to me taking a long
        time to catch up on my pending patch queue"
      
      * tag 'char-misc-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        VMCI: Use threaded irqs instead of tasklets
        misc: fastrpc: Pass bitfield into qcom_scm_assign_mem
        gsmi: fix null-deref in gsmi_get_variable
        misc: fastrpc: Fix use-after-free race condition for maps
        misc: fastrpc: Don't remove map on creater_process and device_release
        misc: fastrpc: Fix use-after-free and race in fastrpc_map_find
        misc: fastrpc: fix error code in fastrpc_req_mmap()
        mei: me: add meteor lake point M DID
        mei: bus: fix unlink on bus in error path
        w1: fix WARNING after calling w1_process()
        w1: fix deadloop in __w1_remove_master_device()
        comedi: adv_pci1760: Fix PWM instruction handling
        interconnect: qcom: rpm: Use _optional func for provider clocks
        interconnect: qcom: msm8996: Fix regmap max_register values
        interconnect: qcom: msm8996: Provide UFS clocks to A2NoC
        dt-bindings: interconnect: Add UFS clocks to MSM8996 A2NoC
      f6714402
    • Linus Torvalds's avatar
      Merge tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · c88a3114
      Linus Torvalds authored
      Pull driver core fixes from Greg KH:
       "Here are three small driver and kernel core fixes for 6.2-rc5. They
        include:
      
         - potential gadget fixup in do_prlimit
      
         - device property refcount leak fix
      
         - test_async_probe bugfix for reported problem"
      
      * tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        prlimit: do_prlimit needs to have a speculation check
        driver core: Fix test_async_probe_init saves device in wrong array
        device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
      c88a3114