Commit Graph

4376 Commits

Author SHA1 Message Date
Linus Torvalds
402e262d77 EFI updates for v6.17
- Expose the OVMF firmware debug log via sysfs
 
 - Lower the default log level for the EFI stub to avoid corrupting any
   splash screens with unimportant diagnostic output
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQQm/3uucuRGn1Dmh0wbglWLn0tXAUCaJbnoAAKCRAwbglWLn0t
 XIhuAQDB+qEzM0nBPRVnlztrjKDbxu01jzFgCuf4egFePs4OjwD/dgNCXXudn5JB
 X7VWNi8VQAWBMhijpEKXvDu6f0MXFgw=
 =UeGX
 -----END PGP SIGNATURE-----

Merge tag 'efi-next-for-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI updates from Ard Biesheuvel:

 - Expose the OVMF firmware debug log via sysfs

 - Lower the default log level for the EFI stub to avoid corrupting any
   splash screens with unimportant diagnostic output

* tag 'efi-next-for-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi: add API doc entry for ovmf_debug_log
  efistub: Lower default log level
  efi: add ovmf debug log driver
2025-08-09 18:10:01 +03:00
Linus Torvalds
6fb44438a5 arm64 updates for 6.17:
Perf and PMU updates:
 
  - Add support for new (v3) Hisilicon SLLC and DDRC PMUs
 
  - Add support for Arm-NI PMU integrations that share interrupts between
    clock domains within a given instance
 
  - Allow SPE to be configured with a lower sample period than the
    minimum recommendation advertised by PMSIDR_EL1.Interval
 
  - Add suppport for Arm's "Branch Record Buffer Extension" (BRBE)
 
  - Adjust the perf watchdog period according to cpu frequency changes
 
  - Minor driver fixes and cleanups
 
 Hardware features:
 
  - Support for MTE store-only checking (FEAT_MTE_STORE_ONLY)
 
  - Support for reporting the non-address bits during a synchronous MTE
    tag check fault (FEAT_MTE_TAGGED_FAR)
 
  - Optimise the TLBI when folding/unfolding contiguous PTEs on hardware
    with FEAT_BBM (break-before-make) level 2 and no TLB conflict aborts
 
 Software features:
 
  - Enable HAVE_LIVEPATCH after implementing arch_stack_walk_reliable()
    and using the text-poke API for late module relocations
 
  - Force VMAP_STACK always on and change arm64_efi_rt_init() to use
    arch_alloc_vmap_stack() in order to avoid KASAN false positives
 
 ACPI:
 
  - Improve SPCR handling and messaging on systems lacking an SPCR table
 
 Debug:
 
  - Simplify the debug exception entry path
 
  - Drop redundant DBG_MDSCR_* macros
 
 Kselftests:
 
  - Cleanups and improvements for SME, SVE and FPSIMD tests
 
 Miscellaneous:
 
  - Optimise loop to reduce redundant operations in contpte_ptep_get()
 
  - Remove ISB when resetting POR_EL0 during signal handling
 
  - Mark the kernel as tainted on SEA and SError panic
 
  - Remove redundant gcs_free() call
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAmiDkgoACgkQa9axLQDI
 XvFucQ//bYugRP5/Sdlrq5eDKWBGi1HufYzwfDEBLc4S75Eu8mGL/tuThfu9yFn+
 qCowtt4U84HdWsZDTSVo6lym6v2vJUpGOMgXzepvJaFBRnqGv9X9NxH6RQO1LTnu
 Pm7rO+7I9tNpfuc7Zu9pHDggsJEw+WzVfmEF6WPSFlT9mUNv6NbSx4rbLQKU86Dm
 ouTqXaePEQZ5oiRXVasxyT0otGtiACD20WpgOtNjYGzsfUVwCf/C83V/2DLwwbhr
 9cW9lCtFxA/yFdQcA9ThRzWZ9Eo5LAHqjGIq00+zOjuzgDbBtcTT79gpChkhovIR
 FBIsWHd9j9i3nYxzf4V4eRKQnyqS3NQWv7g7uKFwNgARif1Zk0VJ77QIlAYk5xLI
 ENTRjLKz5WNGGnhdkeCvDlVyxX+OktgcVTp3vqRxAKCRahMMUqBrwxiM8RzVF37e
 yzkEQayL8F7uZqy9H7Sjn48UpHZux6frJ1bBQw1oEvR9QmAoAdqavPMSAYIOT3Zr
 ze4WIljq/cFr3kBPIFP5pK1e0qYMHXZpSKIm8MAv6y/7KmQuVbMjZthpuPbLSIw0
 Q7C0KalB8lToPIbO7qMni/he0dCN4K2+E1YHFTR+pzfcoLuW4rjSg7i8tqMLKMJ8
 H+SeGLyPtM5A6bdAPTTpqefcgUUe7064ENUqrGUpDEynGXA7boE=
 =5h1C
 -----END PGP SIGNATURE-----

Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 updates from Catalin Marinas:
 "A quick summary: perf support for Branch Record Buffer Extensions
  (BRBE), typical PMU hardware updates, small additions to MTE for
  store-only tag checking and exposing non-address bits to signal
  handlers, HAVE_LIVEPATCH enabled on arm64, VMAP_STACK forced on.

  There is also a TLBI optimisation on hardware that does not require
  break-before-make when changing the user PTEs between contiguous and
  non-contiguous.

  More details:

  Perf and PMU updates:

   - Add support for new (v3) Hisilicon SLLC and DDRC PMUs

   - Add support for Arm-NI PMU integrations that share interrupts
     between clock domains within a given instance

   - Allow SPE to be configured with a lower sample period than the
     minimum recommendation advertised by PMSIDR_EL1.Interval

   - Add suppport for Arm's "Branch Record Buffer Extension" (BRBE)

   - Adjust the perf watchdog period according to cpu frequency changes

   - Minor driver fixes and cleanups

  Hardware features:

   - Support for MTE store-only checking (FEAT_MTE_STORE_ONLY)

   - Support for reporting the non-address bits during a synchronous MTE
     tag check fault (FEAT_MTE_TAGGED_FAR)

   - Optimise the TLBI when folding/unfolding contiguous PTEs on
     hardware with FEAT_BBM (break-before-make) level 2 and no TLB
     conflict aborts

  Software features:

   - Enable HAVE_LIVEPATCH after implementing arch_stack_walk_reliable()
     and using the text-poke API for late module relocations

   - Force VMAP_STACK always on and change arm64_efi_rt_init() to use
     arch_alloc_vmap_stack() in order to avoid KASAN false positives

  ACPI:

   - Improve SPCR handling and messaging on systems lacking an SPCR
     table

  Debug:

   - Simplify the debug exception entry path

   - Drop redundant DBG_MDSCR_* macros

  Kselftests:

   - Cleanups and improvements for SME, SVE and FPSIMD tests

  Miscellaneous:

   - Optimise loop to reduce redundant operations in contpte_ptep_get()

   - Remove ISB when resetting POR_EL0 during signal handling

   - Mark the kernel as tainted on SEA and SError panic

   - Remove redundant gcs_free() call"

* tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (93 commits)
  arm64/gcs: task_gcs_el0_enable() should use passed task
  arm64: Kconfig: Keep selects somewhat alphabetically ordered
  arm64: signal: Remove ISB when resetting POR_EL0
  kselftest/arm64: Handle attempts to disable SM on SME only systems
  kselftest/arm64: Fix SVE write data generation for SME only systems
  kselftest/arm64: Test SME on SME only systems in fp-ptrace
  kselftest/arm64: Test FPSIMD format data writes via NT_ARM_SVE in fp-ptrace
  kselftest/arm64: Allow sve-ptrace to run on SME only systems
  arm64/mm: Drop redundant addr increment in set_huge_pte_at()
  kselftest/arm4: Provide local defines for AT_HWCAP3
  arm64: Mark kernel as tainted on SAE and SError panic
  arm64/gcs: Don't call gcs_free() when releasing task_struct
  drivers/perf: hisi: Support PMUs with no interrupt
  drivers/perf: hisi: Relax the event number check of v2 PMUs
  drivers/perf: hisi: Add support for HiSilicon SLLC v3 PMU driver
  drivers/perf: hisi: Use ACPI driver_data to retrieve SLLC PMU information
  drivers/perf: hisi: Add support for HiSilicon DDRC v3 PMU driver
  drivers/perf: hisi: Simplify the probe process for each DDRC version
  perf/arm-ni: Support sharing IRQs within an NI instance
  perf/arm-ni: Consolidate CPU affinity handling
  ...
2025-07-29 20:21:54 -07:00
Linus Torvalds
56d5e32929 x86/boot changes for v6.17:
- Implement support for embedding EFI SBAT data (Secure Boot
    Advanced Targeting: a secure boot image revocation facility)
    on x86. (Vitaly Kuznetsov)
 
  - Move the efi_enter_virtual_mode() initialization call
    from the generic init code to x86 init code.
    (Alexander Shishkin)
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmiIcO4RHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1iduRAAuZbTETuyGa7xtTjR42zDfyarM+04azck
 OL/+k9XFNjlDcDFm9mtGjmyTIrbo8J8e0IVmP7+qAYGh9YzSPzNblVjHfeAwo6Da
 1cndxlybuXL3iNC7aI3HzhneBvoESMKDXHWvHxFsrQAy1CdyX/TAB6dgtciTijgG
 wYZlEXaI74D4yr8LxmlFOQSCAGKSkmgCadJiw+rLIYcTP+dXonMquIpuO2RHRsCM
 Ff3dKU2iM6L3XlYtf/msYZWVhVebGKl5W5JKWa+VO1z7LntdGYQkavkMbRJBI0dv
 WW6g4YvDHcwJvRptZWBeGTKMSCD6mHKTw+sMOAME78YskBotx1bqMpSlW96CBka4
 qqqfVeTn7vi377Na7Ud5nBQ1riP2zPYlNEgSsWmW3XfBOs4ps01gdBorypWm3Co8
 9FC/IFfdoJ9c6Gp/pQzf+8CRGKW64Gp4/wdm1OIMt2HPj15fQtRFrcqjP7/STKKJ
 OjkZC8MmLHZYxW8okrV8oSCl5A19wCxeHK9Gk5vsyoJ4Ed4+TH25wZef2EdJrQ8y
 t1R7LUNxqc3dfRQsaV84ME/c+fte9T1DtX3u1AYSyGNQFFAmxYHPCF+Yls1kwfzu
 kvY+D495Jwimx3RVELbCc/8R7zzhdLMRUEu94tGqE2Aq/5V1kq66aJRszsG8OtMr
 B6oCSStDE48=
 =8/CV
 -----END PGP SIGNATURE-----

Merge tag 'x86-boot-2025-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 boot updates from Ingo Molnar:

 - Implement support for embedding EFI SBAT data (Secure Boot Advanced
   Targeting: a secure boot image revocation facility) on x86 (Vitaly
   Kuznetsov)

 - Move the efi_enter_virtual_mode() initialization call from the
   generic init code to x86 init code (Alexander Shishkin)

