Commit Graph

1397618 Commits

Author SHA1 Message Date
Alice Ryhl
c1437332e4 rust_binder: move BC_FREE_BUFFER drop inside if statement
When looking at flamegraphs, there is a pretty large entry for the
function call drop_in_place::<Option<Allocation>> which in turn calls
drop_in_place::<Allocation>. Combined with the looper_need_return
condition, this means that the generated code looks like this:

	if let Some(buffer) = buffer {
	    if buffer.looper_need_return_on_free() {
	        self.inner.lock().looper_need_return = true;
	    }
	}
	drop_in_place::<Option<Allocation>>() { // not inlined
	    if let Some(buffer) = buffer {
	    	drop_in_place::<Allocation>(buffer);
	    }
	}

This kind of situation where you check X and then check X again is
normally optimized into a single condition, but in this case due to the
non-inlined function call to drop_in_place::<Option<Allocation>>, that
optimization does not happen.

Furthermore, the drop_in_place::<Allocation> call is only two-thirds of
the drop_in_place::<Option<Allocation>> call in the flamegraph. This
indicates that this double condition is not performing well. Also, last
time I looked at Binder perf, I remember finding that the destructor of
Allocation was involved with many branch mispredictions.

Thus, change this code to look like this:

	if let Some(buffer) = buffer {
	    if buffer.looper_need_return_on_free() {
	        self.inner.lock().looper_need_return = true;
	    }
	    drop_in_place::<Allocation>(buffer);
	}

by dropping the Allocation directly. Flamegraphs confirm that the
drop_in_place::<Option<Allocation>> call disappears from this change.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Carlos Llamas <cmllamas@google.com>
Link: https://patch.msgid.link/20251029-binder-bcfreebuf-option-v1-1-4d282be0439f@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 13:24:28 +01:00
Alice Ryhl
d4b83ba11c rust_binder: use compat_ptr_ioctl
Binder always treats the ioctl argument as a pointer. In this scenario,
the idiomatic way to implement compat_ioctl is to use compat_ptr_ioctl.
Thus update Rust Binder to do that.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Carlos Llamas <cmllamas@google.com>
Link: https://patch.msgid.link/20251031-binder-compatptrioctl-v2-1-3d05b5cc058e@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 13:24:25 +01:00
Carlos Llamas
a1fb84ab7b binder: mark binder_alloc_exhaustive_test as slow
The binder_alloc_exhaustive_test kunit test takes over 30s to complete
and the kunit framework reports:

  # binder_alloc_exhaustive_test: Test should be marked slow (runtime: 33.842881934s)

Mark the test as suggested to silence the warning.

Cc: Tiffany Yang <ynaffit@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Tiffany Yang <ynaffit@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20251024161525.1732874-1-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-26 13:24:19 +01:00
Alice Guo
d54d5e294c nvmem: imx-ocotp-ele: Add i.MX94 OCOTP support
Add OCOTP device type for i.MX94, including register offset, total size,
and fuse layout. This enables NVMEM access to the eFuse of i.MX94.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-9-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:22 +01:00
Alice Guo
c7ea8eadd5 dt-bindings: nvmem: imx-ocotp: Add support for i.MX94
Add the compatible string "fsl,imx94-ocotp" to the imx-ocotp device tree
binding documentation to support the i.MX94.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-8-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:22 +01:00
Wolfram Sang
ee5c565163 dt-bindings: nvmem: don't check node names
Node names are already and properly checked by the core schema. No need
to do it again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-7-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:22 +01:00
Louis-Alexis Eyraud
7dc63a2a8d dt-bindings: nvmem: mediatek: efuse: Add compatible for MT8189 SoC
Add compatible string for the eFuse layout on MT8189 SoC, that is
compatible with MT8186.

Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-6-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:22 +01:00
Jascha Sundaresan
5b2f8c133d nvmem: layouts: u-boot-env: add optional "env-size" property
Some devices reserve a larger NVMEM region for the U-Boot environment
than the actual environment data length used by U-Boot itself. The CRC32
in the U-Boot header is calculated over the smaller data length, causing
CRC validation to fail when Linux reads the full partition.

Allow an optional device tree property "env-size" to specify the
environment data size to use for CRC computation.

v2: add missing $ref line to DT binding

Signed-off-by: Jascha Sundaresan <flizarthanon@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-5-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:22 +01:00
Heiko Stuebner
2f9fae5098 nvmem: Add driver for the eeprom in qnap-mcu controllers
The qnap-mcu also has an eeprom connected to it, that contains some
specific product-information like the mac addresses for the network
interfaces.

Add a nvmem driver for it.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Srinivas Kandagatla <srini@kernel.org>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-4-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:22 +01:00
Jack Hsu
47b7ea6528 dt-bindings: nvmem: Support MediaTek MT8189 evb board efuse
add compatible string for mt8189 evb board dts node of efuse

