summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2025-10-27irqchip/gic-v3: Switch high priority PPIs over to handle_percpu_devid_irq()Marc Zyngier
It so appears that handle_percpu_devid_irq() is extremely similar to handle_percpu_devid_fasteoi_nmi(), and that the differences do no justify the horrid machinery in the GICv3 driver to handle the flow handler switch. Stick with the standard flow handler, even for NMIs. Suggested-by: Will Deacon <will@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Link: https://patch.msgid.link/20251020122944.3074811-11-maz@kernel.org
2025-10-27perf: arm_spe_pmu: Convert to new interrupt affinity retrieval APIMarc Zyngier
Now that the relevant interrupt controllers are equipped with a callback returning the affinity of per-CPU interrupts, switch the ARM SPE driver over to this new method. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://patch.msgid.link/20251020122944.3074811-10-maz@kernel.org
2025-10-27perf: arm_pmu: Convert to the new interrupt affinity retrieval APIMarc Zyngier
Now that the relevant interrupt controllers are equipped with a callback returning the affinity of per-CPU interrupts, switch the OF side of the ARM PMU driver over to this new method. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://patch.msgid.link/20251020122944.3074811-9-maz@kernel.org
2025-10-27coresight: trbe: Convert to the new interrupt affinity retrieval APIMarc Zyngier
Now that the relevant interrupt controllers are equipped with a callback returning the affinity of per-CPU interrupts, switch the TRBE driver over to this new method. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://patch.msgid.link/20251020122944.3074811-8-maz@kernel.org
2025-10-27irqchip/apple-aic: Add FW info retrieval supportMarc Zyngier
Plug the new .get_fwspec_info() callback into the Apple AIC driver, using some of the existing FIQ affinity handling infrastructure. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Acked-by: Sven Peter <sven@kernel.org> Link: https://patch.msgid.link/20251020122944.3074811-7-maz@kernel.org
2025-10-27irqchip/gic-v3: Add FW info retrieval supportMarc Zyngier
Plug the new .get_fwspec_info() callback into the GICv3 core driver, using some of the existing PPI affinity handling infrastructure. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Link: https://patch.msgid.link/20251020122944.3074811-6-maz@kernel.org
2025-10-27platform: Add firmware-agnostic irq and affinity retrieval interfaceMarc Zyngier
Expand platform_get_irq_optional() to also return an affinity if available, renaming it to platform_get_irq_affinity() in the process. platform_get_irq_optional() is preserved with its current semantics by calling into the new helper with a NULL affinity pointer. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Link: https://patch.msgid.link/20251020122944.3074811-5-maz@kernel.org
2025-10-27of/irq: Add interrupt affinity reporting interfaceMarc Zyngier
Plug the irq_populate_fwspec_info() helper into the OF layer to offer an interrupt affinity reporting function. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Link: https://patch.msgid.link/20251020122944.3074811-4-maz@kernel.org
2025-10-27ACPI: irq: Add interrupt affinity reporting interfaceMarc Zyngier
Plug the irq_populate_fwspec_info() helper into the ACPI layer to offer an interrupt affinity reporting function. This is currently only supported for the CONFIG_ACPI_GENERIC_GSI configurations, but could later be extended to legacy architectures if necessary. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Will Deacon <will@kernel.org> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> Link: https://patch.msgid.link/20251020122944.3074811-3-maz@kernel.org
2025-10-27drm/xe/xe3: Add WA_14024681466 for Xe3_LPGNitin Gote
Apply WA_14024681466 to Xe3_LPG graphics IP versions from 30.00 to 30.05. v2: (Matthew Roper) - Remove stepping filter as workaround applies to all steppings. - Add an engine class filter so it only applies to the RENDER engine. Signed-off-by: Nitin Gote <nitin.r.gote@intel.com> Link: https://patch.msgid.link/20251027092643.335904-1-nitin.r.gote@intel.com Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2025-10-27regmap: sdw-mbq: Don't assume the regmap device is the SoundWire slaveCharles Keepax
Currently, the code assumes that the device that registered the MBQ register map is the actual SoundWire slave device. This works fine for all current users, however future SDCA devices will likely be implemented with the SoundWire slave as a parent device and separate child drivers with regmaps for each audio Function. Update the regmap_init_sdw_mbq_cfg macro to allow these two to be specified separately. Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20251020155512.353774-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27remoteproc: core: Remove unused export of rproc_va_to_paPeng Fan
Commit 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") added an export for rproc_va_to_pa. However, since its introduction, this symbol has not been used by any loadable modules. It remains only referenced within remoteproc_virtio.c, which is always built together with remoteproc_core.c. As such, exporting rproc_va_to_pa is unnecessary, so remove the export. No functional changes. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20251016-rproc-cleanup-v3-v3-4-774083716e8a@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-27remoteproc: core: Removed unused headersPeng Fan
There is no user of crc32.h, debugfs.h, of_reserved_mem.h, virtio_ids.h, so remove from the included headers. No functional changes. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20251016-rproc-cleanup-v3-v3-3-774083716e8a@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-27remoteproc: core: Sort header includesPeng Fan
Reordered the header includes in drivers/remoteproc/remoteproc_core.c to follow alphabetical order to simplify future maintenance. No functional changes. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20251016-rproc-cleanup-v3-v3-2-774083716e8a@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-27remoteproc: core: Drop redundant initialization of 'ret' in rproc_shutdown()Peng Fan
The variable ret is immediately assigned the return value of mutex_lock_interruptible(), making its prior initialization to zero unnecessary. Remove the redundant assignment No functional changes. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20251016-rproc-cleanup-v3-v3-1-774083716e8a@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-27PCI: endpoint: pci-epf-vntb: Add MSI doorbell supportFrank Li
Add MSI doorbell support to reduce latency between PCI host and EP. Before this change: ping 169.254.172.137 64 bytes from 169.254.172.137: icmp_seq=1 ttl=64 time=0.575 ms 64 bytes from 169.254.172.137: icmp_seq=2 ttl=64 time=1.80 ms 64 bytes from 169.254.172.137: icmp_seq=3 ttl=64 time=8.19 ms 64 bytes from 169.254.172.137: icmp_seq=4 ttl=64 time=2.00 ms After this change: ping 169.254.144.71 64 bytes from 169.254.144.71: icmp_seq=1 ttl=64 time=0.215 ms 64 bytes from 169.254.144.71: icmp_seq=2 ttl=64 time=0.456 ms 64 bytes from 169.254.144.71: icmp_seq=3 ttl=64 time=0.448 ms Also, change the data type of 'epf_ntb::db' to 'atomic_64' as multiple doorbell interrupts might trigger at the same time. Signed-off-by: Frank Li <Frank.Li@nxp.com> [mani: added 'pci_epf_' prefix to doorbell IRQ name, minor code cleanups] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://patch.msgid.link/20251015-vntb_msi_doorbell-v6-4-9230298b1910@nxp.com
2025-10-27PCI: endpoint: Add pci_epf_assign_bar_space() APIFrank Li
Add pci_epf_assign_bar_space() API to allow setting any MMIO address as the BAR memory space, such as an MSI message base address. This API also conforms to the BAR base address and size alignment restrictions enforced by the PCI spec r6.0, sec 7.5.1.2.1. Signed-off-by: Frank Li <Frank.Li@nxp.com> [mani: removed unused epc var, reworded kdoc, comments and description] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://patch.msgid.link/20251015-vntb_msi_doorbell-v6-3-9230298b1910@nxp.com
2025-10-27ACPI: PRM: Add acpi_prm_handler_available()Yazen Ghannam
Add a helper function to check if a PRM handler/module is present. This can be used during init time by code that depends on a particular handler. If the handler is not present, then the code does not need to be loaded. Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: "Mario Limonciello (AMD)" <superm1@kernel.org> Acked-by: "Rafael J. Wysocki (Intel)" <rafael@kernel.org> Link: https://patch.msgid.link/all/20251017-wip-atl-prm-v2-1-7ab1df4a5fbc@amd.com
2025-10-27Revert "wifi: ath10k: avoid unnecessary wait for service ready message"Baochen Qiang
This reverts commit 51a73f1b2e56b0324b4a3bb8cebc4221b5be4c7a. Although this commit benefits QCA6174, it breaks QCA988x and QCA9984 [1][2]. Since it is not likely to root cause/fix this issue in a short time, revert it to get those chips back. Compile tested only. Fixes: 51a73f1b2e56 ("wifi: ath10k: avoid unnecessary wait for service ready message") Link: https://lore.kernel.org/ath10k/6d41bc00602c33ffbf68781f563ff2e6c6915a3e.camel@gmail.com # [1] Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220671 # [2] Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20251027-ath10k-revert-polling-first-change-v1-1-89aaf3bcbfa1@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27PCI: endpoint: Add pci_epf_get_required_bar_size() helperFrank Li
Introduce pci_epf_get_required_bar_size() helper to get the required BAR size and backing memory size. This helper will be used to set a fixed MMIO address as the backing memory for a BAR. Since this helper returns both BAR size and the aligned memory size, use two parameters, 'bar_size' and 'aligned_mem_size' to avoid confusion. Signed-off-by: Frank Li <Frank.Li@nxp.com> [mani: renamed helper to pci_epf_get_required_bar_size(), reworded description] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Niklas Cassel <cassel@kernel.org> Link: https://patch.msgid.link/20251015-vntb_msi_doorbell-v6-2-9230298b1910@nxp.com
2025-10-27PCI: endpoint: Rename 'epf_bar::aligned_size' to 'epf_bar:mem_size'Frank Li
Rename the member 'epf_bar::aligned_size' to 'epf_bar::mem_size' to better reflect its purpose. 'aligned_size' was misleading, as it actually represents the backing memory size allocated for the BAR rather than the aligned size. Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Niklas Cassel <cassel@kernel.org> Link: https://patch.msgid.link/20251015-vntb_msi_doorbell-v6-1-9230298b1910@nxp.com
2025-10-27drm/xe/pf: Fix VF FLR synchronization between all GTsMichal Wajdeczko
If subsequent VF FLR request is triggered when previous VF FLR sequence is still being processed, we ignore it as not needed. But in case of the multi-GT platforms, one GT may already finish its VF FLR processing and will start a new sequence, which includes new cross-GT synchronization point. However, since other GT may be still busy with post-sync cleanup steps, this will put on hold this new FLR sequence, which might never finish due to lack of any future synchronization checkouts. Add additional cross-GT FLR synchronization point when each GT ends processing its own FLR sequence. This should also help to cover the case when one GT fails FLR processing before reaching the first synchronization point. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6287 Fixes: 2a8fcf7cc950 ("drm/xe/pf: Synchronize VF FLR between all GTs") Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Link: https://patch.msgid.link/20251025124906.5264-1-michal.wajdeczko@intel.com
2025-10-27iommu: tegra: enable compile testingJohan Hovold
There seems to be nothing preventing this driver from being compile tested so enable that to increase build coverage. Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2025-10-27amba: tegra-ahb: enable compile testingJohan Hovold
There seems to be nothing preventing this driver from being compile tested so enable that to increase build coverage. This also allows for compile testing of further Tegra drivers (e.g. IOMMU driver). Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2025-10-27wifi: ath12k: Add lockdep warn for RCURipan Deuri
Add RCU_LOCKDEP_WARN() in following functions: - ath12k_dp_link_peer_to_link_sta() - ath12k_wifi7_dp_rx_h_mpdu() Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-10-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Use ath12k_dp_peer in per packet Tx & Rx pathsHarsh Kumar Bijlani
Move link agnostic data path parameters (keys, rx_tid, reorder buffers, MIC context etc) from ath12k_sta and ath12k_dp_link_peer into ath12k_dp_peer. These parameters are shared across MLO links and should be managed at the peer level. Configure them only when the link peer is primary to avoid redundancy and ensure consistent setup. Switch per-packet Tx/Rx paths and monitor paths to look up ath12k_dp_peer and ath12k_dp_link_peer via peer_id. Helper APIs added: - ath12k_dp_peer_find_by_peerid() - ath12k_dp_link_peer_find_by_peerid() Ensure RCU read lock is held when using these helpers APIs. With the above API ath12k_dp_link_peer_find_by_peerid() being used to find ath12k_dp_link_peer, existing API ath12k_dp_link_peer_find_by_id() is required only at the time of unmap event from firmware since it fetches the ath12k_dp_link_peer from linked list. In order to restrict the usage of API ath12k_dp_link_peer_find_by_id(), make it static and also rename it to ath12k_dp_link_peer_search_by_id(). Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-9-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Attach and detach ath12k_dp_link_peer to ath12k_dp_peerHarsh Kumar Bijlani
Introduce explicit attach/detach of ath12k_dp_link_peer objects to their parent ath12k_dp_peer to formalize the data path station hierarchy: ath12k_dp_peer | |--> ath12k_dp_link_peer | |--> ath12k_dp_link_peer | |--> ath12k_dp_link_peer ath12k_dp_peer maintains an array of RCU-protected pointers "link_peers[ATH12K_NUM_MAX_LINKS]" to ath12k_dp_link_peer indexed by its protocol_link_id, and each ath12k_dp_link_peer holds a back pointer to its parent ath12k_dp_peer. Attach is performed after link peer creation, and detach occurs before link peer deletion. This ensures consistent lifetime management and safe concurrent access. ath12k_dp_peer also maintains an array "hw_links[ATH12K_GROUP_MAX_RADIO]" to store the mapping between hw_link_id and protocol_link_id for each of the ath12k_dp_link_peer. RCU locking/unlocking rules: - Readers must hold rcu_read_lock() and fetch the pointer with rcu_dereference(dp_peer->link[link_id]); drop with rcu_read_unlock() when done. - Writers publish with rcu_assign_pointer() and reclaim only after synchronize_rcu(). Handle the case of detachment of link peer from ath12k_dp_peer in case of core reset. Ensure the following order of locks to be followed for attach and detach: - Lock dp->dp_lock - Lock dp_hw->peer_lock - Unlock dp_hw->peer_lock - Unlock dp->dp_lock Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-8-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Define ath12k_dp_peer structure & APIs for create & deleteHarsh Kumar Bijlani
Define the structure of ath12k_dp_peer and also define APIs for creation and deletion of ath12k_dp_peer based on STA state, as the ath12k_dp_peer is intended to be used in the subsequent set of patches. Maintain ath12k_dp_peer in a linked list in ath12k_dp_hw (which is a datapath component of ath12k_hw) and protect this list using spinlock "peer_lock". Store peer id based table (array of RCU pointers) of ath12k_dp_peer in ath12k_dp_hw. Use this peer id table to refer in the per packet Tx and Rx paths as it provides faster access to ath12k_dp_peer in comparison to linked list iterative search using peer id or mac address. Add support to handle deletion of ath12k_dp_peer in case of core reset. This patch is adding and deleting ath12k_dp_peer created for MLO STA to the above mentioned RCU pointer table. Addition and deletion of ath12k_dp_peer for non-MLO STA to RCU pointer table is handled in the subsequent following patch. Structure ath12k_ml_peer is created and deleted for MLO peers at the time of connect and disconnect and there is no other use case of it. With the above design in place for ath12k_dp_peer, ath12k_ml_peer becomes redundant. Hence, remove the structure ath12k_ml_peer and the list "ml_peers" present in ath12k_hw maintaining linked list of ath12k_ml_peer. APIs removed: - ath12k_peer_ml_find() - ath12k_peer_ml_create() - ath12k_peer_ml_delete() Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-7-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Add hash table for ath12k_dp_link_peerHarsh Kumar Bijlani
There is a linked list of ath12k_dp_link_peer maintained in ath12k_dp. For link peer search based on mac address, there is iteration over the list wherein the mac address are compared for each entry in the list. This search operation is a costly operation considering the time complexity involved. In order to reduce the complexity, add hash table for ath12k_dp_link_peer in ath12k_dp where mac address of the link peer is used to derive the hash index. This hash table is lock protected by spinlock "dp_lock" present in ath12k_dp. This hash table is currently used for search of link peer using mac address for any interaction between control path and data path, per packet Rx monitor path and regular multicast Tx path. Update API ath12k_dp_link_peer_find_by_addr() to make use of the hash table for search operation using mac address, while other search APIs still rely on linked list. ath11k driver has been taken as reference for implementation of hash table. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-6-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Move ath12k_dp_link_peer list from ath12k_base to ath12k_dpHarsh Kumar Bijlani
ath12k_base maintains a linked list of ath12k_dp_link_peer. This linked list is used for all kind of peer search operations. With the modularization of device and peer objects for ath12k next-generation driver, ath12k_dp_link_peer and ath12k_dp are exclusively meant for datapath related operations. Hence move ath12k_dp_link_peer linked list from ath12k_base to ath12k_dp. This linked list is to be lock protected by newly introduced spinlock "dp_lock" defined in ath12k_dp as this list can be concurrently accessed in different contexts for insert, delete and search operations. With the above changes, update following APIs to make use of lock "dp->dp_lock" instead of lock "ab->base_lock" and also update API signatures to pass ath12k_dp pointer instead of ath12k_base pointer as the function argument. ath12k_dp_link_peer_find_by_vdev_and_addr() ath12k_dp_link_peer_find_by_id() ath12k_dp_link_peer_find_by_ast() ath12k_dp_link_peer_find_by_pdev__and_addr() ath12k_dp_link_peer_find_by_ml_id() ath12k_dp_link_peer_find_by_addr() ath12k_dp_rx_h_find_link_peer() Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-5-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Add hash table for ath12k_link_sta in ath12k_baseHarsh Kumar Bijlani
Currently ath12k_base maintains a linked list of ath12k_dp_link_peer as "peers". This linked list is used for all kinds of peer search operations. In the control path, if there is a requirement to search for ath12k_link_sta using mac address, then below sequence is to be followed: 1. Find ath12k_dp_link_peer in the linked list using mac address 2. Fetch ieee80211_sta from ath12k_dp_link_peer 3. Fetch ath12k_sta from ieee80211_sta 4. Finally fetch ath12k_link_sta from ath12k_sta using link_id In the above sequence, there are too many indirections involved. In order to simplify this, add hash table for ath12k_link_sta in ath12k_base. This hash table is lock protected by existing spinlock "base_lock" in ath12k_base as this table can be concurrently accessed in different contexts. Use this table for ath12k_link_sta search operations using mac address in the control path. Ex: For WMI interface and mac80211_ops interface in the control path, sta mac address is received and this hash table can be used to search for ath12k_link_sta directly instead of following the longer route mentioned above. Helper APIs added: - ath12k_link_sta_rhash_add() - To add arsta entry to hash table - ath12k_link_sta_rhash_delete() - To remove arsta entry from hash table - ath12k_link_sta_find_by_addr() - To find arsta from hash table using mac address Make changes in API ath12k_peer_sta_kickout_event() to find arsta using above mechanism. ath11k driver has been taken as reference for implementation of hash table. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-4-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Rename ath12k_peer to ath12k_dp_link_peerHarsh Kumar Bijlani
Rename ath12k_peer to ath12k_dp_link_peer for all instances and rename the following find APIs accordingly to reflect the API names as per the structural name change. APIs renamed: ath12k_peer_find() ath12k_peer_find_by_pdev_idx() ath12k_peer_find_by_addr() ath12k_peer_find_by_ml_id() ath12k_peer_find_by_id() ath12k_peer_find_by_ast() ath12k_peer_exist_by_vdev_id() ath12k_peer_get_link_sta() Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-3-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27wifi: ath12k: Move DP related functions from peer.c to dp_peer.c fileHarsh Kumar Bijlani
Refactor the structures and APIs defined in files peer.h and peer.c in such a way that the APIs making use of ath12k_peer are moved to newly introduced files dp_peer.h and dp_peer.c. Have this new file dp_peer.c compiled as part of kernel module ath12k.ko. Move these APIs from peer.h and peer.c to dp_peer.h and dp_peer.c: ath12k_peer_find() ath12k_peer_find_by_pdev_idx() ath12k_peer_find_by_addr() ath12k_peer_find_by_ml_id() ath12k_peer_find_by_id() ath12k_peer_exist_by_vdev_id() ath12k_peer_find_by_ast() ath12k_peer_unmap_event() ath12k_peer_map_event() ath12k_peer_get_link_sta() Background: In current ath12k architecture, connected station is represented by struct ath12k_sta. struct ath12k_sta has an array of struct ath12k_link_sta wherein each index represents one link of the connected station. For each ath12k_link_sta, there is a corresponding data path peer which is represented by struct ath12k_peer. Diagrammatic view of the station is as below: ath12k_sta | |-> ath12k_link_sta <--> ath12k_peer | |-> ath12k_link_sta <--> ath12k_peer | |-> ath12k_link_sta <--> ath12k_peer Currently, in control path, ath12k_link_sta and ath12k_peer are used interchangeably, while the data path makes use of ath12k_peer only. For ath12k next-generation driver framework, in order to have a clean segregation between control and data path, use ath12k_link_sta only for control path operations. Station view for the data path is revamped as below: ath12k_dp_peer | |-> ath12k_dp_link_peer | |-> ath12k_dp_link_peer | |-> ath12k_dp_link_peer Introduce the structure ath12k_dp_peer to represent the data path version of corresponding ath12k_sta. This ath12k_dp_peer contains the fields used in the per packet Tx Rx paths applicable across all the links and maintains an array of ath12k_dp_link_peer. Per packet Tx and Rx path operates on ath12k_dp_peer. This ath12k_dp_peer is a standalone new object and has back pointer reference to ieee80211_sta. Rename ath12k_peer to ath12k_dp_link_peer and move the fields which are common across all the links to ath12k_dp_peer. Add the fields specific to a link which are mostly for statistics and monitor usage to ath12k_dp_link_peer. Final view of station in ath12k next-generation driver is shown as below: Control Path Data Path ------------------------------------------------------------------- ath12k_sta ath12k_dp_peer | | |-> ath12k_link_sta <----> |-> ath12k_dp_link_peer | | |-> ath12k_link_sta <----> |-> ath12k_dp_link_peer | | |-> ath12k_link_sta <----> |-> ath12k_dp_link_peer This patch and the subsequent patches in this series are meant to achieve the modularization of peer object as mentioned above. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Harsh Kumar Bijlani <quic_hbijlani@quicinc.com> Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20251024181548.3255166-2-quic_rdeuri@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2025-10-27regulator: pca9450: link regulator inputs to supply groupsOleksij Rempel
Add supply_name entries for all PCA9450 regulators to describe their respective input pin groups (INB13, INB26, INB45, INL1). This links each buck and LDO to the upstream supply that powers its input group. On some systems, power faults such as undervoltage are detected before the PMIC itself. Defining supply relationships allows the regulator framework to propagate such events properly through the dependency chain. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://patch.msgid.link/20251027124415.989301-3-o.rempel@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2025-10-27cpuidle: menu: Use residency threshold in polling state override decisionsAboorva Devarajan
On virtualized PowerPC (pseries) systems, where only one polling state (Snooze) and one deep state (CEDE) are available, selecting CEDE when the predicted idle duration is less than the target residency of CEDE state can hurt performance. In such cases, the entry/exit overhead of CEDE outweighs the power savings, leading to unnecessary state transitions and higher latency. Menu governor currently contains a special-case rule that prioritizes the first non-polling state over polling, even when its target residency is much longer than the predicted idle duration. On PowerPC/pseries, where the gap between the polling state (Snooze) and the first non-polling state (CEDE) is large, this behavior causes performance regressions. Refine that special case by adding an extra requirement: the first non-polling state can only be chosen if its target residency is below the defined RESIDENCY_THRESHOLD_NS. If this condition is not satisfied, polling is allowed instead, avoiding suboptimal non-polling state entries. This change is limited to the single special-case rule for the first non-polling state. The general non-polling state selection logic in the menu governor remains unchanged. Performance improvement observed with pgbench on PowerPC (pseries) system: +---------------------------+------------+------------+------------+ | Metric | Baseline | Patched | Change (%) | +---------------------------+------------+------------+------------+ | Transactions/sec (TPS) | 495,210 | 536,982 | +8.45% | | Avg latency (ms) | 0.163 | 0.150 | -7.98% | +---------------------------+------------+------------+------------+ CPUIdle state usage: +--------------+--------------+-------------+ | Metric | Baseline | Patched | +--------------+--------------+-------------+ | Total usage | 12,735,820 | 13,918,442 | | Above usage | 11,401,520 | 1,598,210 | | Below usage | 20,145 | 702,395 | +--------------+--------------+-------------+ Above/Total and Below/Total usage percentages: +------------------------+-----------+---------+ | Metric | Baseline | Patched | +------------------------+-----------+---------+ | Above % (Above/Total) | 89.56% | 11.49% | | Below % (Below/Total) | 0.16% | 5.05% | | Total cpuidle miss (%) | 89.72% | 16.54% | +------------------------+-----------+---------+ The results indicate that restricting CEDE selection to cases where its residency matches the predicted idle time reduces mispredictions, lowers unnecessary state transitions, and improves overall throughput. Reviewed-by: Christian Loehle <christian.loehle@arm.com> Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com> [ rjw: Changelog edits, rebase ] Link: https://patch.msgid.link/20251006013954.17972-1-aboorvad@linux.ibm.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-10-27gpio: loongson-64bit: Switch to dynamic allocate GPIO base in byte modeBinbin Zhou
gpiolib want to get completely rid of static gpiobase allocation, so switch to dynamic allocate GPIO base in byte mode, also can avoid warning message: [1.529974] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. Reported-by: Hongliang Wang <wanghongliang@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20251023090346.1995894-1-zhoubinbin@loongson.cn Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-10-27cpuidle: governors: menu: Select polling state in some more casesRafael J. Wysocki
A throughput regression of 11% introduced by commit 779b1a1cb13a ("cpuidle: governors: menu: Avoid selecting states with too much latency") has been reported and it is related to the case when the menu governor checks if selecting a proper idle state instead of a polling one makes sense. In particular, it is questionable to do so if the exit latency of the idle state in question exceeds the predicted idle duration, so add a check for that, which is sufficient to make the reported regression go away, and update the related code comment accordingly. Fixes: 779b1a1cb13a ("cpuidle: governors: menu: Avoid selecting states with too much latency") Closes: https://lore.kernel.org/linux-pm/004501dc43c9$ec8aa930$c59ffb90$@telus.net/ Reported-by: Doug Smythies <dsmythies@telus.net> Tested-by: Doug Smythies <dsmythies@telus.net> Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Christian Loehle <christian.loehle@arm.com> Link: https://patch.msgid.link/12786727.O9o76ZdvQC@rafael.j.wysocki
2025-10-27iio: st_lsm6dsx: Fixed calibrated timestamp calculationMario Tesi
The calibrated timestamp is calculated from the nominal value using the formula: ts_gain[ns] ≈ ts_sensitivity - (ts_trim_coeff * val) / 1000. The values of ts_sensitivity and ts_trim_coeff are not the same for all devices, so it is necessary to differentiate them based on the part name. For the correct values please consult the relevant AN. Fixes: cb3b6b8e1bc0 ("iio: imu: st_lsm6dsx: add odr calibration feature") Signed-off-by: Mario Tesi <mario.tesi@st.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-10-27i2c: designware: Disable SMBus interrupts to prevent storms from ↵Jinhui Guo
mis-configured firmware When probing the I2C master, disable SMBus interrupts to prevent storms caused by broken firmware mis-configuring IC_SMBUS=1; the handler never services them and a mis-configured SMBUS Master extend-clock timeout or SMBUS Slave extend-clock timeout can flood the CPU. Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251021075714.3712-2-guojinhui.liam@bytedance.com
2025-10-27i2c: i801: Add support for Intel Diamond RapidsZeng Guang
Add SMBus PCI ID on Intel Diamond Rapids. Signed-off-by: Zeng Guang <guang.zeng@intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251021073522.3458383-1-heikki.krogerus@linux.intel.com
2025-10-27i2c: stm32: Omit two variable reassignments in stm32_i2c_dma_request()Markus Elfring
An error code was assigned to a variable and checked accordingly. This value was passed to a dev_err_probe() call in an if branch. This function is documented in the way that the same value is returned. Thus delete two redundant variable reassignments. The source code was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/f7e0c023-d2d1-40ba-badb-74a7e9c23684@web.de
2025-10-27i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe()Markus Elfring
An error code was assigned to a variable and checked accordingly. This value was passed to a dev_err_probe() call in an if branch. This function is documented in the way that the same value is returned. Thus delete a redundant variable reassignment. The source code was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Anand Moon <linux.amoon@gmail.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/bec52694-c755-4d88-aa36-1d96f6d146e4@web.de
2025-10-27i2c: pcf8584: Fix do not use assignment inside if conditionalCezar Chiru
Assign inside of 'if' conditional is not allowed. Move assignment from inside 'if' conditional, to one line before each 'if'conditional statement that caused errors. Enforce errors fixing based on checkpatch.pl output on file. Signed-off-by: Cezar Chiru <chiru.cezar.89@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251018091258.5266-3-chiru.cezar.89@gmail.com
2025-10-27i2c: pcf8584: Remove debug macros from i2c-algo-pcf.cCezar Chiru
Remove debug macros and printk and dev_dbg function calls from file as no change was done for long time. Remove i2c_debug module parameter also as its implementation, the debug macros, has been removed. Signed-off-by: Cezar Chiru <chiru.cezar.89@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251018091258.5266-2-chiru.cezar.89@gmail.com
2025-10-27i2c: busses: bcm2835: convert from round_rate() to determine_rate()Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from round_rate() to determine_rate(). Signed-off-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251016-i2c-round-rate-resend-v1-1-96dd1d725e8f@redhat.com
2025-10-27i2c: designware: Remove i2c_dw_remove_lock_support()Nathan Chancellor
When building certain configurations with CONFIG_FINEIBT=y after commit 894af4a1cde6 ("objtool: Validate kCFI calls"), there is a warning due to an indirect call in dw_i2c_plat_remove(): $ cat allno.config CONFIG_ACPI=y CONFIG_CFI=y CONFIG_COMMON_CLK=y CONFIG_CPU_MITIGATIONS=y CONFIG_I2C=y CONFIG_I2C_DESIGNWARE_BAYTRAIL=y CONFIG_I2C_DESIGNWARE_CORE=y CONFIG_I2C_DESIGNWARE_PLATFORM=y CONFIG_IOSF_MBI=y CONFIG_MITIGATION_RETPOLINE=y CONFIG_MODULES=y CONFIG_PCI=y CONFIG_X86_KERNEL_IBT=y $ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 clean allnoconfig vmlinux vmlinux.o: warning: objtool: dw_i2c_plat_remove+0x3c: no-cfi indirect call! With this configuration, i2c_dw_semaphore_cb_table has the BAYTRAIL member and the sentinel (i.e., 2 members), both of which have an implicit .remove = NULL, so Clang effectively turns i2c_dw_remove_lock_support(), which is later inlined into dw_i2c_plat_remove(), into: static void i2c_dw_remove_lock_support(struct dw_i2c_dev *dev) { if (dev->semaphore_idx > 2) (*NULL)(dev): } which is not necessarily problematic from a logic perspective (as the code was not bounds checking semaphore_idx so an out of bounds index could already crash) but objtool's new __nocfi indirect call checking trips over Clang dropping the kCFI setup from a known NULL indirect call. While it would be possible to fix this by transforming the initial check into if (dev->semaphore_idx < 0 || dev->semaphore_idx >= ARRAY_SIZE(i2c_dw_semaphore_cb_table)) the remove member is unused after commit 440da737cf8d ("i2c: designware: Use PCI PSP driver for communication"), so i2c_dw_remove_lock_support() can be removed altogether, as it will never actually do anything. Closes: https://github.com/ClangBuiltLinux/linux/issues/2133 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Kees Cook <kees@kernel.org> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20251013-dw_i2c_plat_remove-avoid-objtool-no-cfi-warning-v1-1-8cc4842967bf@kernel.org
2025-10-27drm/xe: Fix spelling and typos across Xe driver filesSanjay Yadav
Corrected various spelling mistakes and typos in multiple files under the Xe directory. These fixes improve clarity and maintain consistency in documentation. v2 - Replaced all instances of "XE" with "Xe" where it referred to the driver name - of -> for - Typical -> Typically v3 - Revert "Xe" to "XE" for macro prefix reference Signed-off-by: Sanjay Yadav <sanjay.kumar.yadav@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Stuart Summers <stuart.summers@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Link: https://patch.msgid.link/20251023121453.1182035-2-sanjay.kumar.yadav@intel.com
2025-10-27drm/nouveau: Fix race in nouveau_sched_fini()Philipp Stanner
nouveau_sched_fini() uses a memory barrier before wait_event(). wait_event(), however, is a macro which expands to a loop which might check the passed condition several times. The barrier would only take effect for the first check. Replace the barrier with a function which takes the spinlock. Cc: stable@vger.kernel.org # v6.8+ Fixes: 5f03a507b29e ("drm/nouveau: implement 1:1 scheduler - entity relationship") Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Philipp Stanner <phasta@kernel.org> Link: https://patch.msgid.link/20251024161221.196155-2-phasta@kernel.org
2025-10-27iommu: Pass in old domain to attach_dev callback functionsNicolin Chen
The IOMMU core attaches each device to a default domain on probe(). Then, every new "attach" operation has a fundamental meaning of two-fold: - detach from its currently attached (old) domain - attach to a given new domain Modern IOMMU drivers following this pattern usually want to clean up the things related to the old domain, so they call iommu_get_domain_for_dev() to fetch the old domain. Pass in the old domain pointer from the core to drivers, aligning with the set_dev_pasid op that does so already. Ensure all low-level attach fcuntions in the core can forward the correct old domain pointer. Thus, rework those functions as well. Suggested-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
2025-10-27iommu: Do not revert set_domain for the last gdevNicolin Chen
The last gdev is the device that failed the __iommu_device_set_domain(). So, it doesn't need to be reverted, given it's attached to group->domain already. This is not a problem currently, since it's a simply re-attach. However, the core will need to pass in the old domain to __iommu_device_set_domain so the old domain pointers would be inconsistent between a failed device and all its prior succeeded devices, as all the prior devices need to be reverted. Avoid the re-attach for the last gdev, by breaking before the revert. Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>