* tag 'x86-boot-2025-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/efi: Implement support for embedding SBAT data for x86
  x86/efi: Move runtime service initialization to arch/x86
2025-07-29 18:58:22 -07:00
Linus Torvalds
22c5696e3f Driver core changes for 6.17-rc1
- DEBUGFS
 
   - Remove unneeded debugfs_file_{get,put}() instances
 
   - Remove last remnants of debugfs_real_fops()
 
   - Allow storing non-const void * in struct debugfs_inode_info::aux
 
 - SYSFS
 
   - Switch back to attribute_group::bin_attrs (treewide)
 
   - Switch back to bin_attribute::read()/write() (treewide)
 
   - Constify internal references to 'struct bin_attribute'
 
 - Support cache-ids for device-tree systems
 
   - Add arch hook arch_compact_of_hwid()
 
   - Use arch_compact_of_hwid() to compact MPIDR values on arm64
 
 - Rust
 
   - Device
 
     - Introduce CoreInternal device context (for bus internal methods)
 
     - Provide generic drvdata accessors for bus devices
 
     - Provide Driver::unbind() callbacks
 
     - Use the infrastructure above for auxiliary, PCI and platform
 
     - Implement Device::as_bound()
 
     - Rename Device::as_ref() to Device::from_raw() (treewide)
 
     - Implement fwnode and device property abstractions
 
       - Implement example usage in the Rust platform sample driver
 
   - Devres
 
     - Remove the inner reference count (Arc) and use pin-init instead
 
     - Replace Devres::new_foreign_owned() with devres::register()
 
     - Require T to be Send in Devres<T>
 
     - Initialize the data kept inside a Devres last
 
     - Provide an accessor for the Devres associated Device
 
   - Device ID
 
     - Add support for ACPI device IDs and driver match tables
 
     - Split up generic device ID infrastructure
 
     - Use generic device ID infrastructure in net::phy
 
   - DMA
 
     - Implement the dma::Device trait
 
     - Add DMA mask accessors to dma::Device
 
     - Implement dma::Device for PCI and platform devices
 
     - Use DMA masks from the DMA sample module
 
   - I/O
 
     - Implement abstraction for resource regions (struct resource)
 
     - Implement resource-based ioremap() abstractions
 
     - Provide platform device accessors for I/O (remap) requests
 
   - Misc
 
     - Support fallible PinInit types in Revocable
 
     - Implement Wrapper<T> for Opaque<T>
 
     - Merge pin-init blanket dependencies (for Devres)
 
 - Misc
 
   - Fix OF node leak in auxiliary_device_create()
 
   - Use util macros in device property iterators
 
   - Improve kobject sample code
 
   - Add device_link_test() for testing device link flags
 
   - Fix typo in Documentation/ABI/testing/sysfs-kernel-address_bits
 
   - Hint to prefer container_of_const() over container_of()
 -----BEGIN PGP SIGNATURE-----
 
 iHQEABYKAB0WIQS2q/xV6QjXAdC7k+1FlHeO1qrKLgUCaIjkhwAKCRBFlHeO1qrK
 LpXuAP9RWwfD9ZGgQZ9OsMk/0pZ2mDclaK97jcmI9TAeSxeZMgD1FHnOMTY7oSIi
 iG7Muq0yLD+A5gk9HUnMUnFNrngWCg==
 =jgRj
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core

Pull driver core updates from Danilo Krummrich:
 "debugfs:
   - Remove unneeded debugfs_file_{get,put}() instances
   - Remove last remnants of debugfs_real_fops()
   - Allow storing non-const void * in struct debugfs_inode_info::aux

  sysfs:
   - Switch back to attribute_group::bin_attrs (treewide)
   - Switch back to bin_attribute::read()/write() (treewide)
   - Constify internal references to 'struct bin_attribute'

  Support cache-ids for device-tree systems:
   - Add arch hook arch_compact_of_hwid()
   - Use arch_compact_of_hwid() to compact MPIDR values on arm64

  Rust:
   - Device:
       - Introduce CoreInternal device context (for bus internal methods)
       - Provide generic drvdata accessors for bus devices
       - Provide Driver::unbind() callbacks
       - Use the infrastructure above for auxiliary, PCI and platform
       - Implement Device::as_bound()
       - Rename Device::as_ref() to Device::from_raw() (treewide)
       - Implement fwnode and device property abstractions
       - Implement example usage in the Rust platform sample driver
   - Devres:
       - Remove the inner reference count (Arc) and use pin-init instead
       - Replace Devres::new_foreign_owned() with devres::register()
       - Require T to be Send in Devres<T>
       - Initialize the data kept inside a Devres last
       - Provide an accessor for the Devres associated Device
   - Device ID:
       - Add support for ACPI device IDs and driver match tables
       - Split up generic device ID infrastructure
       - Use generic device ID infrastructure in net::phy
   - DMA:
       - Implement the dma::Device trait
       - Add DMA mask accessors to dma::Device
       - Implement dma::Device for PCI and platform devices
       - Use DMA masks from the DMA sample module
   - I/O:
       - Implement abstraction for resource regions (struct resource)
       - Implement resource-based ioremap() abstractions
       - Provide platform device accessors for I/O (remap) requests
   - Misc:
       - Support fallible PinInit types in Revocable
       - Implement Wrapper<T> for Opaque<T>
       - Merge pin-init blanket dependencies (for Devres)

  Misc:
   - Fix OF node leak in auxiliary_device_create()
   - Use util macros in device property iterators
   - Improve kobject sample code
   - Add device_link_test() for testing device link flags
   - Fix typo in Documentation/ABI/testing/sysfs-kernel-address_bits
   - Hint to prefer container_of_const() over container_of()"

* tag 'driver-core-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: (84 commits)
  rust: io: fix broken intra-doc links to `platform::Device`
  rust: io: fix broken intra-doc link to missing `flags` module
  rust: io: mem: enable IoRequest doc-tests
  rust: platform: add resource accessors
  rust: io: mem: add a generic iomem abstraction
  rust: io: add resource abstraction
  rust: samples: dma: set DMA mask
  rust: platform: implement the `dma::Device` trait
  rust: pci: implement the `dma::Device` trait
  rust: dma: add DMA addressing capabilities
  rust: dma: implement `dma::Device` trait
  rust: net::phy Change module_phy_driver macro to use module_device_table macro
  rust: net::phy represent DeviceId as transparent wrapper over mdio_device_id
  rust: device_id: split out index support into a separate trait
  device: rust: rename Device::as_ref() to Device::from_raw()
  arm64: cacheinfo: Provide helper to compress MPIDR value into u32
  cacheinfo: Add arch hook to compress CPU h/w id into 32 bits for cache-id
  cacheinfo: Set cache 'id' based on DT data
  container_of: Document container_of() is not to be used in new code
  driver core: auxiliary bus: fix OF node leak
  ...
2025-07-29 12:15:39 -07:00
Linus Torvalds
fc8f5028eb pmdomain core:
- Leave powered-on genpds on until ->sync_state() or late_initcall_sync
  - Export a common ->sync_state() helper for genpd providers
  - Add generic ->sync_state() support
  - Add a bus/driver for genpd provider-devices
  - Introduce dev_pm_genpd_is_on() for consumers
 
 pmdomain providers:
  - cpuidle-psci: Drop redundant ->sync_state() support
  - cpuidle-riscv-sbi: Drop redundant ->sync_state() support
  - imx: Set ISI panic write for imx8m-blk-ctrl
  - qcom: Add support for Glymur and Milos RPMh power-domains
  - qcom: Use of_genpd_sync_state() for power-domains
  - rockchip: Add support for the RK3528 variant
  - samsung: Fix splash-screen handover by enforcing a ->sync_state()
  - sunxi: Add support for Allwinner A523's PCK600 power-controller
  - tegra: Opt-out from genpd's common ->sync_state() support for pmc
  - thead: Instantiate a GPU power sequencer via the auxiliary bus
  - renesas: Move init to postcore_initcalls
  - xilinx: Move ->sync_state() support to firmware driver
  - xilinx: Use of_genpd_sync_state() for power-domains
 
 pmdomain consumers:
  - remoteproc: imx_rproc: Fixup the detect/attach procedure for pre-booted cores
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmiIqskXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjClOLBAAxsd5QP7QyeCePR4hADGePY4d
 Ab4fX01EVsu+g5cjg7L1V8gZMbNC/O+bxVhF5s1CiDbXbEcDliuW9yKCTFq4Yqx+
 7PtR+U538FADJGbbETzp8AFbcD8hmd/Wt/o7JyqC2wmmRwlgDEKPTR+M7FirrU3J
 fLsE+wyJSxn8ywJ1XwQOxBOZUtq11a8UueMXb8L1DhilyjT88zqCNiMvkcLtBlh+
 tRT5TWBEGr7qPCDAW6w3RL/8Y22g8xIjJxcDI8LycI/ed7qB5gtIs3ORiTl2w4qE
 k78wp2Ltv1Q2AmrYiLoaciFMTXckeBycVhobf0c4zVn2HGS15Fip0YNhPQmOz3aI
 JY+h5aUTMTUICVTG1D9uTW9gEbzqJOnqwU75R6zyV6xUk9pS4pGHaxaqKasNdDPy
 zIVgaURMZZxq37x7TNmnQZSZ3pAisFTm8Rv4oDTOJshblhuzG0TsXTlgMuy+EONB
 qh0obkHZFETrucGwaGBFVenzpnwZiEZ3EAKMGDcjBAO54waWdo+SmmJCc0KCQLih
 UheFi4v0IAUm8KqzwM4CKGg5NhGo2E1FcG8YbX6t2phycQLfVHDSw3rXHJRfXOzu
 s6njs7DhPKvUdlQxm1Fjq+eeMw2wsUFj8x1+usQYiD3UfuC26GU3cPsrU99+pcak
 eTcWfSnpDiXpVE3pEOk=
 =9SL+
 -----END PGP SIGNATURE-----

Merge tag 'pmdomain-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain updates from Ulf Hansson:
 "pmdomain core:
   - Leave powered-on genpds on until ->sync_state() or late_initcall_sync
   - Export a common ->sync_state() helper for genpd providers
   - Add generic ->sync_state() support
   - Add a bus/driver for genpd provider-devices
   - Introduce dev_pm_genpd_is_on() for consumers

  pmdomain providers:
   - cpuidle-psci: Drop redundant ->sync_state() support
   - cpuidle-riscv-sbi: Drop redundant ->sync_state() support
   - imx: Set ISI panic write for imx8m-blk-ctrl
   - qcom: Add support for Glymur and Milos RPMh power-domains
   - qcom: Use of_genpd_sync_state() for power-domains
   - rockchip: Add support for the RK3528 variant
   - samsung: Fix splash-screen handover by enforcing a ->sync_state()
   - sunxi: Add support for Allwinner A523's PCK600 power-controller
   - tegra: Opt-out from genpd's common ->sync_state() support for pmc
   - thead: Instantiate a GPU power sequencer via the auxiliary bus
   - renesas: Move init to postcore_initcalls
   - xilinx: Move ->sync_state() support to firmware driver
   - xilinx: Use of_genpd_sync_state() for power-domains

  pmdomain consumers:
   - remoteproc: imx_rproc: Fixup the detect/attach procedure for
     pre-booted cores"