Signed-off-by: Jack Hsu <jh.hsu@mediatek.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-3-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:22 +01:00
Akhil P Oommen
e7ac47e20f dt-bindings: nvmem: qfprom: Add sa8775p compatible
Document compatible string for the QFPROM on Lemans platform.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20251114110636.143268-2-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 18:06:21 +01:00
Dinh Nguyen
377441d53a firmware: stratix10-svc: fix make htmldocs warning for stratix10_svc
Fix this warning that was generated from "make htmldocs":

WARNING: drivers/firmware/stratix10-svc.c:58 struct member 'intel_svc_fcs'
not described in 'stratix10_svc'

Fixes: e6281c2667 ("firmware: stratix10-svc: Add support for FCS")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/linux-next/20251106145941.37920e97@canb.auug.org.au/
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Link: https://patch.msgid.link/20251114185815.358423-1-dinguyen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 17:49:27 +01:00
Dinh Nguyen
935419b9fb firmware: stratix10-svc: fix make htmldocs warning
Stephen Rothwell reports htmldocs warnings when merging char-misc tree:

WARNING: include/linux/firmware/intel/stratix10-svc-client.h:22 This comment
starts with '/**', but isn't a kernel-doc comment.

WARNING: include/linux/firmware/intel/stratix10-svc-client.h:184 Enum value
'COMMAND_HWMON_READTEMP' not described in enum 'stratix10_svc_command_code'

WARNING: include/linux/firmware/intel/stratix10-svc-client.h:184 Enum value
'COMMAND_HWMON_READVOLT' not described in enum 'stratix10_svc_command_code'

WARNING: include/linux/firmware/intel/stratix10-svc-client.h:307 function
parameter 'cb_arg' not described in 'async_callback_t'

Fixes: 4f49088c16 ("firmware: stratix10-svc: Add definition for voltage and temperature sensor")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/linux-next/20251114153920.1c5df700@canb.auug.org.au/
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Link: https://patch.msgid.link/20251114185815.358423-3-dinguyen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 17:49:12 +01:00
Dinh Nguyen
36b1cb4f33 firmware: stratix-svc: fix make htmldocs warning
Stephen Rothwell reports htmldocs warnings when merging char-misc tree:

WARNING: drivers/firmware/stratix10-svc.c:58 This comment starts with '/**',
but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * Total number of transaction IDs, which is a combination of

WARNING: drivers/firmware/stratix10-svc.c:302 This comment starts with '/**',
but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * svc_mem_lock protects access to the svc_data_mem list for

Fixes: bcb9f4f070 ("firmware: stratix10-svc: Add support for async communication")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/linux-next/20251114153347.16001109@canb.auug.org.au/
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Link: https://patch.msgid.link/20251114185815.358423-2-dinguyen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-11-24 17:49:12 +01:00
Greg Kroah-Hartman
3e92fdae7f Merge tag 'icc-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next
Georgi writes:

interconnect changes for 6.19

This pull request contains the interconnect changes for the 6.19-rc1
merge window. The core and driver changes are listed below.

Core changes:
- kbps_to_icc() macro optimization

Driver changes:
- Switch all Qualcomm RPMh interconnect drivers to use the dynamic
  node IDs and drop support for non-dynamic ID allocation
- Add new driver and BWMON support for the Kaanapali SoC
- Add QoS support for the SM6350 SoC
- Add QoS support for the SA8775p SoC
- Fix missing link from SNOC_PNOC to the USB 2 on MSM8996 SoC that
  includes also a dts change that has been acked by the maintainer
- Drop the QPIC interconnect and BCM nodes for the SDX75 SoC, as these
  should be handled by the rpmh-clk driver
- Other misc fixes

Signed-off-by: Georgi Djakov <djakov@kernel.org>

* tag 'icc-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/djakov/icc: (40 commits)
  interconnect: qcom: sm6350: enable QoS configuration
  interconnect: qcom: sm6350: Remove empty BCM arrays
  interconnect: qcom: icc-rpmh: Get parent's regmap for nested NoCs
  dt-bindings: interconnect: qcom,sm6350-rpmh: Add clocks for QoS
  dt-bindings: interconnect: qcom-bwmon: Document Kaanapali BWMONs
  interconnect: qcom: icc-rpmh: drop support for non-dynamic IDS
  interconnect: qcom: sm8750: convert to dynamic IDs
  interconnect: qcom: sm8650: convert to dynamic IDs
  interconnect: qcom: sm8550: convert to dynamic IDs
  interconnect: qcom: sm8450: convert to dynamic IDs
  interconnect: qcom: sm8350: convert to dynamic IDs
  interconnect: qcom: sm8150: convert to dynamic IDs
  interconnect: qcom: sm7150: convert to dynamic IDs
  interconnect: qcom: sm6350: convert to dynamic IDs
  interconnect: qcom: sdx75: convert to dynamic IDs
  interconnect: qcom: sdx65: convert to dynamic IDs
  interconnect: qcom: sdx55: convert to dynamic IDs
  interconnect: qcom: sdm670: convert to dynamic IDs
  interconnect: qcom: sc7180: convert to dynamic IDs
  interconnect: qcom: sar2130p: convert to dynamic IDs
  ...
