1. 18 9月, 2020 1 次提交
    • C
      regmap: debugfs: Fix handling of name string for debugfs init delays · 94cc89eb
      Charles Keepax 提交于
      In regmap_debugfs_init the initialisation of the debugfs is delayed
      if the root node isn't ready yet. Most callers of regmap_debugfs_init
      pass the name from the regmap_config, which is considered temporary
      ie. may be unallocated after the regmap_init call returns. This leads
      to a potential use after free, where config->name has been freed by
      the time it is used in regmap_debugfs_initcall.
      
      This situation can be seen on Zynq, where the architecture init_irq
      callback registers a syscon device, using a local variable for the
      regmap_config. As init_irq is very early in the platform bring up the
      regmap debugfs root isn't ready yet. Although this doesn't crash it
      does result in the debugfs entry not having the correct name.
      
      Regmap already sets map->name from config->name on the regmap_init
      path and the fact that a separate field is used to pass the name
      to regmap_debugfs_init appears to be an artifact of the debugfs
      name being added before the map name. As such this patch updates
      regmap_debugfs_init to use map->name, which is already duplicated from
      the config avoiding the issue.
      
      This does however leave two lose ends, both regmap_attach_dev and
      regmap_reinit_cache can be called after a regmap is registered and
      would have had the effect of applying a new name to the debugfs
      entries. In both of these cases it was chosen to update the map
      name. In the case of regmap_attach_dev there are 3 users that
      currently use this function to update the name, thus doing so avoids
      changes for those users and it seems reasonable that attaching
      a device would want to set the name of the map. In the case of
      regmap_reinit_cache the primary use-case appears to be devices that
      need some register access to identify the device (for example devices
      in the same family) and then update the cache to match the exact
      hardware. Whilst no users do currently update the name here, given the
      use-case it seemed reasonable the name might want to be updated once
      the device is better identified.
      Signed-off-by: NCharles Keepax <ckeepax@opensource.cirrus.com>
      Link: https://lore.kernel.org/r/20200917120828.12987-1-ckeepax@opensource.cirrus.comSigned-off-by: NMark Brown <broonie@kernel.org>
      94cc89eb
  2. 08 8月, 2020 3 次提交
  3. 04 8月, 2020 1 次提交
  4. 31 7月, 2020 4 次提交
  5. 30 7月, 2020 3 次提交
  6. 25 7月, 2020 2 次提交
  7. 23 7月, 2020 3 次提交
  8. 22 7月, 2020 1 次提交
    • V
      arch_topology, sched/core: Cleanup thermal pressure definition · 25980c7a
      Valentin Schneider 提交于
      The following commit:
      
        14533a16 ("thermal/cpu-cooling, sched/core: Move the arch_set_thermal_pressure() API to generic scheduler code")
      
      moved the definition of arch_set_thermal_pressure() to sched/core.c, but
      kept its declaration in linux/arch_topology.h. When building e.g. an x86
      kernel with CONFIG_SCHED_THERMAL_PRESSURE=y, cpufreq_cooling.c ends up
      getting the declaration of arch_set_thermal_pressure() from
      include/linux/arch_topology.h, which is somewhat awkward.
      
      On top of this, sched/core.c unconditionally defines
      o The thermal_pressure percpu variable
      o arch_set_thermal_pressure()
      
      while arch_scale_thermal_pressure() does nothing unless redefined by the
      architecture.
      
      arch_*() functions are meant to be defined by architectures, so revert the
      aforementioned commit and re-implement it in a way that keeps
      arch_set_thermal_pressure() architecture-definable, and doesn't define the
      thermal pressure percpu variable for kernels that don't need
      it (CONFIG_SCHED_THERMAL_PRESSURE=n).
      Signed-off-by: NValentin Schneider <valentin.schneider@arm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/20200712165917.9168-2-valentin.schneider@arm.com
      25980c7a
  9. 17 7月, 2020 1 次提交
  10. 15 7月, 2020 1 次提交
  11. 10 7月, 2020 14 次提交
  12. 09 7月, 2020 1 次提交
  13. 08 7月, 2020 2 次提交
  14. 07 7月, 2020 1 次提交
  15. 03 7月, 2020 2 次提交