* tag 'pmdomain-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: (44 commits)
  pmdomain: qcom: rpmhpd: Add Glymur RPMh Power Domains
  dt-bindings: power: rpmpd: Add Glymur power domains
  remoteproc: imx_rproc: detect and attach to pre-booted remote cores
  remoteproc: imx_rproc: skip clock enable when M-core is managed by the SCU
  pmdomain: core: introduce dev_pm_genpd_is_on()
  pmdomain: ti: Select PM_GENERIC_DOMAINS
  pmdomain: sunxi: sun20i-ppu: change to tristate and enable for ARCH_SUNXI
  pmdomain: sunxi: add driver for Allwinner A523's PCK-600 power controller
  pmdomain: sunxi: sun20i-ppu: add A523 support
  pmdomain: samsung: Fix splash-screen handover by enforcing a sync_state
  cpuidle: riscv-sbi: Drop redundant sync_state support
  cpuidle: psci: Drop redundant sync_state support
  pmdomain: core: Leave powered-on genpds on until sync_state
  pmdomain: core: Leave powered-on genpds on until late_initcall_sync
  pmdomain: core: Default to use of_genpd_sync_state() for genpd providers
  driver core: Add dev_set_drv_sync_state()
  pmdomain: core: Add common ->sync_state() support for genpd providers
  driver core: Export get_dev_from_fwnode()
  firmware: xilinx: Use of_genpd_sync_state()
  firmware: xilinx: Don't share zynqmp_pm_init_finalize()
  ...
2025-07-29 11:42:31 -07:00
Linus Torvalds
0f46f50845 soc: driver updates for 6.17
Changes are all over the place, but very little sticks out as
 noteworthy.
 
 There is a new misc driver for the Raspberry Pi 5's RP1 multifunction
 I/O chip, along with hooking it up to the pinctrl and clk frameworks.
 
 The reset controller and memory subsystems have mainly small updates,
 but there are two new reset drivers for the K230 and VC1800B SoCs,
 and new memory driver support for Tegra264.
 
 The ARM SMCCC and SCMI firmware drivers gain a few more features that
 should help them be supported across more environments. Similarly,
 the SoC specific firmware on Tegra and Qualcomm get minor enhancements
 and chip support.
 
 In the drivers/soc/ directory, the ASPEED LPC snoop driver gets an
 overhaul for code robustness, the Tegra and Qualcomm and NXP drivers
 grow to support more chips, while the Hisilicon, Mediatek and Renesas
 drivers see mostly janitorial fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmiEmIcACgkQmmx57+YA
 GNkE4g/6A2OKti+qtIsLt10zS7paGP38ftu9ad27WC54AOGgVk4ZXt8mVGRmqOf+
 BICIM+wc4gehdvRJTRnq3gZg3e1puuYdcMuBOh4qsghRMjdYUKfNairtn/iX7d+f
 e5auzz5/gV7MWNM7jiQNydCqZSeV6u2/cqD5iRCrRgaB5FOG4yY1BkAsah1UzZjk
 MycudqjkK4IX5zp5oqXB/PoesULAbB2unjvfw194LATYSqmcRLQRWFdv4aM0R6ba
 TDP5x0d95nhMTNWif3495zc2WxdSYzbD4lNv44RPpKDywqBj+qFBI/EpMFkxQ5Hy
 cqv60Dm+/tx+DBO/Ma0zJzsV4ChRIEBNkTUh36OxmYxq70x1T4FEynZ6IT8a8dXD
 ltjHwOcTHp1M0OpNj+PIFBD+ohWFWKOo+T9GRtTInLjUGBlJA6LK9i4Lb0DaIyRt
 DmmvbZCwh0PI/nZiyQzw7rsXWwqDcqeF8FScw+9ooBk7Z7Jr1gMc52ya0qrRWQ8w
 Tr3D+lNE0aDfErnx4RrNsjD8lpX4nOfRFvuWSTlWqkBjGhoDP/tnNi2RCWmbXo2Z
 PDDWLnECo6o1aIxYO/tHjbFKVJB38p4e/LLP89htu8dFxSZKnVzxosnOvEVWS8+Y
 a0oZb9j1tAOYHmMWDm+zaQ7BlK9CMURNTdUcnqNqIvZpHnHz9M8=
 =7T40
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC driver updates from Arnd Bergmann:
 "Changes are all over the place, but very little sticks out as
  noteworthy.

  There is a new misc driver for the Raspberry Pi 5's RP1 multifunction
  I/O chip, along with hooking it up to the pinctrl and clk frameworks.

  The reset controller and memory subsystems have mainly small updates,
  but there are two new reset drivers for the K230 and VC1800B SoCs, and
  new memory driver support for Tegra264.

  The ARM SMCCC and SCMI firmware drivers gain a few more features that
  should help them be supported across more environments. Similarly, the
  SoC specific firmware on Tegra and Qualcomm get minor enhancements and
  chip support.

  In the drivers/soc/ directory, the ASPEED LPC snoop driver gets an
  overhaul for code robustness, the Tegra and Qualcomm and NXP drivers
  grow to support more chips, while the Hisilicon, Mediatek and Renesas
  drivers see mostly janitorial fixes"

* tag 'soc-drivers-6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (100 commits)
  bus: del unnecessary init var
  soc: fsl: qe: convert set_multiple() to returning an integer
  pinctrl: rp1: use new GPIO line value setter callbacks
  soc: hisilicon: kunpeng_hccs: Fix incorrect log information
  dt-bindings: soc: qcom: qcom,pmic-glink: document Milos compatible
  dt-bindings: soc: qcom,aoss-qmp: document the Milos Always-On Subsystem side channel
  dt-bindings: firmware: qcom,scm: document Milos SCM Firmware Interface
  soc: qcom: socinfo: Add support to retrieve APPSBL build details
  soc: qcom: pmic_glink: fix OF node leak
  soc: qcom: spmi-pmic: add more PMIC SUBTYPE IDs
  soc: qcom: socinfo: Add PM7550 & PMIV0108 PMICs
  soc: qcom: socinfo: Add SoC IDs for SM7635 family
  dt-bindings: arm: qcom,ids: Add SoC IDs for SM7635 family
  firmware: qcom: scm: request the waitqueue irq *after* initializing SCM
  firmware: qcom: scm: initialize tzmem before marking SCM as available
  firmware: qcom: scm: take struct device as argument in SHM bridge enable
  firmware: qcom: scm: remove unused arguments from SHM bridge routines
  soc: qcom: rpmh-rsc: Add RSC version 4 support
  memory: tegra: Add Tegra264 MC and EMC support
  firmware: tegra: bpmp: Fix build failure for tegra264-only config
  ...
2025-07-29 11:13:27 -07:00
Linus Torvalds
177bf8620c sound updates for 6.17-rc1
This includes lots of file shuffling due to HD-audio code
 reorganization and many trivial changes, but otherwise there shouldn't
 be much surprise from the functionality POV.  The PR includes the PM
 changes as prerequisite, too.  Some highlights below:
 
 Core:
 - Performance optimizations in PCM core code
 - Refactoring of ASoC Kconfig menus to be hopefully more consistant
   and easier to navigate.
 - Refactoring of ASoC DAPM code, mainly hiding functionality that
   doesn't need to be exposed to drivers
 
 HD-audio reorganization:
 - All code are moved under sound/hda with a bit more understandable
   tree structure, as well as file renames
 - The huge Realtek driver code is split to several parts, a common
   helper module with driver modules per probe entry
 - HDMI and Cirrus codec drivers also split
 
 ASoC:
 - Further work on the generic handling for SoundWire SDCA devices
 - Support for AMD ACP7.2 and SoundWire on ACP 7.1, Fairphone 4 & 5,
   various Intel systems, Qualcomm QCS8275, Richtek RTQ9124 and TI
   TAS5753
 
 HD-audio and USB-audio:
 - TAS2781 driver cleanup and TAS2770 support
 - EQ enablement in CA0132 driver
 - USB audio quirk code cleanups
 
 Others:
 - Cleanups of PM autosuspend call patterns with the update from the PM
   tree
 - Lots of strcpy() -> strscpy() conversions for fixed size arrays
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmiDUeAOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8lWRAAmJtKS6FtI9AuiXqcZBtngw1W19gZdWNhxoIo
 nYB4YwSVl8glbji/BnVplO2hI1MD+BXWad46+Og2DROzNr6E4HS0eEbNut8UzfbU
 mhFsw2BQ3B4sRK2qyqimuQiJYcdVflk2ixj6VVBqu3fPwWPXQ3dOkZgwo4bUubuT
 I2Rh/yGrFoAJSviUU8TZGX7Qqv4euhiMmvtFREDHh3PsH5LREy8BcimuACA+qlt1
 LvEjW9lMAHOcjq7Kh5N1BD7vRH190KOYh0qgtwswy3oCUI1qLlk3SlSGX9V/I5W7
 zQbClitA595SwdUh39b2nf6wp/hgFu3jx05yOA6it4cxmcM3ejfKMHp1ASyZxupl
 d9tJK0GTztDT4tANmWzIrar3A/zHw1dOW5HWbbU77U7onxILRbdvmO4wP+iZSlL4
 NSQcoyhmMvDe9ti2JQ6BNdjekeaH1Tq+bvMK8G04kqhl1x5GM8IYDIMU7Bw29Hw8
 PFaY67wJTI6muQD/7iIEFKglYDkuROFSaXRJbaMEgWyKvgjmU1RzJCOShzymAfNV
 EZBvfLC1ennZfTdOmZ/4nFUioKRWwDelO1c3Ab6gjwn4I7e5Th9GZqSrP3Vh8zcu
 Dz/ayOIxmmnlDxufSZHvoPNkzCPeV0IDpmSnqy6aDZ4bpnA6yp9+a7zArROVLWqI
 +zz8tIM=
 =Wr97
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "This includes lots of file shuffling due to HD-audio code
  reorganization and many trivial changes, but otherwise there shouldn't
  be much surprise from the functionality POV. The PR includes the PM
  changes as prerequisite, too. Some highlights below:

  Core:
   - Performance optimizations in PCM core code
   - Refactoring of ASoC Kconfig menus to be hopefully more consistant
     and easier to navigate.
   - Refactoring of ASoC DAPM code, mainly hiding functionality that
     doesn't need to be exposed to drivers

  HD-audio reorganization:
   - All code are moved under sound/hda with a bit more understandable
     tree structure, as well as file renames
   - The huge Realtek driver code is split to several parts, a common
     helper module with driver modules per probe entry
   - HDMI and Cirrus codec drivers also split

  ASoC:
   - Further work on the generic handling for SoundWire SDCA devices
   - Support for AMD ACP7.2 and SoundWire on ACP 7.1, Fairphone 4 & 5,
     various Intel systems, Qualcomm QCS8275, Richtek RTQ9124 and TI
     TAS5753

  HD-audio and USB-audio:
   - TAS2781 driver cleanup and TAS2770 support
   - EQ enablement in CA0132 driver
   - USB audio quirk code cleanups

  Others:
   - Cleanups of PM autosuspend call patterns with the update from the
     PM tree
   - Lots of strcpy() -> strscpy() conversions for fixed size arrays"