2025-11-24 17:35:12 +01:00
Greg Kroah-Hartman
ac4b8282bb Merge tag 'coresight-next-v6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next
Suzuki writes:

coresight: Updates for Linux v6.19

The changes for Linux v6.19 include :
 - Support for static TPDM
 - Fixes to TMC-ETR with CATU where buffer wasn't available to CATU in perf mode
 - Clean ups to the component operations to accept coresight_path
 - Fixes to the ETM4x/ETM3x driver

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>

* tag 'coresight-next-v6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/coresight/linux:
  coresight: etm4x: Remove the state_needs_restore flag
  coresight: etm4x: Remove the redundant DSB
  coresight: etm4x: Properly control filter in CPU idle with FEAT_TRF
  coresight: etm4x: Add context synchronization before enabling trace
  coresight: etm4x: Correct polling IDLE bit
  coresight: etm3x: Always set tracer's device mode on target CPU
  coresight: etm4x: Always set tracer's device mode on target CPU
  coresight: Change device mode to atomic type
  coresight: change the sink_ops to accept coresight_path
  coresight: change helper_ops to accept coresight_path
  coresight: tmc: add the handle of the event to the path
  coresight: tpdm: remove redundant check for drvdata
  coresight: tpdm: add static tpdm support
  dt-bindings: arm: document the static TPDM compatible
  coresight: ETR: Fix ETR buffer use-after-free issue
2025-11-24 17:34:19 +01:00
Greg Kroah-Hartman
fb64bf4806 Merge tag 'mhi-for-v6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next
Manivannan writes:

MHI Host
========

- Add support for Telit FE990B40 and Foxconn T99W760 modems

MHI Endpoint
============

- Make 'struct mhi_ep_bus_type' const  as the driver core now handles the const
  bus_type.

- Add WQ_PERCPU flag to alloc_workqueue() as a part of the workqueue refactoring

* tag 'mhi-for-v6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
  bus: mhi: host: pci_generic: Add Foxconn T99W760 modem
  bus: mhi: ep: add WQ_PERCPU to alloc_workqueue users
  bus: mhi: host: pci_generic: Add Telit FE990B40 modem support
  bus: mhi: ep: Make mhi_ep_bus_type const
2025-11-21 17:42:47 +01:00
Greg Kroah-Hartman
e354cc78f7 Merge tag 'iio-for-6.19a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next
Jonathan writes:

IIO: New device support, features and cleanup for 6.19

The usual bunch of new device support, but also quite a bit of cleanup
of the core and older drivers which is always good to see.

New device support
------------------

adi,ad4080
- Add support for AD4081, AD4083, AD4084, AD4086 and AD4087 ADCs with
  slightly different features to existing supported parts (max CNV clock
  count, resolution etc)
adi,adxl380
- Add support for ADXL318 and ADXL319 which have reduced functionality
  compared to other supported parts, particularly around event detection.
aosong,adp810
- New driver for this differential pressure and temperature sensor.
aspeed,adc
- Add support for the AST2700 SoC ADCs which differ in small ways from
  already supported parts.
bosch,sm330
- New driver for this IMU (accelerometer + gyroscop) with I2C and SPI bus
  support.
invensense,icm45600
- New driver for this family of IMUs with sub drivers for accelerometer
  and gyroscope elements. I2C, I3C and SPI busses all supported.
  * Supports ICM45605, ICM45606, ICM45608, ICM45634, ICM45686, ICM45687,
    ICM45688P, ICM45689.
  * Support basic features and FIFO.
maxim,max14001
- New driver for the MAX14001 and MAX14002 ADCs.
renesas,rzt2h
- New driver supporting the RZ/T2H and RZ/N2H ADCs found in various SoCs.
renesas,rznl
- New driver supporting the RZ/NL ADC found in various SoCs.

Features
--------

adi,ad5446
- Add a DT binding doc for the 29 variants currently covered by the driver.
- Add adi,ad5542 which is compatiable with the adi,ad5542a which was
  already supported.
bosch,bma220
- I2C support including an I2C bus watchdog.
- Power supply control
- Data ready trigger.
- Low pass filter control.
- Debugfs register access.
- Add Petre Rodan as a maintainer of this driver (thanks!)
bosch,bmi270
- Add support for motion events.
fsl,mpl3115
- Add a dataready trigger and related sampling frequency control.
- Add threshold events.
infineon,dps310
- Add a specific device tree binding.
maxim,max30100
- Allow control of LED pulse-width in dt-binding. Optimum value depends
  on physical characteristics of the device which contains this sensor.
mediatek,mt2701
- Add dt compatible for the mt8189.
rockchip,saradc
- Add rk3506 compatible which is functionally the same as the already
  supported rk3528 (which is therefore the fallback)
st,lsm6dsx
- Make sampling more flexible when both fifo and events are of interest
  by decoupling the FIFO fill rate from actual sampling.

Cleanup and minor fixes
-----------------------

