1. 24 Aug, 2023 1 commit
    • Rafael J. Wysocki's avatar
      Merge updates of thermal drivers for Intel platforms for 6.6-rc1. · d0812286
      Rafael J. Wysocki authored
      These remove a redundant check from a driver's "remove" routine
      and use module_platform_driver() to replace an open-coded version
      of it in one driver.
      
      * thermal-intel:
        thermal: intel: intel_soc_dts_iosf: Remove redundant check
        thermal: intel: int340x: simplify the code with module_platform_driver()
      d0812286
  2. 22 Aug, 2023 4 commits
    • Zhang Rui's avatar
      thermal: intel: intel_soc_dts_iosf: Remove redundant check · ee188ee6
      Zhang Rui authored
      Remove the redundant check in remove_dts_thermal_zone() because all of
      its existing callers pass a valid pointer as the argument.
      Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ee188ee6
    • Yang Yingliang's avatar
      thermal: intel: int340x: simplify the code with module_platform_driver() · 1a6e1004
      Yang Yingliang authored
      The init/exit() of the driver only calls platform_driver_{un}register(),
      so it can be simpilfied by using module_platform_driver().
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1a6e1004
    • Peng Fan's avatar
      thermal/of: Fix potential uninitialized value access · f96801f0
      Peng Fan authored
      If of_parse_phandle_with_args() called from __thermal_of_bind() or
      __thermal_of_unbind() fails, cooling_spec.np will not be initialized,
      so move the of_node_put() calls below the respective return value checks
      to avoid dereferencing an uninitialized pointer.
      
      Fixes: 3fd6d6e2 ("thermal/of: Rework the thermal device tree initialization")
      Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
      [ rjw: Subject and changelog edits ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f96801f0
    • Rafael J. Wysocki's avatar
      Merge ACPI thermal driver changes for 6.6-rc1. · b616959a
      Rafael J. Wysocki authored
      This reworks the ACPI thermal driver to use a table of generic trip
      point structures on top of the internal representation of trip points
      and removes thermal zone callbacks that are not necessary any more
      from it.
      
      It requires some relatively small changes to be made in the thermal core
      too and it is based on top of changes reworking ACPI device notification
      handling that are included in this merge.
      
      * acpi-thermal: (24 commits)
        ACPI: thermal: Eliminate code duplication from acpi_thermal_notify()
        ACPI: thermal: Drop unnecessary thermal zone callbacks
        ACPI: thermal: Rework thermal_get_trend()
        ACPI: thermal: Use trip point table to register thermal zones
        thermal: core: Rework and rename __for_each_thermal_trip()
        ACPI: thermal: Introduce struct acpi_thermal_trip
        ACPI: thermal: Carry out trip point updates under zone lock
        ACPI: thermal: Clean up acpi_thermal_register_thermal_zone()
        thermal: core: Add priv pointer to struct thermal_trip
        thermal: core: Introduce thermal_zone_device_exec()
        thermal: core: Do not handle trip points with invalid temperature
        ACPI: thermal: Drop redundant local variable from acpi_thermal_resume()
        ACPI: thermal: Do not attach private data to ACPI handles
        ACPI: thermal: Drop enabled flag from struct acpi_thermal_active
        ACPI: thermal: Drop nocrt parameter
        ACPI: thermal: Install Notify() handler directly
        ACPI: NFIT: Remove unnecessary .remove callback
        ACPI: NFIT: Install Notify() handler directly
        ACPI: HED: Install Notify() handler directly
        ACPI: battery: Install Notify() handler directly
        ...
      b616959a
  3. 21 Aug, 2023 1 commit
    • Rafael J. Wysocki's avatar
      Merge Intel DTS IOSF thermal driver changes for 6.6-rc1. · 9f15b43f
      Rafael J. Wysocki authored
      These fix a few issues in the Intel DTS IOSF thermal driver, clean up
      code in it and make it use trip point tables for registering thermal
      zones.
      
      * thermal-intel:
        thermal: intel: intel_soc_dts_iosf: Use struct thermal_trip
        thermal: intel: intel_soc_dts_iosf: Rework critical trip setup
        thermal: intel: intel_soc_dts_iosf: Add helper for resetting trip points
        thermal: intel: intel_soc_dts_iosf: Change initialization ordering
        thermal: intel: intel_soc_dts_iosf: Pass sensors to update_trip_temp()
        thermal: intel: intel_soc_dts_iosf: Untangle update_trip_temp()
        thermal: intel: intel_soc_dts_iosf: Always assume notification support
        thermal: intel: intel_soc_dts_iosf: Drop redundant symbol definition
        thermal: intel: intel_soc_dts_iosf: Always use 2 trips
      9f15b43f
  4. 17 Aug, 2023 10 commits
  5. 11 Aug, 2023 7 commits
    • Rafael J. Wysocki's avatar
      thermal: intel: intel_soc_dts_iosf: Use struct thermal_trip · 4effd28e
      Rafael J. Wysocki authored
      Because the number of trip points in each thermal zone and their
      types are known to intel_soc_dts_iosf_init() prior to the registration
      of the thermal zones, make it create an array of struct thermal_trip
      entries in each struct intel_soc_dts_sensor_entry object and make
      add_dts_thermal_zone() use thermal_zone_device_register_with_trips()
      for thermal zone registration and pass that array as its second
      argument.
      
      Drop the sys_get_trip_temp() and sys_get_trip_type() callback
      functions along with the respective callback pointers in
      tzone_ops, because they are not necessary any more.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      4effd28e
    • Rafael J. Wysocki's avatar
      thermal: intel: intel_soc_dts_iosf: Rework critical trip setup · 02a49aac
      Rafael J. Wysocki authored
      Critical trip points appear in the DTS thermal zones only after those
      thermal zones have been registered via intel_soc_dts_iosf_init().
      Moreover, they are "created" by changing the type of an existing trip
      point from THERMAL_TRIP_PASSIVE to THERMAL_TRIP_CRITICAL via
      intel_soc_dts_iosf_add_read_only_critical_trip(), the caller of which
      has to be careful enough to pass at least 1 as the number of read-only
      trip points to intel_soc_dts_iosf_init() beforehand.
      
      This is questionable, because user space may have started to use the
      trips at the time when intel_soc_dts_iosf_add_read_only_critical_trip()
      runs and there is no synchronization between it and sys_set_trip_temp().
      
      To address it, use the observation that nonzero number of read-only
      trip points is only passed to intel_soc_dts_iosf_init() when critical
      trip points are going to be used, so in fact that function may get all
      of the information regarding the critical trip points upfront and it
      can configure them before registering the corresponding thermal zones.
      
      Accordingly, replace the read_only_trip_count argument of
      intel_soc_dts_iosf_init() with a pair of new arguments related to
      critical trip points: a bool one indicating whether or not critical
      trip points are to be used at all and an int one representing the
      critical trip point temperature offset relative to Tj_max.  Use these
      arguments to configure the critical trip points before the registration
      of the thermal zones and to compute the number of writeable trip points
      in add_dts_thermal_zone().
      
      Modify both callers of intel_soc_dts_iosf_init() to take these changes
      into account and drop the intel_soc_dts_iosf_add_read_only_critical_trip()
      call, that is not necessary any more, from intel_soc_thermal_init(),
      which also allows it to return success right after requesting the IRQ.
      
      Finally, drop intel_soc_dts_iosf_add_read_only_critical_trip()
      altogether, because it does not have any more users.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      02a49aac
    • Rafael J. Wysocki's avatar
      thermal: intel: intel_soc_dts_iosf: Add helper for resetting trip points · 5bc3da35
      Rafael J. Wysocki authored
      Because trip points are reset for each sensor in two places in the
      same way, add a helper function for that to reduce code duplication
      a bit.
      
      No intentional functional impact.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      5bc3da35
    • Rafael J. Wysocki's avatar
      thermal: intel: intel_soc_dts_iosf: Change initialization ordering · 51f2aaf0
      Rafael J. Wysocki authored
      The initial configuration of trip points in intel_soc_dts_iosf_init()
      takes place after registering the sensor thermal zones which is
      potentially problematic, because it may race with the setting of trip
      point temperatures via sysfs, as there is no synchronization between it
      and sys_set_trip_temp().
      
      To address this, change the initialization ordering so that the trip
      points are configured prior to the registration of thermal zones.
      
      Accordingly, change the cleanup ordering in intel_soc_dts_iosf_exit()
      to remove the thermal zones before resetting the trip points.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      51f2aaf0
    • Rafael J. Wysocki's avatar
      thermal: intel: intel_soc_dts_iosf: Pass sensors to update_trip_temp() · cbc28057
      Rafael J. Wysocki authored
      After previous changes, update_trip_temp() only uses its dts argument to
      get to the sensors field in the struct intel_soc_dts_sensor_entry object
      pointed to by that argument, so pass the value of that field directly to
      it instead.
      
      No intentional functional impact.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      cbc28057
    • Rafael J. Wysocki's avatar
      thermal: intel: intel_soc_dts_iosf: Untangle update_trip_temp() · 0b28ba27
      Rafael J. Wysocki authored
      Function update_trip_temp() is currently used for the initialization
      of trip points as well as for changing trip point temperatures in
      sys_set_trip_temp().
      
      This is quite confusing and passing the value of dts->trip_types[trip]
      to it so that it can store that value in the same memory location is
      not particularly useful, because it only is necessary to set the
      trip point type once, at the initialization time.
      
      For this reason, drop the last argument from update_trip_temp() and
      introduce configure_trip() calling the former internally for the
      initial configuration of trip points.
      
      Modify the majority of update_trip_temp() callers to use
      configure_trip() instead of it.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      0b28ba27
    • Rafael J. Wysocki's avatar
      thermal: intel: intel_soc_dts_iosf: Always assume notification support · 4f164435
      Rafael J. Wysocki authored
      None of the existing callers of intel_soc_dts_iosf_init() passes
      INTEL_SOC_DTS_INTERRUPT_NONE as the first argument to it, so the
      notification local variable in it is always true and the
      notification_support argument of add_dts_thermal_zone() is always
      true either.
      
      For this reason, drop the notification local variable from
      intel_soc_dts_iosf_init() and the notification_support argument from
      add_dts_thermal_zone() and rearrange the latter to always set
      writable_trip_cnt and trip_mask.
      
      No intentional functional impact.
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      4f164435
  6. 10 Aug, 2023 5 commits
  7. 09 Aug, 2023 1 commit
  8. 01 Aug, 2023 1 commit
  9. 31 Jul, 2023 2 commits
  10. 24 Jul, 2023 2 commits
  11. 23 Jul, 2023 6 commits
    • Linus Torvalds's avatar
      Linux 6.5-rc3 · 6eaae198
      Linus Torvalds authored
      6eaae198
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 3b4e48b8
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Swapping the ring buffer for snapshotting (for things like irqsoff)
         can crash if the ring buffer is being resized. Disable swapping when
         this happens. The missed swap will be reported to the tracer
      
       - Report error if the histogram fails to be created due to an error in
         adding a histogram variable, in event_hist_trigger_parse()
      
       - Remove unused declaration of tracing_map_set_field_descr()
      
      * tag 'trace-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing/histograms: Return an error if we fail to add histogram to hist_vars list
        ring-buffer: Do not swap cpu_buffer during resize process
        tracing: Remove unused extern declaration tracing_map_set_field_descr()
      3b4e48b8
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.5' of... · 12a5336c
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix stale help text in gconfig
      
       - Support *.S files in compile_commands.json
      
       - Flatten KBUILD_CFLAGS
      
       - Fix external module builds with Rust so that temporary files are
         created in the modules directories instead of the kernel tree
      
      * tag 'kbuild-fixes-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: rust: avoid creating temporary files
        kbuild: flatten KBUILD_CFLAGS
        gen_compile_commands: add assembly files to compilation database
        kconfig: gconfig: correct program name in help text
        kconfig: gconfig: drop the Show Debug Info help text
      12a5336c
    • Miguel Ojeda's avatar
      kbuild: rust: avoid creating temporary files · df01b7cf
      Miguel Ojeda authored
      `rustc` outputs by default the temporary files (i.e. the ones saved
      by `-Csave-temps`, such as `*.rcgu*` files) in the current working
      directory when `-o` and `--out-dir` are not given (even if
      `--emit=x=path` is given, i.e. it does not use those for temporaries).
      
      Since out-of-tree modules are compiled from the `linux` tree,
      `rustc` then tries to create them there, which may not be accessible.
      
      Thus pass `--out-dir` explicitly, even if it is just for the temporary
      files.
      
      Similarly, do so for Rust host programs too.
      Reported-by: default avatarRaphael Nestler <raphael.nestler@gmail.com>
      Closes: https://github.com/Rust-for-Linux/linux/issues/1015Reported-by: default avatarAndrea Righi <andrea.righi@canonical.com>
      Tested-by: Raphael Nestler <raphael.nestler@gmail.com> # non-hostprogs
      Tested-by: Andrea Righi <andrea.righi@canonical.com> # non-hostprogs
      Fixes: 295d8398 ("kbuild: specify output names separately for each emission type from rustc")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      Tested-by: default avatarMartin Rodriguez Reboredo <yakoyoku@gmail.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      df01b7cf
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 269f4a4b
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "ARM:
      
         - Avoid pKVM finalization if KVM initialization fails
      
         - Add missing BTI instructions in the hypervisor, fixing an early
           boot failure on BTI systems
      
         - Handle MMU notifiers correctly for non hugepage-aligned memslots
      
         - Work around a bug in the architecture where hypervisor timer
           controls have UNKNOWN behavior under nested virt
      
         - Disable preemption in kvm_arch_hardware_enable(), fixing a kernel
           BUG in cpu hotplug resulting from per-CPU accessor sanity checking
      
         - Make WFI emulation on GICv4 systems robust w.r.t. preemption,
           consistently requesting a doorbell interrupt on vcpu_put()
      
         - Uphold RES0 sysreg behavior when emulating older PMU versions
      
         - Avoid macro expansion when initializing PMU register names,
           ensuring the tracepoints pretty-print the sysreg
      
        s390:
      
         - Two fixes for asynchronous destroy
      
        x86 fixes will come early next week"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: s390: pv: fix index value of replaced ASCE
        KVM: s390: pv: simplify shutdown and fix race
        KVM: arm64: Fix the name of sys_reg_desc related to PMU
        KVM: arm64: Correctly handle RES0 bits PMEVTYPER<n>_EL0.evtCount
        KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption
        KVM: arm64: Add missing BTI instructions
        KVM: arm64: Correctly handle page aging notifiers for unaligned memslot
        KVM: arm64: Disable preemption in kvm_arch_hardware_enable()
        KVM: arm64: Handle kvm_arm_init failure correctly in finalize_pkvm
        KVM: arm64: timers: Use CNTHCTL_EL2 when setting non-CNTKCTL_EL1 bits
      269f4a4b
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 15b593ba
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Bug and regression fixes for 6.5-rc3 for ext4's mballoc and jbd2's
        checkpoint code"
      
      * tag 'ext4_for_linus-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix rbtree traversal bug in ext4_mb_use_preallocated
        ext4: fix off by one issue in ext4_mb_choose_next_group_best_avail()
        ext4: correct inline offset when handling xattrs in inode body
        jbd2: remove __journal_try_to_free_buffer()
        jbd2: fix a race when checking checkpoint buffer busy
        jbd2: Fix wrongly judgement for buffer head removing while doing checkpoint
        jbd2: remove journal_clean_one_cp_list()
        jbd2: remove t_checkpoint_io_list
        jbd2: recheck chechpointing non-dirty buffer
      15b593ba