* tag 'sound-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (385 commits)
  ALSA: hda: Add TAS2770 support
  ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible
  ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card
  ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode
  ASoC: SDCA: Fix implicit cast from le16
  ASoC: SDCA: Shrink detected_mode_handler() stack frame
  ASoC: SDCA: Check devm_mutex_init() return value
  ASoC: SDCA: add route by the number of input pins in MU entity
  ALSA: hda/realtek: Add support for ASUS Commercial laptops using CS35L41 HDA
  ASoC: Intel: sof_rt5682: Add HDMI-In capture with rt5682 support for PTL.
  ASoC: codec: tlv320aic32x4: Fix reset GPIO check
  ASoC: dt-bindings: qcom,lpass-va-macro: Define clock-names in top-level
  ASoC: SDCA: Add hw_params() helper function
  ASoC: SDCA: Add a helper to get the SoundWire port number
  ASoC: SDCA: Add helper to add DAI constraints
  ASoC: soc-dai: Add private data to snd_soc_dai
  ASoC: SDCA: Move SDCA search functions and export
  ASoC: SDCA: Remove overly chatty input pin list warning
  ASoC: SDCA: Allow read-only controls to be deferrable
  ASoC: SDCA: Update memory allocations to zero initialise
  ...
2025-07-28 21:49:49 -07:00
Linus Torvalds
4d40b59d8b Hi,
This PR has quite a few commits but nothing really that would be worth of
 spending too much time for, or would want to emphasize in particular.
 
 BR, Jarkko
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRE6pSOnaBC00OEHEIaerohdGur0gUCaIAmHQAKCRAaerohdGur
 0pBVAP94mutr2EyDyvJWpzej0fWROHzL1EkJacuKxmabt7HnJgEA9H8Ug6OoAdKq
 V1v+Z9iL1wrQ3Yfp28vHhdrAQUgDJgA=
 =cjP7
 -----END PGP SIGNATURE-----

Merge tag 'tpmdd-next-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd

Pull tpm updates from Jarkko Sakkinen:
 "Quite a few commits but nothing really that would be worth of spending
  too much time for, or would want to emphasize in particular"

* tag 'tpmdd-next-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
  tpm_crb_ffa: handle tpm busy return code
  tpm_crb_ffa: Remove memset usage
  tpm_crb_ffa: Fix typos in function name
  tpm: Check for completion after timeout
  tpm: Use of_reserved_mem_region_to_resource() for "memory-region"
  tpm: Replace scnprintf() with sysfs_emit() and sysfs_emit_at() in sysfs show functions
  tpm_crb_ffa: Remove unused export
  tpm: tpm_crb_ffa: try to probe tpm_crb_ffa when it's built-in
  firmware: arm_ffa: Change initcall level of ffa_init() to rootfs_initcall
  tpm/tpm_svsm: support TPM_CHIP_FLAG_SYNC
  tpm/tpm_ftpm_tee: support TPM_CHIP_FLAG_SYNC
  tpm: support devices with synchronous send()
  tpm: add bufsiz parameter in the .send callback
2025-07-28 18:18:16 -07:00
Linus Torvalds
8e736a2eea hardening updates for v6.17-rc1
- Introduce and start using TRAILING_OVERLAP() helper for fixing
   embedded flex array instances (Gustavo A. R. Silva)
 
 - mux: Convert mux_control_ops to a flex array member in mux_chip
   (Thorsten Blum)
 
 - string: Group str_has_prefix() and strstarts() (Andy Shevchenko)
 
 - Remove KCOV instrumentation from __init and __head (Ritesh Harjani,
   Kees Cook)
 
 - Refactor and rename stackleak feature to support Clang
 
 - Add KUnit test for seq_buf API
 
 - Fix KUnit fortify test under LTO
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRSPkdeREjth1dHnSE2KwveOeQkuwUCaIfUkgAKCRA2KwveOeQk
 uypLAP92r6f47sWcOw/5B9aVffX6Bypsb7dqBJQpCNxI5U1xcAEAiCrZ98UJyOeQ
 JQgnXd4N67K4EsS2JDc+FutRn3Yi+A8=
 =+5Bq
 -----END PGP SIGNATURE-----

Merge tag 'hardening-v6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull hardening updates from Kees Cook:

 - Introduce and start using TRAILING_OVERLAP() helper for fixing
   embedded flex array instances (Gustavo A. R. Silva)

 - mux: Convert mux_control_ops to a flex array member in mux_chip
   (Thorsten Blum)

 - string: Group str_has_prefix() and strstarts() (Andy Shevchenko)

 - Remove KCOV instrumentation from __init and __head (Ritesh Harjani,
   Kees Cook)

 - Refactor and rename stackleak feature to support Clang

 - Add KUnit test for seq_buf API

 - Fix KUnit fortify test under LTO

* tag 'hardening-v6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (22 commits)
  sched/task_stack: Add missing const qualifier to end_of_stack()
  kstack_erase: Support Clang stack depth tracking
  kstack_erase: Add -mgeneral-regs-only to silence Clang warnings
  init.h: Disable sanitizer coverage for __init and __head
  kstack_erase: Disable kstack_erase for all of arm compressed boot code
  x86: Handle KCOV __init vs inline mismatches
  arm64: Handle KCOV __init vs inline mismatches
  s390: Handle KCOV __init vs inline mismatches
  arm: Handle KCOV __init vs inline mismatches
  mips: Handle KCOV __init vs inline mismatch
  powerpc/mm/book3s64: Move kfence and debug_pagealloc related calls to __init section
  configs/hardening: Enable CONFIG_INIT_ON_FREE_DEFAULT_ON
  configs/hardening: Enable CONFIG_KSTACK_ERASE
  stackleak: Split KSTACK_ERASE_CFLAGS from GCC_PLUGINS_CFLAGS
  stackleak: Rename stackleak_track_stack to __sanitizer_cov_stack_depth
  stackleak: Rename STACKLEAK to KSTACK_ERASE
  seq_buf: Introduce KUnit tests
  string: Group str_has_prefix() and strstarts()
  kunit/fortify: Add back "volatile" for sizeof() constants
  acpi: nfit: intel: avoid multiple -Wflex-array-member-not-at-end warnings
  ...
2025-07-28 17:16:12 -07:00
Arnd Bergmann
edf0a4053a More Qualcomm driver updates for v6.17
Fix race condition during SCM driver initialization, in relation to
 tzmem and waitqueue irq handling,
 
 Make the rpmh RSC driver support version 4 of the IP block.
 
 Add SM7635 family and related PMICs to the socinfo driver. Also add
 support for retrieving the bootloader build details.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmh8XVIVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FBVoP/2YB9iOewIydLQkUfyGTXPy/T3YY
 Pa01KMuNFfWyExHG+df05KR5p/1kpQeShnH9xQvwTa8jtxle1Ow+nZIhi+SrTYo2
 9qn0maH6BXaZTwVWX/CwFRbu/ei1B+EebFSHcfN9Cz23hSM+Yqsngu4a5heZGQnn
 VXTa3wMC383MZghZSBFVFMi4owSp/LOp9lyz02+cNJVX5IYM+lx30o1d0I/xEPDx
 ElU3oIMDqMwPopv6HSUFHVVjJBrx7crSUxaEhsl6N7tyXPBfdZiXTk+4uJKy9y/C
 pYu8iAQfYX1pNUqTxQxY5w79VNS/kBxE8d7+UPjN2BQfft5KTAywx1r/rxG5YtPJ
 HBA8XbkmH+IG35saCTvtbjLMSeRwnLyoZ4is9V8vHN4e0hzk9fCKg8qeojrODI5v
 A9XkkLs3HVUJoHwBH/CAvFyvJfkk4LbStKlTrepPkPMOBzR/0ZXXnCVaJzYhgrfO
 ZdL8HdDQZVKKd3GkcESwZxI0qxuPohtbAagBDZqanKDPQCwWW+JW270RMi0dNRg0
 Chts0cVgNSkWmRH/v5xLc1hjTcN9w4b4g8JVdKwrSeLuAIcrH+2yGvjhsqE4wqCr
 xyvmKpPO2ngzuoY9L2cCEB842JhmJ2C909BiuhPvwrdC5BTQzpBFiCK1qhwDvOQ8
 PweSfQSxAUE9VHJY
 =tp6K
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmiD/PoACgkQmmx57+YA
 GNmsIA/+O403SHj1P/nmTAubn18vJ4Y0IJfSBtjvW5icGvE4Ei3PkGS1Fq3JSpLw
 SicjAUDeiKtoC2d1ZbrfiGIH2ixeBqhT205fOADVJrMFZ+iNffH6fQ80ApxRd4Br
 i+HkDbn4m8QX3iwLE030YvpsWWSreKZQk8XFQJHLSkjcglL69dxaAWOmb11o2FEd
 qGhkR6fU+kcZDSLavdSS9EzIseNgUoS4d6JXDi4q5diOk3VdtynwxGsVSzzSC2v3
 Ed0GNlmD5M1z6pSdnlRmcay0Vj3iA7OnSn2sZKFBKB9af+zDxoyUk6GFFtWsyntM
 bZX679BVeW8VpcypF5EIoBNV7tFmi2t3X7bElOlz46ydvcmyh5CEq5+mN8CGSO8V
 A9cgqrg6FZMvfKjYPIaN6aX//+d7HHyM1xKuAOu7CiFq7yt+bmZBnEfGWOrMWp1R
 1vDE7MulhumbWKGbi/ICj1ZNG9P9tOq5If9chXynIxv9hUlPa0a+USTL0AyyOGah
 bs6eU0tZChsKhiU9sZfvDEgIgo+TVBtQBIFSMxyfdYUz4Aaf4FM8udf9YBXGj5Xx
 0vyNAFk+X+MykAL53WJ41JAmRgp5GitiAFwYUEvRF7mI8WB39WUbAE4nMstqpL9B
 E24hYg4p3vnaP5VoQ7idOZVWEfHIXJLq7qt4Y3D6wLHX66NmZic=
 =3kNF
 -----END PGP SIGNATURE-----

Merge tag 'qcom-drivers-for-6.17-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers

More Qualcomm driver updates for v6.17

Fix race condition during SCM driver initialization, in relation to
tzmem and waitqueue irq handling,

Make the rpmh RSC driver support version 4 of the IP block.

Add SM7635 family and related PMICs to the socinfo driver. Also add
support for retrieving the bootloader build details.