core
- Document and add might_sleep() to iio_push_to_buffers_with_ts_unaligned()
  as it allocates a buffer, typically just on 1st call.
- Add documentation for iio_push_to_buffers_with_ts() which is being used
  to replace iio_push_to_buffers_with_timestamp() in new code as it
  validates the buffer size.  Make the deprecation of the old function
  clear.
- Document that the store_to() callback in struct iio_buffer_access_funcs
  may be called from contexts that cannot sleep.
- Document that the cb() provided to a callback buffer may be called
  from contexts that cannot sleep.
- Cleanup up industrialio-backend.c comments.
- Call mutex_destroy() in cleanup of buffers.
- Call device_initialize() later to avoid having to call device_put()
  before configuration is otherwise complete.
- Use mutex_init_with_key() to replace opencoded version.
- Use dma_buf_unmap_attachment_unlocked() to replace opencoded version.
- Reorder Makefile for pressure sensors.
various
- Uses sysfs_emit() to replace sprintf() in read_label() and other
  callbacks that typically are used to write data to sysfs buffers.
- Switch to REGCACHE_MAPLE in various drivers.
adi,docs
- Fix up formatting of cross references and other kernel-doc issues.
adi,ad4080
- Fix wrong masking of product IDs.
adi,ad5446
- Use DMA safe buffers as needed for SPI.
- Drop a duplicate device chip specific data structure where two parts
  are functionally identical.
- Fail probe if reference is not available.
- Split up the massive array of chip type specific structures into
  separate structures as this tends to be easier to read and maintain.
- Add explicit of_device_id entries for all supported parts.
- Split I2C and SPI parts away from core to avoid ifdef complexity.
- Switch to devm_mutex_init().
- Make use of guard() to simplify code.
- Applying IWYU principles and reorder headers.
- Various other minor cleanup.
adi,ad7124
- Add debugfs to support single cycle mode, typically only used for cases
  such as validate performance of the ADC.
- Various other minor cleanup including removing some layers of indirection
  that weren't necessary.
- Add extended attributes to the temperature channel which follows the same
  signal path as other channels.
- Replace the setup register allocation strategy with a simpler more
  predictable one (a fix for OOB from this code follows later in this pull
  request).
adi,adxl345
- Ensure dt-binding allows for both interrupt wired at the same time.
arm,scmi
- Replace const_ilog2() with the resulting value which ends up simpler
  to read.
bosch,bma220
- Add correct SPI mode specification to the device tree binding.
- Fix up interrupt type in dt binding example to match that the driver
  expects.
- Relax hard constraint on matching chip ID with a message only so as to
  enable fallback DT compatibles to work.
- Use local struct device *dev to replaces lots of indirect look ups.
- Improve includes on approximate IWYU basis.
- Explicit of_match_table.
- Reset some registers during probe.
- Move to regmap.
- Ensure a timestamp is available when filling the buffer by using a
  locally acquired one rather than relying on trigger top half running.
- Add a utility function to search value pair tables for a match.
- Various other minor improvements.
- Move code to avoid a false dependency of the core code on the I2C module.
bosch,bma400
- Improve register and field naming + organization. Use with FIELD_GET()
  and FIELD_PREP() to allow dropping of shift defines.
- Use macros to define event related fields.
- Switch to an address lookup based on an index variable to replace lots of
  very similar register macros.
- Rename activity_event_en() to generic_event_en() to better reflect what
  it does.
- Improve comments around interrupt register handling.
fsl,mpl3115
- Factor out code for triggered buffer data collection.
- Use more consistent register field naming style.
- Use get_unaligned_be24() to get the pressure.
invensense,mpu6050
- Drop false requirement in DT binding for the interrupt. The driver will
  be able to do less if one is not provided, but some features are still
  available.
invensense,icm45600_i3c
- Fix missing return on failure to match part.
linear,ltc2688
- Use devm_mutex_init() so mutex_destroy() is called in tear down path.
- Use guard() to simplify lock handling in error return paths.
qcom,vadc
- Fix up some kernel-doc related warnings.
rohm,bd79112 and bd79124
- Use regmap_reg_range() helper to set the ranges.
st,lsm6dsx
- Fix units of ODR in structure documentation.
ti,am335x
- Add range checks to avoid a compiler warning.
ti,pac1934
- Switch to system_percpu_wq.

Various other minor typo fixes etc.

