1. 15 Dec, 2020 6 commits
    • Ionela Voinescu's avatar
      cppc_cpufreq: replace per-cpu data array with a list · a28b2bfc
      Ionela Voinescu authored
      The cppc_cpudata per-cpu storage was inefficient (1) additional to causing
      functional issues (2) when CPUs are hotplugged out, due to per-cpu data
      being improperly initialised.
      
      (1) The amount of information needed for CPPC performance control in its
          cpufreq driver depends on the domain (PSD) coordination type:
      
          ANY:    One set of CPPC control and capability data (e.g desired
                  performance, highest/lowest performance, etc) applies to all
                  CPUs in the domain.
      
          ALL:    Same as ANY. To be noted that this type is not currently
                  supported. When supported, information about which CPUs
                  belong to a domain is needed in order for frequency change
                  requests to be sent to each of them.
      
          HW:     It's necessary to store CPPC control and capability
                  information for all the CPUs. HW will then coordinate the
                  performance state based on their limitations and requests.
      
          NONE:   Same as HW. No HW coordination is expected.
      
          Despite this, the previous initialisation code would indiscriminately
          allocate memory for all CPUs (all_cpu_data) and unnecessarily
          duplicate performance capabilities and the domain sharing mask and type
          for each possible CPU.
      
      (2) With the current per-cpu structure, when having ANY coordination,
          the cppc_cpudata cpu information is not initialised (will remain 0)
          for all CPUs in a policy, other than policy->cpu. When policy->cpu is
          hotplugged out, the driver will incorrectly use the uninitialised (0)
          value of the other CPUs when making frequency changes. Additionally,
          the previous values stored in the perf_ctrls.desired_perf will be
          lost when policy->cpu changes.
      
      Therefore replace the array of per cpu data with a list. The memory for
      each structure is allocated at policy init, where a single structure
      can be allocated per policy, not per cpu. In order to accommodate the
      struct list_head node in the cppc_cpudata structure, the now unused cpu
      and cur_policy variables are removed.
      
      For example, on a arm64 Juno platform with 6 CPUs: (0, 1, 2, 3) in PSD1,
      (4, 5) in PSD2 - ANY coordination, the memory allocation comparison shows:
      
      Before patch:
      
       - ANY coordination:
         total    slack      req alloc/free  caller
             0        0        0     0/1     _kernel_size_le_hi32+0x0xffff800008ff7810
             0        0        0     0/6     _kernel_size_le_hi32+0x0xffff800008ff7808
           128       80       48     1/0     _kernel_size_le_hi32+0x0xffff800008ffc070
           768        0      768     6/0     _kernel_size_le_hi32+0x0xffff800008ffc0e4
      
      After patch:
      
       - ANY coordination:
          total    slack      req alloc/free  caller
           256        0      256     2/0     _kernel_size_le_hi32+0x0xffff800008fed410
             0        0        0     0/2     _kernel_size_le_hi32+0x0xffff800008fed274
      
      Additional notes:
       - A pointer to the policy's cppc_cpudata is stored in policy->driver_data
       - Driver registration is skipped if _CPC entries are not present.
      Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
      Tested-by: default avatarMian Yousaf Kaukab <ykaukab@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a28b2bfc
    • Ionela Voinescu's avatar
      cppc_cpufreq: expose information on frequency domains · cfdc589f
      Ionela Voinescu authored
      Use the existing sysfs attribute "freqdomain_cpus" to expose
      information to userspace about CPUs in the same frequency domain.
      Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Tested-by: default avatarMian Yousaf Kaukab <ykaukab@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cfdc589f
    • Ionela Voinescu's avatar
      cppc_cpufreq: clarify support for coordination types · bf76bb20
      Ionela Voinescu authored
      The previous coordination type handling in the cppc_cpufreq init code
      created some confusion: the comment mentioned "Support only SW_ANY for
      now" while only the SW_ALL/ALL case resulted in a failure. The other
      coordination types (HW_ALL/HW, NONE) were silently supported.
      
      Clarify support for coordination types while describing in comments the
      intended behavior.
      Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Tested-by: default avatarMian Yousaf Kaukab <ykaukab@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bf76bb20
    • Ionela Voinescu's avatar
      cppc_cpufreq: use policy->cpu as driver of frequency setting · d2641a5c
      Ionela Voinescu authored
      Considering only the currently supported coordination types (ANY, HW,
      NONE), this change only makes a difference for the ANY type, when
      policy->cpu is hotplugged out. In that case the new policy->cpu will
      be different from ((struct cppc_cpudata *)policy->driver_data)->cpu.
      
      While in this case the controls of *ANY* CPU could be used to drive
      frequency changes, it's more consistent to use policy->cpu as the
      leading CPU, as used in all other cppc_cpufreq functions. Additionally,
      the debug prints in cppc_set_perf() would no longer create confusion
      when referring to a CPU that is hotplugged out.
      Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Tested-by: default avatarMian Yousaf Kaukab <ykaukab@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d2641a5c
    • Rafael J. Wysocki's avatar
    • Ionela Voinescu's avatar
      ACPI: processor: fix NONE coordination for domain mapping failure · bca3e43c
      Ionela Voinescu authored
      For errors parsing the _PSD domains, a separate domain is returned for
      each CPU in the failed _PSD domain with no coordination (as per previous
      comment). But contrary to the intention, the code was setting
      CPUFREQ_SHARED_TYPE_ALL as coordination type.
      
      Change shared_type to CPUFREQ_SHARED_TYPE_NONE in case of errors parsing
      the domain information. The function still returns the error and the caller
      is free to bail out the domain initialisation altogether in that case.
      
      Given that both functions return domains with a single CPU, this change
      does not affect the functionality, but clarifies the intention.
      Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      [ rjw: Subject edit ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bca3e43c
  2. 14 Dec, 2020 1 commit
    • Rafael J. Wysocki's avatar
      Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm · 30c76882
      Rafael J. Wysocki authored
      Pull ARM cpufreq updates for 5.11-rc1 from Viresh Kumar:
      
      "This contains the following updates:
      
       - Fix imx's NVMEM_IMX_OCOTP dependency (Arnd Bergmann).
      
       - Add support for mt8167 and blacklist mt8516 (Fabien Parent).
      
       - Some ->get() callback related cleanups to the tegra194 driver and
         some optimizations in tegra186 driver (Jon Hunter and Sumit Gupta).
      
       - Power scale improvements to arm_scmi driver (Lukasz Luba).
      
       - Add missing MODULE_DEVICE_TABLE and MODULE_ALIAS to several drivers
         (Pali Rohár).
      
       - Fix error path in mediatek driver (Qinglang Miao).
      
       - Fix memleak in ST's cpufreq driver (Yangtao Li)."
      
      * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: (22 commits)
        cpufreq: arm_scmi: Discover the power scale in performance protocol
        firmware: arm_scmi: Add power_scale_mw_get() interface
        cpufreq: tegra194: Rename tegra194_get_speed_common function
        cpufreq: tegra194: Remove unnecessary frequency calculation
        cpufreq: tegra186: Simplify cluster information lookup
        cpufreq: tegra186: Fix sparse 'incorrect type in assignment' warning
        cpufreq: imx: fix NVMEM_IMX_OCOTP dependency
        cpufreq: vexpress-spc: Add missing MODULE_ALIAS
        cpufreq: scpi: Add missing MODULE_ALIAS
        cpufreq: loongson1: Add missing MODULE_ALIAS
        cpufreq: sun50i: Add missing MODULE_DEVICE_TABLE
        cpufreq: st: Add missing MODULE_DEVICE_TABLE
        cpufreq: qcom: Add missing MODULE_DEVICE_TABLE
        cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE
        cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
        cpufreq: ap806: Add missing MODULE_DEVICE_TABLE
        cpufreq: mediatek: add missing platform_driver_unregister() on error in mtk_cpufreq_driver_init
        cpufreq: tegra194: get consistent cpuinfo_cur_freq
        cpufreq: blacklist mt8516 in cpufreq-dt-platdev
        cpufreq: mediatek: Add support for mt8167
        ...
      30c76882
  3. 11 Dec, 2020 6 commits
  4. 08 Dec, 2020 3 commits
  5. 07 Dec, 2020 19 commits
  6. 25 Nov, 2020 1 commit
  7. 23 Nov, 2020 2 commits
  8. 22 Nov, 2020 2 commits
    • Linus Torvalds's avatar
      Linux 5.10-rc5 · 418baf2c
      Linus Torvalds authored
      418baf2c
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · d5530d82
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - Various functionality / regression fixes for Logitech devices from
         Hans de Goede
      
       - Fix for (recently added) GPIO support in mcp2221 driver from Lars
         Povlsen
      
       - Power management handling fix/quirk in i2c-hid driver for certain
         BIOSes that have strange aproach to power-cycle from Hans de Goede
      
       - a few device ID additions and device-specific quirks
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver
        HID: logitech-dj: Fix an error in mse_bluetooth_descriptor
        HID: Add Logitech Dinovo Edge battery quirk
        HID: logitech-hidpp: Add HIDPP_CONSUMER_VENDOR_KEYS quirk for the Dinovo Edge
        HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad
        HID: add HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE for Gamevice devices
        HID: mcp2221: Fix GPIO output handling
        HID: hid-sensor-hub: Fix issue with devices with no report ID
        HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown
        HID: add support for Sega Saturn
        HID: cypress: Support Varmilo Keyboards' media hotkeys
        HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses
        HID: logitech-hidpp: Add PID for MX Anywhere 2
        HID: uclogic: Add ID for Trust Flex Design Tablet
      d5530d82