* tag 'qcom-drivers-for-6.17-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  dt-bindings: soc: qcom: qcom,pmic-glink: document Milos compatible
  dt-bindings: soc: qcom,aoss-qmp: document the Milos Always-On Subsystem side channel
  dt-bindings: firmware: qcom,scm: document Milos SCM Firmware Interface
  soc: qcom: socinfo: Add support to retrieve APPSBL build details
  soc: qcom: pmic_glink: fix OF node leak
  soc: qcom: spmi-pmic: add more PMIC SUBTYPE IDs
  soc: qcom: socinfo: Add PM7550 & PMIV0108 PMICs
  soc: qcom: socinfo: Add SoC IDs for SM7635 family
  dt-bindings: arm: qcom,ids: Add SoC IDs for SM7635 family
  firmware: qcom: scm: request the waitqueue irq *after* initializing SCM
  firmware: qcom: scm: initialize tzmem before marking SCM as available
  firmware: qcom: scm: take struct device as argument in SHM bridge enable
  firmware: qcom: scm: remove unused arguments from SHM bridge routines
  soc: qcom: rpmh-rsc: Add RSC version 4 support

Link: https://lore.kernel.org/r/20250720030743.285440-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-07-25 23:54:01 +02:00
Yeoreum Yun
0e0546eabc firmware: arm_ffa: Change initcall level of ffa_init() to rootfs_initcall
The Linux IMA (Integrity Measurement Architecture) subsystem used for
secure boot, file integrity, or remote attestation cannot be a loadable
module for few reasons listed below:

 o Boot-Time Integrity: IMA’s main role is to measure and appraise files
 before they are used. This includes measuring critical system files during
 early boot (e.g., init, init scripts, login binaries). If IMA were a
 module, it would be loaded too late to cover those.

 o TPM Dependency: IMA integrates tightly with the TPM to record
 measurements into PCRs. The TPM must be initialized early (ideally before
 init_ima()), which aligns with IMA being built-in.

 o Security Model: IMA is part of a Trusted Computing Base (TCB). Making it
 a module would weaken the security model, as a potentially compromised
 system could delay or tamper with its initialization.

IMA must be built-in to ensure it starts measuring from the earliest
possible point in boot which inturn implies TPM must be initialised and
ready to use before IMA.

To enable integration of tpm_event_log with the IMA subsystem, the TPM
drivers (tpm_crb and tpm_crb_ffa) also needs to be built-in. However with
FF-A driver also being initialised at device initcall level, it can lead to
an initialization order issue where:
 - crb_acpi_driver_init() may run before tpm_crb_ffa_driver()_init and
   ffa_init()
 - As a result, probing the TPM device via CRB over FFA is deferred
 - ima_init() (called as a late initcall) runs before deferred probe
   completes, IMA fails to find the TPM and logs the below error:

   |  ima: No TPM chip found, activating TPM-bypass!

Eventually it fails to generate boot_aggregate with PCR values.

Because of the above stated dependency, the ffa driver needs to initialised
before tpm_crb_ffa module to ensure IMA finds the TPM successfully when
present.

[ jarkko: reformatted some of the paragraphs because they were going past
  the 75 character boundary. ]

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2025-07-23 02:23:18 +03:00
Arnd Bergmann
27d0ff5a60 firmware: tegra: Updates for v6.17-rc1
Add Tegra264 support for the BPMP, fix some dependency issues and clean
 up some code using new OF helpers.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmhxiPMACgkQ3SOs138+
 s6E/7BAAuYCphrnsKIwDydV4ipgZ+kZ0oHk7uJ2pFLg6BIjdqtKZhEyXk9Wbg3Ko
 6HRofsiT8WPvtWxZ8adreB1nvgNt/Ak50jQgLjEVGTyqHpUoQgGUudz5umTK0pnT
 SoHH0VgSk0xToShcdYaMIG2XM7O2e77ohMQnVC2jrY7nnDCO8i7NgPlKTqKHORth
 KO5U9JlaVhvap+HAGqDQq7ZO6QNuM3XDjAmuvantTwd89tADvwWTEO86VPDrHgoh
 e6MjUgWlvMgZLY9nXL3K2IhSTyVivxXzxxGyPHtsOZXEsI46KhMnSjMtX80q6NOp
 gnPKumNyC/5+SCCiLesCDTMyAHBfmtT1I9OEPiq203x9xck9yLmjtpUEhHFl0++i
 TJw7cm4YHf3AWnhVU49uMK285XMPL0HxvxaTFErbK0Mdg3SkGN0vJqyh7T1kQvU0
 Rp7R1Le8jM7zczdY4wOqlJoMtZaGKSAoahKD2QhQNhZxNjmWimotApPI7oIXipez
 WqumClMsl8dIxfKdoW+HhfBuoHHbpAXUcej0qjdgGNYrx8cVKJcQmj9xgiEZVJJW
 Hg0CPfZMwKjRPFZOtreHsWpLpYoWMUFz7lxS7zbWO3nNhRNNDKmTpAy39WJOfA1e
 uENI9uNyBD0FNnZ44urTqO3XlpWmo3axQlOZu4wTF1E/BqhacWw=
 =UtKj
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmh/+AsACgkQmmx57+YA
 GNlJgRAAmZooeXTkOcoyDaErbteExqLsEcvKbv6LgH5V/dd4uqGF5TX4tFumW6cC
 +Gznd1gW60qdTwAWKHCuXiiLflYcyJPA8/KasW4jFZJZ+M/ZN+bIFlM6DlWV8eeo
 +KXN24w3CQjU4JRcL18aw6k4MtDShLgRhldCb7nAwM91vZw6z4P9URyWtyqNEn48
 Hey1sLMx8Mk3weErFhiIFMxIBi0zJI81MUE1Eake5U9FL95Vu/+m4i+crUXWzsVA
 +fTPQ6H5AuSwQ2g7LA+7HIufBe6fGxIPU59acGV1Sc2ReuW2KpRMs7kAOdkIwJ1r
 TZW4vu/tjO6DKVRlmV6GOfSQvrVxkGBe0j+wHUnmYuH+SReVKw8BtUsJJYpH12gx
 ysyPU5sVPASOKIBbeMg3OHtfpMh7BFRjtHlXpqP1D9yzgEuTcGx80VNLFOnVZCcZ
 OML481qUCc2PJw5K9Otd782Kud17/IgHitKem6jIrlvBUNNfrVlLyaggZuoaxn1C
 PUwsikL0YaKhlIuCa7Qm+FMktCPDhmYdYdFvb5hwRZUKU7aSAJmRASodmRWOT3Za
 VVFDgqsVipijqUjQ5WowvpTOPm3ecAlAt8Rev6ctCn4hQw1GL7PAcwWDhup/sEvM
 2YchQtVc0E7+HCKhv0MWMTFgdMh34Vx1GfDGCPAi+Hea5MFadxY=
 =QiXC
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-6.17-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers

firmware: tegra: Updates for v6.17-rc1

Add Tegra264 support for the BPMP, fix some dependency issues and clean
up some code using new OF helpers.

* tag 'tegra-for-6.17-firmware' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  firmware: tegra: bpmp: Fix build failure for tegra264-only config
  firmware: tegra: bpmp: Use of_reserved_mem_region_to_resource() for "memory-region"
  firmware: tegra: bpmp: Add support on Tegra264
  firmware: tegra: Fix IVC dependency problems

Link: https://lore.kernel.org/r/20250711220943.2389322-2-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-07-22 22:43:55 +02:00
Kees Cook
57fbad15c2 stackleak: Rename STACKLEAK to KSTACK_ERASE
In preparation for adding Clang sanitizer coverage stack depth tracking
that can support stack depth callbacks:

- Add the new top-level CONFIG_KSTACK_ERASE option which will be
  implemented either with the stackleak GCC plugin, or with the Clang
  stack depth callback support.
- Rename CONFIG_GCC_PLUGIN_STACKLEAK as needed to CONFIG_KSTACK_ERASE,
  but keep it for anything specific to the GCC plugin itself.
- Rename all exposed "STACKLEAK" names and files to "KSTACK_ERASE" (named
  for what it does rather than what it protects against), but leave as
  many of the internals alone as possible to avoid even more churn.

While here, also split "prev_lowest_stack" into CONFIG_KSTACK_ERASE_METRICS,
since that's the only place it is referenced from.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250717232519.2984886-1-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
2025-07-21 21:35:01 -07:00
Arnd Bergmann
753355d620 Arm SCMI updates for v6.17
1. A fix is introduced to correct turbo frequency marking for 64-bit
    devices with sustained frequencies over 4GHz, ensuring accurate turbo
    frequency identification.
 
 2. Debug capabilities are being improved by introducing in-flight transfer
    tracking using debug counters, which help diagnose transfer congestion
    and behavior. Additional tracepoints are added to log in-flight counts
    at transfer begin and end, offering better runtime insight. The debug
    counters now support decrement operations using a newly added
    scmi_dec_count helper, making counter tracking symmetric and more robust.
 
 3. A race condition in suspend-resume logic is being resolved by ensuring
    SCMI_SYSPOWER_IDLE state is set early during resume, improving suspend
    reliability under certain conditions. New suspend and resume operations
    are added to the scmi_bus_type to enable finer power management control
    for SCMI-based devices.
 
 4. Finally enhancements are also made to avoid registering notifiers for
    events that a platform does not support, reducing unnecessary overhead
    by checking for unsupported event types during protocolinitialization.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmhuPrYACgkQAEG6vDF+
 4pgtcg/9GcgWqz1Oq93LbR3BY75dKd9pjTVraivT9sDII/uiRow6NCf6DyIuKzB4
 2sL3JSWz5jCiKn8YxnoyYT7EKuxQBBAe8CQbC9deQSx8F835Mwho8MCeKwiylId9
 9fQrOE79+HgCNvU2znVdQ4MUixliC5Sdn8nijzLeYkFEo26novlxDf39IOTuBPv2
 gbp5X8KOsUE8hglXdYLaxrghT2jrH1RmjzTMv3dr39fcBOpU3dW2FWTaP8myXeql
 lrLzWxdcA/E6vmQTvNvMsDf/mxxEUKkeszlX9iwrZ+RAVmAMgJWVg3o1n+iTas72
 dTs9WA8EgTV2r62vv1i6houu7gjKmrm0n96rmY9eRsuRJ8Wnyi6kF5DnG5o4R32Y
 4oczLHcUaC8e5yLxFykqsKw1OyYpPfdElz/UwFB44ZVyl7LSlXGja4xPqmneA1wF
 pxHvfsPlyUUmVkyMlQQn7HXSWWZ5nm/VGAkJEJTEaD5Gk+nRGcZ/P/F1QRvr3CAA
 Y4LsxnPrrXS9upzUEZYPJ76rtn+uwQeo1o6mTMrjHijB39mILMPC4P9nkRTy7BAw
 mV2aMmQw8jz5+kdELpeOYjKCsDNOQRkr/orVyobIaChk9uTLtcMM/Blkk4p4/dLd
 bgt+Lp+VDFnuED/FPT57VBI16s+G9lxcPkW0/W/SS+5LoCvTV6o=
 =9o+P
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmh+UaIACgkQmmx57+YA
 GNl3PQ//YogYHtNEOrveIAaVPUENumw8i/4B24r4Qu9Mt72x/rCWJ2MafddQ1yyj
 fh4UiMTr7lWMIde9QG5BiQqdkONi0IpGzJr1uSHgjYxarq8l4PlN05MtMtEK/1s5
 9Zh5XTpqsAcFMThNOQXYBZAl12ZHlXxKL/dVnlHZyvcQF7dPYbolxSA7/qms4R7e
 8lFO6UZxcDyEAjOS6oVSlHZqkJFNro6CpHgdISJtjAucyXj1HTmGFXF0VgOUTxNR
 psJUlLw8nIdH8G5pN5dQJhjazzBE5k4hPSFX8hkxh+YI9sEuI7ObpZIyPDcz4KGI
 FutUybgVBYxBYaGoYw8eqTsMJKtdExm6OxLS0IiycVxUeG6mqa4CyDX39KTfvnPE
 NcAvnGUgbYRHz7UizK1RFVpsQRwe+Blooo/0LQZgfJ4bEBbsij7n7tOitPn7eLwg
 nifQBbNN79O3aHWwIJdF62nIr/ETexzHW0OAPzC7K0Q26yy858bKpAZcB6bzJ8F9
 16F80rawrisVqr2DOkwQIyG3Eb1R+QcDq/AJN66ZqaT++4mANDMLvhPY0EEv9021
 SN35R2DaVGeo4t8Oqqf+hddeowYntvHksrPlJUF2VAjsZ7QG5QntpYdv7bgO5ZeR
 Q1gIZP50XhQCpi9TjGIWMZ5CZNMzCsFZU+I2nZ0UwkTXuvcq01k=
 =yON3
 -----END PGP SIGNATURE-----