* tag 'iio-for-6.19a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (150 commits)
  staging: iio: adt7316: replace sprintf() with sysfs_emit()
  iio: pressure: Arrange Makefile alphabetically
  iio: ABI: document pressure event attributes
  iio: mpl3115: add threshold events support
  iio: mpl3115: use get_unaligned_be24() to retrieve pressure data
  iio: buffer: use dma_buf_unmap_attachment_unlocked() helper
  iio: core: Replace lockdep_set_class() + mutex_init() by combined call
  iio: core: Clean up device correctly on iio_device_alloc() failure
  iio: core: add missing mutex_destroy in iio_dev_release()
  iio: accel: adxl380: add support for ADXL318 and ADXL319
  dt-bindings: iio: accel: adxl380: add new supported parts
  iio: imu: inv_icm45600: Initializes inv_icm45600_buffer_postdisable() sleep
  iio: adc: pac1934: replace use of system_wq with system_percpu_wq
  iio: dac: ad5446: Add AD5542 to the spi id table
  iio: dac: ad5446: Fix coding style issues
  iio: dac: ad5446: Refactor header inclusion
  iio: dac: ad5446: Make use of the cleanup helpers
  iio: dac: ad5446: Make use of devm_mutex_init()
  iio: dac: ad5446: Separate I2C/SPI into different drivers
  iio: dac: ad5456: Add missing DT compatibles
  ...
2025-11-21 15:25:20 +01:00
Greg Kroah-Hartman
623db9a1dd Merge tag 'w1-drv-6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1 into char-misc-next
Krzysztof writes:

1-Wire bus drivers for v6.19

Just a bunch of cleanups for few 1-Wire drivers: use sysfs_emit() in
sysfs show, avoid strcpy() and strcat(), and drop unneeded
pm_runtime_mark_last_busy() because core runtime PM handles it.

* tag 'w1-drv-6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/krzk/linux-w1:
  w1: omap-hdq: Remove redundant pm_runtime_mark_last_busy() calls
  w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
  w1: use sysfs_emit() in sysfs show() callbacks
2025-11-21 15:23:46 +01:00
Greg Kroah-Hartman
5abeedad72 Merge tag 'fpga-for-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next
Xu writes:

FPGA Manager changes for 6.17-rc1

- Matthew hands over the maintainership of Intel MAX10 BMC secure
  update to Yilun.

- Fabio adds missing spi_device_id table for xilinx-spi

- Dihn updates link for Altera & AMD's dt-bindings.

- Andy uses pci_find_vsec_capability() instead of open-codes for
  altera-cvp.

All patches have been reviewed on the mailing list, and have been in the
last linux-next releases (as part of our for-next branch).

Signed-off-by: Xu Yilun <yilun.xu@intel.com>

* tag 'fpga-for-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga:
  fpga: altera-cvp: Use pci_find_vsec_capability() when probing FPGA device
  dt-bindings: fpga: update link for Altera's and AMD partial recon
  fpga: xilinx-spi: Add missing spi_device_id table
  MAINTAINERS: change maintainer for Intel MAX10 BMC secure updates
2025-11-21 15:22:48 +01:00
Slark Xiao
ac35e04f80 bus: mhi: host: pci_generic: Add Foxconn T99W760 modem
T99W760 modem is based on Qualcomm SDX35 chipset. It uses the same channel
configurations of Foxconn SDX61 modem. Hence, add support for it by reusing
the 'modem_foxconn_sdx61_config' config structure.

The EDL firmware for this modem has been pushed to linux-firmware.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
[mani: reworded description]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20251119105615.48295-2-slark_xiao@163.com
2025-11-20 11:28:47 +05:30
Georgi Djakov
60b52af082 Merge branch 'icc-sm6350' into icc-next
Update dt-bindings, driver and dts in order to configure the QoS
registers for the various SM6350 interconnects.

* icc-sm6350
  dt-bindings: interconnect: qcom,sm6350-rpmh: Add clocks for QoS
  interconnect: qcom: icc-rpmh: Get parent's regmap for nested NoCs
  interconnect: qcom: sm6350: Remove empty BCM arrays
  interconnect: qcom: sm6350: enable QoS configuration

Link: https://lore.kernel.org/r/20251114-sm6350-icc-qos-v2-0-6af348cb9c69@fairphone.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 16:07:00 +02:00
Luca Weiss
ee71848130 interconnect: qcom: sm6350: enable QoS configuration
Enable QoS configuration for master ports with predefined values for
priority and urgency forwarding.