Merge tag 'scmi-updates-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers

Arm SCMI updates for v6.17

1. A fix is introduced to correct turbo frequency marking for 64-bit
   devices with sustained frequencies over 4GHz, ensuring accurate turbo
   frequency identification.

2. Debug capabilities are being improved by introducing in-flight transfer
   tracking using debug counters, which help diagnose transfer congestion
   and behavior. Additional tracepoints are added to log in-flight counts
   at transfer begin and end, offering better runtime insight. The debug
   counters now support decrement operations using a newly added
   scmi_dec_count helper, making counter tracking symmetric and more robust.

3. A race condition in suspend-resume logic is being resolved by ensuring
   SCMI_SYSPOWER_IDLE state is set early during resume, improving suspend
   reliability under certain conditions. New suspend and resume operations
   are added to the scmi_bus_type to enable finer power management control
   for SCMI-based devices.

4. Finally enhancements are also made to avoid registering notifiers for
   events that a platform does not support, reducing unnecessary overhead
   by checking for unsupported event types during protocolinitialization.

* tag 'scmi-updates-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_scmi: Convert to SYSTEM_SLEEP_PM_OPS
  firmware: arm_scmi: Avoid notifier registration for unsupported events
  firmware: arm_scmi: power_control: Ensure SCMI_SYSPOWER_IDLE is set early during resume
  firmware: arm_scmi: Add power management operations to SCMI bus
  include: trace:  Add tracepoint support for inflight xfer count
  firmware: arm_scmi: Track number of inflight SCMI transfers
  firmware: arm_scmi: Add support for debug counter decrement
  firmware: arm_scmi: Fix up turbo frequencies selection

Link: https://lore.kernel.org/r/20250709122907.1171913-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-07-21 16:41:38 +02:00
Bartosz Golaszewski
7ab36b51c6 firmware: qcom: scm: request the waitqueue irq *after* initializing SCM
There's a subtle race in the SCM driver: we assign the __scm pointer
before requesting the waitqueue interrupt. Assigning __scm marks the SCM
API as ready to accept calls. It's possible that a user makes a call
right after we set __scm and the firmware raises an interrupt before the
driver's ready to service it. Move the __scm assignment after we request
the interrupt.

This has the added benefit of allowing us to drop the goto label.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-4-fa3851c98611@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-07-16 22:50:55 -05:00
Bartosz Golaszewski
87be3e7a2d firmware: qcom: scm: initialize tzmem before marking SCM as available
Now that qcom_scm_shm_bridge_enable() uses the struct device passed to
it as argument to make the QCOM_SCM_MP_SHM_BRIDGE_ENABLE SCM call, we
can move the TZMem initialization before the assignment of the __scm
pointer in the SCM driver (which marks SCM as ready to users) thus
fixing the potential race between consumer calls and the memory pool
initialization.

Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/all/20250120151000.13870-1-johan+linaro@kernel.org/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-3-fa3851c98611@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-07-16 22:50:55 -05:00
Bartosz Golaszewski
dc3f4e75c5 firmware: qcom: scm: take struct device as argument in SHM bridge enable
qcom_scm_shm_bridge_enable() is used early in the SCM initialization
routine. It makes an SCM call and so expects the internal __scm pointer
in the SCM driver to be assigned. For this reason the tzmem memory pool
is allocated *after* this pointer is assigned. However, this can lead to
a crash if another consumer of the SCM API makes a call using the memory
pool between the assignment of the __scm pointer and the initialization
of the tzmem memory pool.

As qcom_scm_shm_bridge_enable() is a special case, not meant to be
called by ordinary users, pull it into the local SCM header. Make it
take struct device as argument. This is the device that will be used to
make the SCM call as opposed to the global __scm pointer. This will
allow us to move the tzmem initialization *before* the __scm assignment
in the core SCM driver.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-2-fa3851c98611@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-07-16 22:50:55 -05:00
Bartosz Golaszewski
23972da96e firmware: qcom: scm: remove unused arguments from SHM bridge routines
qcom_scm_shm_bridge_create() and qcom_scm_shm_bridge_delete() take
struct device as argument but don't use it. Remove it from these
functions' prototypes.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-1-fa3851c98611@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-07-16 22:50:55 -05:00
Aaron Kling
86bc643afd efistub: Lower default log level
Some uefi implementations will write the efistub logs to the display
over a splash image. This is not desirable for debug and info logs, so
lower the default efi log level to exclude them.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-07-15 03:32:53 +02:00
Mark Brown
bfd291279f
ASoC: codec: Convert to GPIO descriptors for
Merge series from Peng Fan <peng.fan@nxp.com>:

This patchset is a pick up of patch 1,2 from [1]. And I also collect
Linus's R-b for patch 2. After this patchset, there is only one user of
of_gpio.h left in sound driver(pxa2xx-ac97).

of_gpio.h is deprecated, update the driver to use GPIO descriptors.

Patch 1 is to drop legacy platform data which in-tree no users are using it
Patch 2 is to convert to GPIO descriptors

Checking the DTS that use the device, all are using GPIOD_ACTIVE_LOW
polarity for reset-gpios, so all should work as expected with this patch.

[1] https://lore.kernel.org/all/20250408-asoc-gpio-v1-0-c0db9d3fd6e9@nxp.com/
2025-07-14 11:34:16 +01:00
Arnd Bergmann
83f96a7eaa firmware: tegra: bpmp: Fix build failure for tegra264-only config
The definition of tegra186_bpmp_ops was not updated in sync with the use
in bpmp.c:

drivers/firmware/tegra/bpmp.c:856:17: error: 'tegra186_bpmp_ops' undeclared here (not in a function); did you mean 'tegra_bpmp_ops'?
  856 |         .ops = &tegra186_bpmp_ops,
aarch64-linux-ld: drivers/firmware/tegra/bpmp.o:(.rodata+0x2f0): undefined reference to `tegra186_bpmp_ops'

Update the Makefile as needed.

There is really no need to hide the declaration based on the configuration,
so just expose it unconditionally so it never has to be updated again
for the next SoC.

Fixes: 94bce2cf7c ("firmware: tegra: bpmp: Add support on Tegra264")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250711082409.1398497-1-arnd@kernel.org
Signed-off-by: Thierry Reding <treding@nvidia.com>
2025-07-11 14:50:35 +02:00
Rob Herring (Arm)
dbe4efea38 firmware: tegra: bpmp: Use of_reserved_mem_region_to_resource() for "memory-region"
Use the newly added of_reserved_mem_region_to_resource() function to
handle "memory-region" properties.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250703183434.2073375-1-robh@kernel.org
Signed-off-by: Thierry Reding <treding@nvidia.com>
2025-07-09 14:21:44 +02:00
Ulf Hansson
29ea33866d firmware: xilinx: Use of_genpd_sync_state()
To make sure genpd tries to power off unused PM domains, let's call
of_genpd_sync_state() from our own ->sync_state() callback.

Cc: Michal Simek <michal.simek@amd.com>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Colibri iMX8X
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20250701114733.636510-17-ulf.hansson@linaro.org
2025-07-09 13:29:34 +02:00
Ulf Hansson
10086a4f39 firmware: xilinx: Don't share zynqmp_pm_init_finalize()
As there no longer any users outside the zynqmp firmware driver of
zynqmp_pm_init_finalize(), let's turn into a local static function.

Cc: Michal Simek <michal.simek@amd.com>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Colibri iMX8X
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20250701114733.636510-16-ulf.hansson@linaro.org
2025-07-09 13:29:29 +02:00
Ulf Hansson
3da405ead6 firmware/pmdomain: xilinx: Move ->sync_state() support to firmware driver
Rather than having the genpd provider to add device_links for each device
that gets attached, to implement the ->sync_state() support, let's rely on
fw_devlink to do this for us.

In this way, we can simplify the code by moving the ->sync_state() callback
into the firmware driver, so let's do that.

Cc: Michael Tretter <m.tretter@pengutronix.de>
Cc: Michal Simek <michal.simek@amd.com>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Colibri iMX8X
Tested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> # TI AM62A,Xilinx ZynqMP ZCU106
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20250701114733.636510-15-ulf.hansson@linaro.org
2025-07-09 13:29:25 +02:00
Gerd Hoffmann
f393a76176 efi: add ovmf debug log driver
Recent OVMF versions (edk2-stable202508 + newer) can write their debug
log to a memory buffer.  This driver exposes the log content via sysfs
(/sys/firmware/efi/ovmf_debug_log).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-07-09 20:31:38 +10:00
Arnd Bergmann
62d6b81e8b firmware: arm_scmi: Convert to SYSTEM_SLEEP_PM_OPS
The old SET_SYSTEM_SLEEP_PM_OPS() macro leads to a warning about an
unused function:

  |  drivers/firmware/arm_scmi/scmi_power_control.c:363:12: error:
  | 	'scmi_system_power_resume' defined but not used [-Werror=unused-function]
  |         static int scmi_system_power_resume(struct device *dev)

The proper way to do this these days is to use SYSTEM_SLEEP_PM_OPS()
and pm_sleep_ptr().

Fixes: 9a0658d399 ("firmware: arm_scmi: power_control: Ensure SCMI_SYSPOWER_IDLE is set early during resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20250709070107.1388512-1-arnd@kernel.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-07-09 10:49:58 +01:00
Cristian Marussi
b5daf93b80 firmware: arm_scmi: Avoid notifier registration for unsupported events
Some platforms may be configured to not support notification events from
certain sources. This scenario is already handled gracefully by avoiding
any attempt to send a notification enable request for those sources, as
such requests would inevitably fail.

However, in a more extreme case, a platform might not support even a
single source for a given event type. In this situation, allowing
notifier registration is meaningless. Attempting to register a notifier
would serve no purpose and only result in unnecessary overhead.

To address this, we now detect such conditions during the protocol
initialization. When identified, we flag the unsupported event types and
reject any subsequent notifier registration attempts for them with
-ENOTSUPP. This early rejection avoids redundant processing and
simplifies runtime logic.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Message-Id: <20250707144220.485365-1-cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-07-08 16:13:55 +01:00
Masahiro Yamada
344b658047 arm64: fix unnecessary rebuilding when CONFIG_DEBUG_EFI=y
When CONFIG_DEBUG_EFI is enabled, some objects are needlessly rebuilt.

[Steps to reproduce]

  Enable CONFIG_DEBUG_EFI and run 'make' twice in a clean source tree.
  On the second run, arch/arm64/kernel/head.o is rebuilt even though
  no files have changed.

  $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- clean
  $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
     [ snip ]
  $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
    CALL    scripts/checksyscalls.sh
    AS      arch/arm64/kernel/head.o
    AR      arch/arm64/kernel/built-in.a
    AR      arch/arm64/built-in.a
    AR      built-in.a
     [ snip ]

The issue is caused by the use of the $(realpath ...) function.

At the time arch/arm64/kernel/Makefile is parsed on the first run,
$(objtree)/vmlinux does not exist. As a result,
$(realpath $(objtree)/vmlinux) expands to an empty string.

On the second run of Make, $(objtree)/vmlinux already exists, so
$(realpath $(objtree)/vmlinux) expands to the absolute path of vmlinux.
However, this change in the command line causes arch/arm64/kernel/head.o
to be rebuilt.

To address this issue, use $(abspath ...) instead, which does not require
the file to exist. While $(abspath ...) does not resolve symlinks, this
should be fine from a debugging perspective.

The GNU Make manual [1] clearly explains the difference between the two:

  $(realpath names...)
    For each file name in names return the canonical absolute name.
    A canonical name does not contain any . or .. components, nor any
    repeated path separators (/) or symlinks. In case of a failure the
    empty string is returned. Consult the realpath(3) documentation for
    a list of possible failure causes.

  $(abspath namees...)
    For each file name in names return an absolute name that does not
    contain any . or .. components, nor any repeated path separators (/).
    Note that, in contrast to realpath function, abspath does not resolve
    symlinks and does not require the file names to refer to an existing
    file or directory. Use the wildcard function to test for existence.

The same problem exists in drivers/firmware/efi/libstub/Makefile.zboot.
On the first run of Make, $(obj)/vmlinuz.efi.elf does not exist when the
Makefile is parsed, so -DZBOOT_EFI_PATH is set to an empty string.
Replace $(realpath ...) with $(abspath ...) there as well.

[1]: https://www.gnu.org/software/make/manual/make.html#File-Name-Functions

Fixes: 757b435aaa ("efi: arm64: Add vmlinux debug link to the Image binary")
Fixes: a050910972 ("efi/libstub: implement generic EFI zboot")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250625125555.2504734-1-masahiroy@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2025-07-08 14:05:29 +01:00
Linus Torvalds
eadb9fa7f7 EFI fixes for v6.16 #1
- Drop preprocessor macros in zboot.lds which is not preprocessed
 - Fix zboot .data section size and raw size when SBAT is enabled
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQQm/3uucuRGn1Dmh0wbglWLn0tXAUCaFVIPQAKCRAwbglWLn0t
 XM7OAP9Vx4c3/gYVyE1sRl1xf7c4V+X8GKkBVt6zCrBANhcWxQEAwaVTDGn6Mu2B
 HNVShLYFvR1HzxzaQ1I7pmIUebntZwQ=
 =+y4d
 -----END PGP SIGNATURE-----

Merge tag 'efi-fixes-for-v6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:

 - Drop preprocessor macros in zboot.lds which is not preprocessed

 - Fix zboot .data section size and raw size when SBAT is enabled

* tag 'efi-fixes-for-v6.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi: Fix .data section size calculations when .sbat is present
  efi: Drop preprocessor directives from zboot.lds
2025-07-07 18:22:25 -07:00
Mark Brown
bb96a315b4
ASoC: soc-dapm: cleanups
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

This is prepare to hiding snd_soc_dapm_context inside soc-dapm.c
2025-07-07 21:02:59 +01:00
Peng Fan
9a0658d399 firmware: arm_scmi: power_control: Ensure SCMI_SYSPOWER_IDLE is set early during resume
Fix a race condition where a second suspend notification from another
SCMI agent wakes the system before SCMI_SYSPOWER_IDLE is set, leading
to ignored suspend requests. This is due to interrupts triggering early
execution of `scmi_userspace_notifier()` before the SCMI state is updated.

To resolve this, set SCMI_SYSPOWER_IDLE earlier in the device resume
path, prior to `thaw_processes()`. This ensures the SCMI state is
correct when the notifier runs, allowing the system to suspend again
as expected.

On some platforms using SCMI, SCP cannot distinguish between CPU idle
and suspend since both result in cluster power-off. By explicitly setting
the idle state early, the Linux SCMI agent can correctly re-suspend in
response to external notifications.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20250704-scmi-pm-v2-2-9316cec2f9cc@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-07-07 16:53:16 +01:00
Peng Fan
76e65f7a0e firmware: arm_scmi: Add power management operations to SCMI bus
Introduce suspend and resume power management callbacks for `scmi_bus_type`,
modeled after `platform_pm_ops`. This enables SCMI devices on the bus to
implement their own suspend and resume behavior, allowing for more
fine-grained power control at the device level.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Message-Id: <20250704-scmi-pm-v2-1-9316cec2f9cc@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-07-07 16:53:16 +01:00
Thierry Reding
94bce2cf7c firmware: tegra: bpmp: Add support on Tegra264
Support for Tegra264 depends on the Tegra186 support, so make sure the
latter is enabled.

Link: https://lore.kernel.org/r/20250506133118.1011777-11-thierry.reding@gmail.com
Signed-off-by: Thierry Reding <treding@nvidia.com>
2025-07-07 14:45:14 +02:00
Thierry Reding
78eb18020a firmware: tegra: Fix IVC dependency problems
The IVC code is library code that other drivers need to select if they
need that library. However, if the symbol is user-selectable this can
lead to conflicts.

Fix this by making the symbol only selectable for COMPILE_TEST and add
a select TEGRA_IVC to TEGRA_BPMP, which is currently the only user.

Link: https://lore.kernel.org/r/20250506133118.1011777-10-thierry.reding@gmail.com
Signed-off-by: Thierry Reding <treding@nvidia.com>
2025-07-07 14:44:44 +02:00
Philip Radford
f8e656382b include: trace: Add tracepoint support for inflight xfer count
Enhance the existing SCMI transfer tracepoints by including the current
in-flight transfer count in `scmi_xfer_begin` and `scmi_xfer_end`.

Introduce a new helper `scmi_inflight_count()` to retrieve the active
transfer count from the SCMI debug counters when debug is enabled.

This trace data is useful for visualizing transfer activity over time
and identifying congestion or unexpected behavior in SCMI messaging.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Philip Radford <philip.radford@arm.com>
Message-Id: <20250630105544.531723-4-philip.radford@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-07-03 16:18:09 +01:00
Philip Radford
a9cd861e61 firmware: arm_scmi: Track number of inflight SCMI transfers
Add a new debug counter, `XFERS_INFLIGHT`, to track the number of
currently active in-flight SCMI message transfers. This helps in
understanding system behavior and diagnosing potential issues with
pending or stuck messages.

The counter is incremented when a transfer is registered as in-flight,
and decremented when it completes and is released.

It is automatically added to debugfs for visibility through SCMI debugfs.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Philip Radford <philip.radford@arm.com>
Message-Id: <20250630105544.531723-3-philip.radford@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-07-03 16:15:44 +01:00
Philip Radford
555e9174ef firmware: arm_scmi: Add support for debug counter decrement
Introduce a new `scmi_dec_count` helper to complement the existing
`scmi_inc_count`, allowing controlled decrement of SCMI debug counters.

This provides symmetry in debug counter management and enables
accurate tracking of counters that may both increase and decrease,
such as those used for in-flight message tracking.

Only active when CONFIG_ARM_SCMI_DEBUG_COUNTERS is enabled.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Philip Radford <philip.radford@arm.com>
Message-Id: <20250630105544.531723-2-philip.radford@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-07-03 16:14:31 +01:00
Arnd Bergmann
f31824a602 Samsung SoC fixes for v6.16
1. Correct CONFIG option in arm64 defconfig enabling the Qualcomm SoC
    SNPS EUSB2 phy driver, because Kconfig entry was renamed when
    changing the driver to a common one, shared with Samsung SoC, thus
    defconfig lost that driver effectively.
 
 2. Exynos ACPM: Fix timeouts happening with multiple requests.
 -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEE3dJiKD0RGyM7briowTdm5oaLg9cFAmhP5xEQHGtyemtAa2Vy
 bmVsLm9yZwAKCRDBN2bmhouD16RND/sFdmFy5ct7PLt/1eq7/SZYel5Elr+lnodM
 3Ugez0wAhn7KPBH56vyTZLgoQCjVY5BSov0nUk3CRj/PIZRWuQK7KFIHAPm6s6HK
 e7e8vaOpgOJhhSGAySCMrPGcnqNz7F8S12NGKmkuE/Lsm6toahG6DNzeDSqsqZbN
 HnHxnNti0UCgMFH3ag2WdepXJ4Tx+p6QmxLnG9yUjTwkefxMfwrMwcBJ6djM2411
 twQjblKqP/03FxUnpLSOtYX6d8/nlfXFk+QXQdd9EZrA7ZtT/VPmVt7MbagYWjRS
 7gVRqTK10fEpivKNVHnSYux85GZf+3QPwlc41UdQ5eRfdwDGOWAITbY46mNM4Ied
 4rsHgPNvcbF1RjEyT4DqTVQX8fqJBt5ABjwYFAGim41rdDeXSu1YMlyzlE90WAmz
 4I1a1TT8SaaA5buiVeqnU4yIPWjZn1RZXgkNPwsOQ/Gluk2xLZVHE/BlK+2N1OwK
 G46rsw+HX3QzQ+YEGbyCn3SweZSwQXAG7bg2k3D23El9+USvdt6rXXS7Yi/ogGkH
 4Bxipvt2okG8csTH+t3DsO9BK+d6E8lFHScLBh8IB0pbWg80KjM+Uyzl5NL4VOFU
 q8W2Fn4H5I2tdKh/j91ZrmK/SnCJMCJRLxwZG2yzbIdLCGiYpmatKA3+JXLSXH+p
 A5LsD8ymiQ==
 =5+or
 -----END PGP SIGNATURE-----

Merge tag 'samsung-fixes-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/fixes

Samsung SoC fixes for v6.16

1. Correct CONFIG option in arm64 defconfig enabling the Qualcomm SoC
   SNPS EUSB2 phy driver, because Kconfig entry was renamed when
   changing the driver to a common one, shared with Samsung SoC, thus
   defconfig lost that driver effectively.

2. Exynos ACPM: Fix timeouts happening with multiple requests.

* tag 'samsung-fixes-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux:
  firmware: exynos-acpm: fix timeouts on xfers handling
  arm64: defconfig: update renamed PHY_SNPS_EUSB2
2025-07-03 16:23:53 +02:00
Sibi Sankar
ad28fc31dd firmware: arm_scmi: Fix up turbo frequencies selection
Sustained frequency when greater than or equal to 4Ghz on 64-bit devices
currently result in marking all frequencies as turbo. Address the turbo
frequency selection bug by fixing the truncation.

Fixes: a897575e79 ("firmware: arm_scmi: Add support for marking certain frequencies as turbo")
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Message-Id: <20250514214719.203607-1-quic_sibis@quicinc.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-06-23 14:36:17 +01:00
Vitaly Kuznetsov
61b57d3539 x86/efi: Implement support for embedding SBAT data for x86
Similar to zboot architectures, implement support for embedding SBAT data
for x86. Put '.sbat' section in between '.data' and '.text' as the former
also covers '.bss' and '.pgtable' and thus must be the last one in the
file.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/20250603091951.57775-1-vkuznets@redhat.com
2025-06-21 13:53:44 +02:00
Vitaly Kuznetsov
f8b53cc917 efi: Fix .data section size calculations when .sbat is present
Commit 0f9a1739dd ("efi: zboot specific mechanism for embedding SBAT
section") neglected to adjust the sizes of the .data section when
CONFIG_EFI_SBAT_FILE is set. As the result, the produced PE binary is
incorrect and some tools complain about it. E.g. 'sbsign' reports:

 # sbsign --key my.key --cert my.crt arch/arm64/boot/vmlinuz.efi
 warning: file-aligned section .data extends beyond end of file
 warning: checksum areas are greater than image size. Invalid section table?

Note, '__data_size' is also used in the PE optional header and it is not
entirely clear whether .sbat needs to be accounted as part of
SizeOfInitializedData or not. As the header seems to be unused by the real
world firmware, keeping the field equal to __data_size.

Fixes: 0f9a1739dd ("efi: zboot specific mechanism for embedding SBAT section")
Reported-by: Heinrich Schuchardt <heinrich.schuchardt@gmx.de>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-06-20 13:36:14 +02:00
Thomas Weißschuh
fb506e31b3 sysfs: treewide: switch back to attribute_group::bin_attrs
The normal bin_attrs field can now handle const pointers.
This makes the _new variant unnecessary.
Switch all users back.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250530-sysfs-const-bin_attr-final-v3-4-724bfcf05b99@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-17 10:44:15 +02:00
Thomas Weißschuh
2fbe82037a sysfs: treewide: switch back to bin_attribute::read()/write()
The bin_attribute argument of bin_attribute::read() is now const.
This makes the _new() callbacks unnecessary. Switch all users back.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250530-sysfs-const-bin_attr-final-v3-3-724bfcf05b99@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-17 10:44:13 +02:00
Richard Fitzgerald
e7af416aeb
firmware: cs_dsp: Remove unused struct list_head from cs_dsp_coeff_ctl
Remove two unused pointers from struct cs_dsp_coeff_ctl by taking the
struct list_head out of struct cs_dsp_alg_region. On a x86_64 build
this saves 16 bytes per control.

Each cs_dsp_coeff_ctl instance needs to keep information about the
algorithm region it refers to. This is done by embedding an instance
of struct cs_dsp_alg_region. But cs_dsp_alg_region was also used to
store entries in a list of algorithm regions, and so had a struct
list_head object for that purpose. This list_head object is not used
with the embedded object in struct cs_dsp_alg_region so was just
wasted bytes.

A new struct cs_dsp_alg_region_list_item has been defined for creating
the list of algorithm regions. It contains a struct cs_dsp_alg_region
and a struct list_head.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250616103052.66537-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-06-16 13:26:44 +01:00
Anirudh Rayabharam (Microsoft)
1733432638 firmware: smccc: Support both smc and hvc conduits for getting hyp UUID
When Linux is running as the root partition under Microsoft Hypervisor
(MSHV) a.k.a Hyper-V, smc is used as the conduit for smc calls.

Extend arm_smccc_hypervisor_has_uuid() to support this usecase. Use
arm_smccc_1_1_invoke to retrieve and use the appropriate conduit instead
of supporting only hvc.

Boot tested on MSHV guest, MSHV root & KVM guest.

Signed-off-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>
Message-Id: <20250521094049.960056-1-anirudh@anirudhrb.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-06-11 13:55:41 +01:00
Vitaly Kuznetsov
c33453d08a efi: Drop preprocessor directives from zboot.lds
Older versions of `ld` don't seem to support preprocessor directives in
linker scripts, e.g. on RHEL9's ld-2.35.2-63.el9 the build fails with:

 ld:./drivers/firmware/efi/libstub/zboot.lds:32: ignoring invalid character `#' in expression
 ld:./drivers/firmware/efi/libstub/zboot.lds:33: syntax error