While this does require some "clocks" to be specified in devicetree to
work correctly, thanks to ".qos_requires_clocks = true," this is
backwards compatible with old DT as QoS programming will be skipped for
aggre1_noc and aggre2_noc when clocks are not provided.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20251114-sm6350-icc-qos-v2-4-6af348cb9c69@fairphone.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 16:03:12 +02:00
Luca Weiss
ccd789e53a interconnect: qcom: sm6350: Remove empty BCM arrays
Clean up the code by removing empty BCM arrays to save some lines.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20251114-sm6350-icc-qos-v2-3-6af348cb9c69@fairphone.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 16:03:09 +02:00
Luca Weiss
b56fb8aa66 interconnect: qcom: icc-rpmh: Get parent's regmap for nested NoCs
Since commit 57eb14779d ("interconnect: qcom: icc-rpmh: Support child
NoC device probe") the icc-rpmh driver supports initializing child NoCs,
but those child NoCs also need to be able to get the parent's regmap in
order to enable QoS.

Change the driver to support that and support programming QoS register.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251114-sm6350-icc-qos-v2-2-6af348cb9c69@fairphone.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 16:03:05 +02:00
Luca Weiss
dfb1717308 dt-bindings: interconnect: qcom,sm6350-rpmh: Add clocks for QoS
Add the clocks for some interconnects to the bindings that are required
to set up the QoS correctly. Update one of the examples to aggre2_noc to
have an example with clocks.

Also while we're at it, remove #interconnect-cells: true as that's
already provided from qcom,rpmh-common.yaml.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20251114-sm6350-icc-qos-v2-1-6af348cb9c69@fairphone.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 16:03:00 +02:00
Georgi Djakov
5ffe1910ed Merge branch 'icc-dynamic-ids' into icc-next
Currently most of Qualcomm interconnect drivers use static IDs, which
poses a threat of possible conflicts with other drivers.  Rework RPMh
interconnect drivers to use dynamic IDs and drop static IDs
code.

* icc-dynamic-ids
  interconnect: qcom: icc-rpmh: convert link_nodes to dynamic array
  interconnect: qcom: sc7280: convert to dynamic IDs
  interconnect: qcom: sc8180x: convert to dynamic IDs
  interconnect: qcom: sc8280xp: convert to dynamic IDs
  interconnect: qcom: sdm845: convert to dynamic IDs
  interconnect: qcom: sm8250: convert to dynamic IDs
  interconnect: qcom: x1e80100: convert to dynamic IDs
  interconnect: qcom: qcs615: convert to dynamic IDs
  interconnect: qcom: qcs8300: convert to dynamic IDs
  interconnect: qcom: qdu1000: convert to dynamic IDs
  interconnect: qcom: sar2130p: convert to dynamic IDs
  interconnect: qcom: sc7180: convert to dynamic IDs
  interconnect: qcom: sdm670: convert to dynamic IDs
  interconnect: qcom: sdx55: convert to dynamic IDs
  interconnect: qcom: sdx65: convert to dynamic IDs
  interconnect: qcom: sdx75: convert to dynamic IDs
  interconnect: qcom: sm6350: convert to dynamic IDs
  interconnect: qcom: sm7150: convert to dynamic IDs
  interconnect: qcom: sm8150: convert to dynamic IDs
  interconnect: qcom: sm8350: convert to dynamic IDs
  interconnect: qcom: sm8450: convert to dynamic IDs
  interconnect: qcom: sm8550: convert to dynamic IDs
  interconnect: qcom: sm8650: convert to dynamic IDs
  interconnect: qcom: sm8750: convert to dynamic IDs
  interconnect: qcom: icc-rpmh: drop support for non-dynamic IDS

Link: https://lore.kernel.org/r/20251031-rework-icc-v3-0-0575304c9624@oss.qualcomm.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 15:53:04 +02:00
Georgi Djakov
d32e1c2dcc Merge branch 'icc-kaanapali' into icc-next
Add interconnect dt-bindings and driver support for Qualcomm Kaanapali SoC.

* icc-kaanapali
  dt-bindings: interconnect: document the RPMh Network-On-Chip interconnect in Kaanapali SoC
  interconnect: qcom: add Kaanapali interconnect provider driver
  dt-bindings: interconnect: qcom-bwmon: Document Kaanapali BWMONs

Link: https://lore.kernel.org/r/20251031-knp-interconnect-v4-0-568bba2cb3e5@oss.qualcomm.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 01:24:58 +02:00
Amir Vajid
6e38a225fc dt-bindings: interconnect: qcom-bwmon: Document Kaanapali BWMONs
Document the Kaanapali BWMONs, which have one instance per
cluster of BWMONv4.

Signed-off-by: Amir Vajid <amir.vajid@oss.qualcomm.com>
Signed-off-by: Jingyi Wang <jingyi.wang@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250924-knp-bwmon-v1-1-56a9cdda7d72@oss.qualcomm.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
2025-11-19 01:22:33 +02:00
Shi Hao
f9e0579164 staging: iio: adt7316: replace sprintf() with sysfs_emit()
Convert several sprintf() calls to sysfs_emit() in the
sysfs show functions, as it is the preferred helper and
prevents potential buffer overruns.

No functional changes intended.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-16 15:25:08 +00:00
Akhilesh Patil
02d44a1b64 iio: pressure: Arrange Makefile alphabetically
Fix hp206c and st_pressure_* entries in pressure Makefiles to follow
alphabetical order as per guideline mentioned in iio/pressure/Makefile.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-16 15:22:16 +00:00
Antoni Pokusinski
28b53b35c0 iio: ABI: document pressure event attributes
Add sysfs pressure event attributes exposed by the mpl3115 driver. These
allow controlling the threshold value and the enable state.

Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 18:06:47 +00:00
Antoni Pokusinski
6062cd20cb iio: mpl3115: add threshold events support
Add support for pressure and temperature rising threshold events. For
both channels *_en and *_value (in raw units) attributes are exposed.

Since in write_event_config() the ctrl_reg1.active and ctrl_reg4
are modified, accessing the data->ctrl_reg{1,4} in set_trigger_state()
and write_event_config() needs to be now guarded by data->lock.
Otherwise, it would be possible that 2 concurrent threads executing
these functions would access the data->ctrl_reg{1,4} at the same time
and then one would overwrite the other's result.

Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 18:06:47 +00:00
Antoni Pokusinski
47e4b1ca44 iio: mpl3115: use get_unaligned_be24() to retrieve pressure data
The pressure measurement result is arranged as 20-bit unsigned value
residing in three 8-bit registers. Hence, it can be retrieved using
get_unaligned_be24() and by applying 4-bit shift.

Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 18:06:47 +00:00
Liang Jie
0de73abe5f iio: buffer: use dma_buf_unmap_attachment_unlocked() helper
Replace open-coded dma_resv_lock()/dma_resv_unlock() around
dma_buf_unmap_attachment() in iio_buffer_dmabuf_release() with the
dma_buf_unmap_attachment_unlocked() helper.

This aligns with the standard DMA-BUF API, avoids duplicating
locking logic and eases future maintenance. No functional change.

Reviewed-by: fanggeng <fanggeng@lixiang.com>
Signed-off-by: Liang Jie <liangjie@lixiang.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 17:31:31 +00:00
Andy Shevchenko
c76ba4b264 iio: core: Replace lockdep_set_class() + mutex_init() by combined call
Replace lockdep_set_class() + mutex_init() by combined call
mutex_init_with_key().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 17:28:02 +00:00
Andy Shevchenko
b0e6871415 iio: core: Clean up device correctly on iio_device_alloc() failure
Once we called device_initialize() we have to call put_device()
on it. Refactor the code to make it in the right order.

Fixes: fe6f45f6ba ("iio: core: check return value when calling dev_set_name()")
Fixes: 847ec80bba ("Staging: IIO: core support for device registration and management")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 17:28:02 +00:00
Andy Shevchenko
f5d203467a iio: core: add missing mutex_destroy in iio_dev_release()
Add missing mutex_destroy() call in iio_dev_release() to properly
clean up the mutex initialized in iio_device_alloc(). Ensure proper
resource cleanup and follows kernel practices.

Found by code review.

While at it, create a lockdep key before mutex initialisation.
This will help with converting it to the better API in the future.

Fixes: 847ec80bba ("Staging: IIO: core support for device registration and management")
Fixes: ac917a8111 ("staging:iio:core set the iio_dev.info pointer to null on unregister under lock.")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 17:28:02 +00:00
Jonathan Santos
0ecad19643 iio: accel: adxl380: add support for ADXL318 and ADXL319
The ADXL318 and ADXL319 are low noise density, low power, 3-axis
accelerometers based on ADXL380 and ADXL382, respectively. The main
difference between the new parts and the existing ones are the absence
of interrupts and events like tap detection, activity/inactivity, and
free-fall detection.

Other differences in the new parts are fewer power modes, basically
allowing only idle and measurement modes, and the removal of the 12-bit
SAR ADC path for the 3-axis signals (known as lower signal chain),
being excluisive for the temperature sensor in the ADXL318/319.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 17:11:35 +00:00
Jonathan Santos
8775ebd25a dt-bindings: iio: accel: adxl380: add new supported parts
Include ADXL318 and ADXL319 accelerometers to the documentation.
The ADXL318 is based on the ADXL380, while the ADXL319 is based on the
ADXL382. However, the ADXL318/319 do not support some built-in features
like single tap, double tap and triple tap detection, and also activity
and inactivity detection.

Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-11-15 17:10:33 +00:00
Greg Kroah-Hartman
41289b4834 Merge tag 'socfpga_firmware_updates_for_v6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into char-misc-next
Dinh writes:

SoCFPGA firmware updates for v6.19
- Add support for voltage and temperature sensor
- Add a mutex to memory operations on Stratix10 service driver
- Add support for asynchronous communications in the service driver
- Replace scnprintf() with sysfs_emit()

* tag 'socfpga_firmware_updates_for_v6.19' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
  firmware: stratix10-rsu: replace scnprintf() with sysfs_emit() in *_show() functions
  firmware: stratix10-rsu: Migrate RSU driver to use stratix10 asynchronous framework.
  firmware: stratix10-svc: Add support for RSU commands in asynchronous framework
  firmware: stratix10-svc: Add support for async communication
  firmware: stratix10-svc: Add mutex in stratix10 memory management
  firmware: stratix10-svc: Add definition for voltage and temperature sensor
2025-11-13 17:55:05 -05:00
Greg Kroah-Hartman
e3d63f4ef3 Merge tag 'peci-next-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/iwi/linux into char-misc-next
Iwona writes:

Update peci-next for v6.19-rc1

A small change in peci-aspeed converting the driver away from deprecated
round_rate(), allowing it to eventually be removed from clk subsystem.

* tag 'peci-next-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/iwi/linux:
  peci: controller: peci-aspeed: convert from round_rate() to determine_rate()
2025-11-13 17:54:22 -05:00
Rahul Kumar
4f7ffdfb99 firmware: stratix10-rsu: replace scnprintf() with sysfs_emit() in *_show() functions
Replace scnprintf() with sysfs_emit() in sysfs *_show() functions
in stratix10-rsu.c to follow the kernel's guidelines from
Documentation/filesystems/sysfs.rst.

This improves consistency, safety, and makes the code easier to
maintain and update in the future.

Signed-off-by: Rahul Kumar <rk0006818@gmail.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
2025-11-13 06:32:58 -06:00
Mahesh Rao
15847537b6 firmware: stratix10-rsu: Migrate RSU driver to use stratix10 asynchronous framework.
* Add support for asynchronous communication to the RSU client channel.
* Migrate functions that communicate with the SDM to use the asynchronous
  framework.

Signed-off-by: Mahesh Rao <mahesh.rao@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
2025-11-13 06:32:58 -06:00
Mahesh Rao
ec52379341 firmware: stratix10-svc: Add support for RSU commands in asynchronous framework
Integrate Remote System Update(RSU) service commands into the
asynchronous framework for communicating with SDM. This allows the RSU
commands to be processed asynchronously, improving the responsiveness
of the Stratix10 service channel.

The asynchronous framework now supports the following RSU commands:
* COMMAND_RSU_GET_SPT_TABLE
* COMMAND_RSU_STATUS
* COMMAND_RSU_NOTIFY

Signed-off-by: Mahesh Rao <mahesh.rao@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
2025-11-13 06:32:58 -06:00
Mahesh Rao
bcb9f4f070 firmware: stratix10-svc: Add support for async communication
Introduce support for asynchronous communication with the Stratix10
service channel. Define new structures to enable asynchronous messaging
with the Secure Device Manager (SDM). Add and remove asynchronous
support for existing channels. Implement initialization and cleanup
routines for the asynchronous framework. Enable sending and polling of
messages to the SDM asynchronously.

The new public functions added are:
- stratix10_svc_add_async_client: Adds a client to the service channel.
- stratix10_svc_remove_async_client: Removes an asynchronous client from
        the service channel.
- stratix10_svc_async_send: Sends an asynchronous message to the SDM
        mailbox in EL3 secure firmware.
- stratix10_svc_async_poll: Polls the status of an asynchronous service
        request in EL3 secure firmware.
- stratix10_svc_async_done: Marks an asynchronous transaction as
        complete and frees up the resources.

These changes enhance the functionality of the Stratix10 service channel
by allowing for more efficient and flexible communication with the
firmware.

Signed-off-by: Mahesh Rao <mahesh.rao@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
2025-11-13 06:32:58 -06:00
Mahesh Rao
85f96cbbbc firmware: stratix10-svc: Add mutex in stratix10 memory management
Add mutex lock to stratix10_svc_allocate_memory and
stratix10_svc_free_memory for thread safety. This prevents race
conditions and ensures proper synchronization during memory operations.
This is required for parallel communication with the Stratix10 service
channel.

Fixes: 7ca5ce8965 ("firmware: add Intel Stratix10 service layer driver")
Cc: stable@vger.kernel.org
Signed-off-by: Mahesh Rao <mahesh.rao@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
2025-11-13 06:32:58 -06:00
Khairul Anuar Romli
4f49088c16 firmware: stratix10-svc: Add definition for voltage and temperature sensor
Add entry in Stratix 10 Service Layer to support temperature and voltage
sensor.

Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
2025-11-13 06:32:57 -06:00
Leo Yan
9e9182cab5 coresight: etm4x: Remove the state_needs_restore flag
When the restore flow is invoked, it means no error occurred during the
save phase. Otherwise, if any errors happened while saving the context,
the function would return an error and abort the suspend sequence.

Therefore, the state_needs_restore flag is unnecessary. The save and
restore functions are changed to check two conditions:

1) The global flag pm_save_enable is SELF_HOSTED mode;
2) The device is in active mode (non DISABLED).

Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20251111-arm_coresight_power_management_fix-v6-8-f55553b6c8b3@arm.com
2025-11-12 16:53:19 +00:00
Leo Yan
a5e6f584da coresight: etm4x: Remove the redundant DSB
As recommended in section 4.3.7 "Synchronization when using the
memory-mapped interface" of ARM IHI0064H.b:

  When using the memory-mapped interface to program the trace unit, the
  trace analyzer must ensure that writes have completed, to ensure that
  the trace unit is fully programmed and either enabled or disabled.

  To ensure writes have completed, the trace analyzer can do ...

  If the memory marked is as Device-nGnRE or stronger, read back the
  value of any register in the trace unit. This relies on peripheral
  coherence order defined in the Arm architecture.

Polling TRCSTATR ensures the previous write has completed. Therefore,
removes the redundant DSB barrier in the enabling flow.

Update the comment in the disable flow for consistency.

Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20251111-arm_coresight_power_management_fix-v6-7-f55553b6c8b3@arm.com
2025-11-11 21:47:58 +00:00