We don't seem to need these '#ifdef', no empty .sbat section is created
when CONFIG_EFI_SBAT_FILE="":

 # objdump -h arch/arm64/boot/vmlinuz.efi

 arch/arm64/boot/vmlinuz.efi:     file format pei-aarch64-little

 Sections:
 Idx Name          Size      VMA               LMA               File off  Algn
   0 .text         00b94000  0000000000001000  0000000000001000  00001000  2**2
                   CONTENTS, ALLOC, LOAD, READONLY, CODE
   1 .data         00000200  0000000000b95000  0000000000b95000  00b95000  2**2
                   CONTENTS, ALLOC, LOAD, DATA

Fixes: 0f9a1739dd ("efi: zboot specific mechanism for embedding SBAT section")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-06-10 18:47:55 +02:00
Tudor Ambarus
8d2c2fa220 firmware: exynos-acpm: fix timeouts on xfers handling
The mailbox framework has a single inflight request at a time. If
a request is sent while another is still active, it will be queued
to the mailbox core ring buffer.

ACPM protocol did not serialize the calls to the mailbox subsystem so we
could start the timeout ticks in parallel for multiple requests, while
just one was being inflight.

Consider a hypothetical case where the xfer timeout is 100ms and an ACPM
transaction takes 90ms:
      | 0ms: Message #0 is queued in mailbox layer and sent out, then sits
      |      at acpm_dequeue_by_polling() with a timeout of 100ms
      | 1ms: Message #1 is queued in mailbox layer but not sent out yet.
      |      Since send_message() doesn't block, it also sits at
      |      acpm_dequeue_by_polling() with a timeout of 100ms
      |  ...
      | 90ms: Message #0 is completed, txdone is called and message #1 is sent
      | 101ms: Message #1 times out since the count started at 1ms. Even though
      |       it has only been inflight for 11ms.

Fix the problem by moving mbox_send_message() and mbox_client_txdone()
immediately after the message has been written to the TX queue and while
still keeping the ACPM TX queue lock. We thus tie together the TX write
with the doorbell ring and mark the TX as done after the doorbell has
been rung. This guarantees that the doorbell has been rang before
starting the timeout ticks. We should also see some performance
improvement as we no longer wait to receive a response before ringing
the doorbell for the next request, so the ACPM firmware shall be able to
drain faster the TX queue. Another benefit is that requests are no
longer able to ring the doorbell one for the other, so it eases
debugging. Finally, the mailbox software queue will always contain a
single doorbell request due to the serialization done at the ACPM TX
queue level. Protocols like ACPM, that handle their own hardware queues
need a passthrough mailbox API, where they are able to just ring the
doorbell or flip a bit directly into the mailbox controller. The mailbox
software queue mechanism, the locking done into the mailbox core is not
really needed, so hopefully this lays the foundation for a passthrough
mailbox API.

Reported-by: André Draszik <andre.draszik@linaro.org>
Fixes: a88927b534 ("firmware: add Exynos ACPM protocol driver")
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Link: https://lore.kernel.org/r/20250606-acpm-timeout-v2-1-306b1aa07a6c@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
2025-06-10 10:20:16 +02:00
Sudeep Holla
9ca7a42122 firmware: arm_ffa: Replace mutex with rwlock to avoid sleep in atomic context
The current use of a mutex to protect the notifier hashtable accesses
can lead to issues in the atomic context. It results in the below
kernel warnings:

  |  BUG: sleeping function called from invalid context at kernel/locking/mutex.c:258
  |  in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 9, name: kworker/0:0
  |  preempt_count: 1, expected: 0
  |  RCU nest depth: 0, expected: 0
  |  CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.14.0 #4
  |  Workqueue: ffa_pcpu_irq_notification notif_pcpu_irq_work_fn
  |  Call trace:
  |   show_stack+0x18/0x24 (C)
  |   dump_stack_lvl+0x78/0x90
  |   dump_stack+0x18/0x24
  |   __might_resched+0x114/0x170
  |   __might_sleep+0x48/0x98
  |   mutex_lock+0x24/0x80
  |   handle_notif_callbacks+0x54/0xe0
  |   notif_get_and_handle+0x40/0x88
  |   generic_exec_single+0x80/0xc0
  |   smp_call_function_single+0xfc/0x1a0
  |   notif_pcpu_irq_work_fn+0x2c/0x38
  |   process_one_work+0x14c/0x2b4
  |   worker_thread+0x2e4/0x3e0
  |   kthread+0x13c/0x210
  |   ret_from_fork+0x10/0x20

To address this, replace the mutex with an rwlock to protect the notifier
hashtable accesses. This ensures that read-side locking does not sleep and
multiple readers can acquire the lock concurrently, avoiding unnecessary
contention and potential deadlocks. Writer access remains exclusive,
preserving correctness.

This change resolves warnings from lockdep about potential sleep in
atomic context.

Cc: Jens Wiklander <jens.wiklander@linaro.org>
Reported-by: Jérôme Forissier <jerome.forissier@linaro.org>
Closes: https://github.com/OP-TEE/optee_os/issues/7394
Fixes: e0573444ed ("firmware: arm_ffa: Add interfaces to request notification callbacks")
Message-Id: <20250528-ffa_notif_fix-v1-3-5ed7bc7f8437@arm.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-06-09 11:24:43 +01:00
Sudeep Holla
27e850c88d firmware: arm_ffa: Move memory allocation outside the mutex locking
The notifier callback node allocation is currently done while holding
the notify_lock mutex. While this is safe even if memory allocation may
sleep, we need to move the allocation outside the locked region in
preparation to move from using muxtes to rwlocks.

Move the memory allocation to avoid potential sleeping in atomic context
once the locks are moved from mutex to rwlocks.

Fixes: e0573444ed ("firmware: arm_ffa: Add interfaces to request notification callbacks")
Message-Id: <20250528-ffa_notif_fix-v1-2-5ed7bc7f8437@arm.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2025-06-09 11:24:43 +01:00