summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2026-07-27cpufreq/amd-pstate-ut: Add unit test for CPPC Performance PriorityK Prateek Nayak
Add a unit test for CPPC Performance Priority that modifies the floor perf and confirms if the modification was successful similar to the energy_performance_preference unit test. On platforms that do not support X86_FEATURE_CPPC_PERF_PRIO, the test returns -EOPNOTSUPP and amd_pstate_ut_check_floor_freq is marked as "skipped". Suggested-by: Kalpana Shetty <kalpana.shetty@amd.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-10-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27cpufreq/amd-pstate-ut: Add unit test for "dynamic" EPP modeK Prateek Nayak
Extend the EPP unit test to cover the "dynamic" epp mode. Since "dynamic_epp" is no longer a system-wide toggle, remove the legacy "dynamic_epp" bits from the unit test. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-9-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27cpufreq/amd-pstate: Reduce the scope of exported symbolsK Prateek Nayak
Symbols exported by amd-pstate.c are ever only needed for amd-pstate-ut. Introduce EXPORT_SYMBOL_FOR_PSTATE_UT() to export these symbols selectively to "amd-pstate-ut" namespace as opposed to all GPL modules. No functional changes intended. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-8-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27cpufreq/amd-pstate: Remove "amd_dynamic_epp" cmdline and "dynamic_epp" sysfsK Prateek Nayak
Since dynamic_epp has been converted to an "energy_performance_preference", toggling the feature via the sysfs file or the kernel cmdline is now redundant. Remove the sysfs file and the "amd_dynamic_epp" cmdline and only depend on "energy_performance_preference" to toggle dynamic_epp. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-6-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27cpufreq/amd-pstate: Add dynamic EPP as an "energy_performance_preference" modeK Prateek Nayak
Convert the global "dynamic_epp" toggle into a per-CPU "energy_performance_preference" mode "dynamic" that allows toggling the functionality of "dynamic_epp" at a per-CPU level. Instead of being a system-wide toggle, users can opt into the functionality of dynamic EPP on a per-CPU basis by switching to the powersave governor and selecting the "dynamic" mode from the available performance preferences. Unlike the previous implementation that had to check for driver mode before toggling on the functionality, block writes to certain sysfs files, potentially disallow policy change, etc. the per-CPU toggle fits naturally into the intended design and provides more granular control to the user. The dynamic_epp file is now redundant as the option to toggle it on is controlled via energy_performance_preference, and the dynamic_epp file will be removed in the subsequent commit. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-5-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27cpufreq/amd-pstate: Extract platform profile to EPP conversion into a helperK Prateek Nayak
Avoid duplication by extracting the switch case that derives EPP based on platform profile into the amd_pstate_get_epp_from_platform_profile() helper. No functional changes intended. Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-4-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27cpufreq/amd-pstate: Remove the defensive check for bios_min_perfK Prateek Nayak
Initialization of bios_min_perf (BIOS Requested CPU Min Freq.) only succeeds when the driver init finds the CPPC_REQ MSRs to have all 0s except for MIN_PERF bits. A kexec puts the driver through the suspend path which, although resets the min_perf back to bios_min_perf, keeps the rest of the CPPR_REQ intact with the last value at the time of suspend. The defensive check for bios_min_perf exists to prevent the min perf from last CPPC_REQ being incorrectly considered as bios_min_perf when a kexec switches from an older kernel running the version of driver which is not aware of bios_min_perf to a newer one. This scenario is extremely unlikely and Mario suggested it is better to simplify the initialization rather than complicating the suspend resume paths. Drop the defensive check for bios_min_perf initialization and add a debug message to dump the BIOS Requested Min Freq. to console leaving enough breadcrumbs for debug if a situation so arises. Suggested-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-3-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-27cpufreq/amd-pstate: Set min_limit_freq based on bios_min_perfK Prateek Nayak
amd_pstate_update_min_max_limit() sets the min_limit_perf to the nominal_perf to avoid frequency throttling when the system is idling. This was found to be an ideal default but is suboptimal for users who have profiled their workload at different operating frequencies and have configured the optimal idling frequency via bios_min_perf. Use the bios_min_perf (if configured) as the min_limit_perf when running with performance governor. In absence of bios_min_perf, continue using nominal_perf as the default min_limit_perf to avoid throttling. Fixes: 608a76b65288 ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option") Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com> Link: https://lore.kernel.org/r/20260727072056.1248-2-kprateek.nayak@amd.com Signed-off-by: Mario Limonciello <superm1@kernel.org>
2026-07-28gpu: nova-core: fix packed registry table sizeAlexandre Courbot
`PACKED_REGISTRY_TABLE::size` describes the entire table, including its fixed-size header. `SetRegistry` currently initializes it with only the variable payload length, omitting the 8 bytes header. Fix this by using `CommandToGsp::size` to obtain the actual command size, including its header. Fixes: 19b0a6e7c2be ("gpu: nova-core: gsp: Add SetRegistry command") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/r/20260722075253.B6DDB1F00A3D@smtp.kernel.org Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260723-nova-registry-size-fix-v1-1-8f471ba00ab4@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-07-27net: enetc: use kzalloc_flex() for enetc_psfp_gate allocationWei Fang
Replace the open-coded struct_size() + kzalloc() pattern with the kzalloc_flex() helper when allocating struct enetc_psfp_gate. This removes the intermediate entries_size local variable and makes the allocation site more concise. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260720014317.1059359-15-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: use alloc_etherdev_mqs() to create netdev for VF driverWei Fang
The VF driver uses alloc_etherdev_mq() with ENETC_MAX_NUM_TXQS as the queue count, which forces the TX and RX queue counts to be equal and uses a compile-time constant rather than the actual hardware capability. After enetc_get_si_caps() is called, si->num_tx_rings and si->num_rx_rings reflect the actual number of rings assigned to the VF by the PF. For the ENETC VF on LS1028A and the upcoming i.MX95/94, their SoCs have no more than 6 CPUs, and the number of TX/RX rings allocated to the VF is less than 8. Therefore, switch to alloc_etherdev_mqs() so that the TX and RX queue counts are set independently, each capped at ENETC_MAX_NUM_TXQS, based on the actual number of rings assigned to the VF by the PF. Note that if future SoCs have more than 6 CPUs and more than 6 RX rings allocated to VFs, the size of the int_vector array in struct enetc_ndev_priv will need to be modified. Similarly, if more than 8 TX rings are allocated to each int_vector, ENETC_MAX_NUM_TXQS will also need to be modified. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260720014317.1059359-14-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: remove redundant num_vsi field from enetc_port_capsWei Fang
The num_vsi field in struct enetc_port_caps is populated by reading the NUM_VSI field of the ECAPR1 register, which reports the number of VSIs supported by the ENETC4 port. When CONFIG_PCI_IOV is enabled, this value always matches pf->total_vfs, which is obtained from the read-only PCI_SRIOV_TOTAL_VF register via pci_sriov_get_totalvfs() during probe. Both ECAPR1[NUM_VSI] and PCI_SRIOV_TOTAL_VF are derived from the same IERB register EaVFRIDAR[NUM_VF] (a 4-bit field), so they are guaranteed to be equal. When CONFIG_PCI_IOV is disabled, pci_sriov_get_totalvfs() returns 0, but this is benign since pci_enable_sriov() is also stubbed to return -ENODEV, so no VF can be created, and enetc4_enable_all_si() only enables the PF SI (PSI). Since pf->total_vfs already reflects the number of VFs that can actually be used, and is the established convention in the sibling FSL_ENETC PF driver, there is no need to read and cache num_vsi separately in the port capabilities structure. Remove the num_vsi field from enetc_port_caps, and replace all uses of pf->caps.num_vsi with pf->total_vfs in the ring allocation, SI enable, and debugfs code paths. Note that in the MSI-X configuration, it is still necessary to obtain the actual number of VSIs from ECAPR1. Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260720014317.1059359-13-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: move enetc_set_si_vlan_promisc() to enetc_pf_common.cWei Fang
The PSIPVMR in ENETC v4 has the same bit layout and functionality as the PSIPVMR register in ENETC v1: bit n (n <= 15) controls VLAN promiscuous mode for SI n. The only difference between the two hardware generations is the register address offset. Since the register functionality is identical, the VLAN promiscuous mode setting code can be shared between ENETC v1 and v4 drivers. Move enetc_set_si_vlan_promisc() from enetc_pf.c to enetc_pf_common.c and export it so that it can be shared between the two drivers. Add a revision check using is_enetc_rev1() to select the correct register offset (ENETC_PSIPVMR for v1 and ENETC4_PSIPVMR for v4) while keeping the same logic. Remove the v4-specific enetc4_pf_set_si_vlan_promisc() from enetc4_pf.c and replace its call site with the new common enetc_set_si_vlan_promisc() to eliminate code duplication. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260720014317.1059359-12-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: refactor SI VLAN promiscuous mode configurationWei Fang
Remove the enetc_set_vlan_promisc(), enetc_enable_si_vlan_promisc() and enetc_disable_si_vlan_promisc() functions, and introduce a new unified function enetc_set_si_vlan_promisc() to enable or disable VLAN promiscuous mode for a specific SI. This simplifies the logic and makes the interface more straightforward. The vlan_promisc_simap field in struct enetc_pf is no longer needed to track the current state. As ENETC V4 only changes the address offset of PSIPVMR register compared to V1 without any functional difference, enetc_set_si_vlan_promisc() can be moved to enetc_pf_common.c in the future with minor adjustments to be reused by the ENETC V4 driver Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260720014317.1059359-11-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: open-code enetc4_set_default_si_vlan_promisc()Wei Fang
The function enetc4_set_default_si_vlan_promisc() is only called once, from enetc4_configure_port_si(). Open-code the loop at the call site and remove the single-use wrapper. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260720014317.1059359-10-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: remove invalid code from enetc4_pl_mac_link_up()Wei Fang
When adding phylink MAC operations support to the NETC switch driver, Russell King pointed out several pieces of invalid logic in the .mac_link_up() implementation (see [1] and [2]): 1) Half-duplex backpressure is not supported by the kernel, Ethernet relies on packet dropping for congestion management. 2) phylink_autoneg_inband() is unnecessary, as RGMII in-band status is not supported. 3) TX and RX pause are disabled in half-duplex mode, so there is no need to override them in .mac_link_up(). The same invalid logic is also present in enetc4_pl_mac_link_up(), so remove the invalid code from it. Given enetc4_set_hd_flow_control() is removed, pf->caps.half_duplex has also become useless and should therefore be removed as well. Link: https://lore.kernel.org/imx/acEIQqI-_oyCym8O@shell.armlinux.org.uk/ # 1 Link: https://lore.kernel.org/imx/acEFwqmAvWls_9Ef@shell.armlinux.org.uk/ # 2 Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20260720014317.1059359-9-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: differentiate phylink capabilities for pseudo-MAC and standalone MACClaudiu Manoil
The ENETC pseudo-MACs are proprietary internal links that do not implement any standard MII interface, so restrict their supported PHY interface modes to PHY_INTERFACE_MODE_INTERNAL only. Since pseudo-MACs can operate at any speed between 10Mbps and 25Gbps in multiples of 10Mbps, set their MAC capabilities to cover the full range of standard full-duplex speeds: 10/100/1000/2500/5000/10000/ 20000/25000 Mbps. For standalone ENETC (v4), expand the supported interface modes to include 10GBASER in addition to the existing RGMII, SGMII, 1000BASEX, 2500BASEX and USXGMII modes, with MAC capabilities up to 10G. MAC_1000 is replaced with MAC_1000FD to explicitly exclude 1000M half-duplex, which is not supported. Note that 10GBASE-R mode of ENETC v4 has not supported yet, the current patch adds PHY_INTERFACE_MODE_10GBASER simply as preparation for the upcoming support of the 10GBASE-R mode. Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20260720014317.1059359-8-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: simplify enetc4_set_port_speed()Wei Fang
Since phylink may pass SPEED_UNKNOWN to mac_link_up, handle it explicitly by defaulting to SPEED_10, then replace the switch statement with a direct call to PCR_PSPEED_VAL(). Also update PCR_PSPEED_VAL() to use FIELD_PREP() for proper field masking instead of an open-coded shift. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20260720014317.1059359-7-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: use PCI device name for debugfs directoryWei Fang
enetc_create_debugfs() is called right after register_netdev(), at which point ndev->name still holds the format "eth%d" (e.g., eth0) rather than the final assigned name (e.g., via udev rules). Use pci_name() instead of netdev_name() to name the debugfs directory. The PCI device name is unique, stable, and available from the start, making it a more reliable identifier for the debugfs entry. Therefore, the observable debugfs path from something like /sys/kernel/debug/eth0/mac_filter to a PCI BDF-style path such as /sys/kernel/debug/0002:00:00.0/mac_filter. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260720014317.1059359-6-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: improve MAFT entry management with bitmap trackingWei Fang
Replace the counter-based MAFT entry tracking (num_mfe/mac_filter_num) with a bitmap (maft_eid_bitmap) stored in struct ntmp_user, which is a more appropriate place for NTMP resource management. The bitmap approach brings two improvements. First, the entry deletion in enetc4_pf_clear_maft_entries() now checks the return value of ntmp_maft_delete_entry() and only clears the corresponding bit on success, keeping hardware and software state in sync. Previously, the counter was reset unconditionally regardless of whether the hardware deletion actually succeeded. Second, entry allocation in enetc4_pf_add_maft_entries() uses ntmp_lookup_free_eid() to find available IDs dynamically, with an upfront capacity check via bitmap_weight() to avoid partial failures. The MAFT entry count is moved into ntmp_user.maft_num_entries and initialized once during enetc4_init_ntmp_user(). Helper functions enetc4_ntmp_bitmap_init() and enetc4_ntmp_bitmap_free() manage the bitmap lifetime. The debugfs show function is updated accordingly to iterate over set bits under rtnl_lock(). Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260720014317.1059359-5-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: convert ndo_set_rx_mode() to ndo_set_rx_mode_async()Wei Fang
The current ndo_set_rx_mode() is called under netif_addr_lock spinlock with BHs disabled, which prevents drivers from sleeping. To work around this limitation, the enetc driver uses a dedicated workqueue to defer MAC address list updates to a sleepable context. Since commit 3554b4345d85 ("net: introduce ndo_set_rx_mode_async and netdev_rx_mode_work") introduced the ndo_set_rx_mode_async() callback, drivers can now handle address list updates directly in a sleepable context. Therefore, convert the enetc driver to use ndo_set_rx_mode_async() and remove the dedicated workqueue and the deferred work item accordingly. Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260720014317.1059359-4-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: extract common helpers for MAC hash filter configurationWei Fang
The PSIUMHFR and PSIMMHFR registers in ENETC v4 have the same bit layout as in ENETC v1. The only difference between the two hardware generations is the register address offsets. Since the register functionality is identical, the MAC hash filter configuration code can be shared between the ENETC v1 and v4 drivers. Extract two new common helper functions, enetc_set_si_uc_hash_filter() and enetc_set_si_mc_hash_filter(), into enetc_pf_common.c. These helpers select the correct register offset based on the hardware revision via is_enetc_rev1(). Remove v1-specific enetc_clear_mac_ht_flt() and enetc_set_mac_ht_flt() from enetc_pf.c, and v4-specific enetc4_pf_set_si_uc_hash_filter() and enetc4_pf_set_si_mc_hash_filter() from enetc4_pf.c, as they are now superseded by the shared implementations. Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20260720014317.1059359-3-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27net: enetc: extract common helpers for MAC promiscuous mode settingWei Fang
The PSIPMMR (Port Station Interface Promiscuous MAC Mode Register) in ENETC v4 has the same bit layout as the PSIPMR register in ENETC v1: bit n controls unicast promiscuous mode for SI n, and bit (n + 16) controls multicast promiscuous mode for SI n. The only difference between the two hardware generations is the register address offset. Since the register functionality is identical, the MAC promiscuous mode setting code can be shared between ENETC v1 and v4 drivers. Rename ENETC_PSIPMR to ENETC_PSIPMMR in enetc_hw.h to match the actual register name used in the reference manual, and extract two new common helper functions, enetc_set_si_uc_promisc() and enetc_set_si_mc_promisc(), into enetc_pf_common.c. These helpers select the correct register offset based on the hardware revision via is_enetc_rev1(). Remove the v4-specific enetc4_pf_set_si_mac_promisc() function from enetc4_pf.c and the duplicate PSIPMMR_SI_MAC_UP/MP macro definitions from enetc4_hw.h, as they are now superseded by the shared code. Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Joe Damato <joe@dama.to> Link: https://patch.msgid.link/20260720014317.1059359-2-wei.fang@oss.nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27Merge tag 'wireless-2026-07-26' of ↵Jakub Kicinski
https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Johannes Berg says: ==================== wireless-next-2026-07-26 Mostly driver changes this time: - new driver mm81x for an S1G device - new driver nxpwifi for NXP devices (mostly forked off from mwifiex) - ath12k: much kernel infrastructure integration work - brcmfmac: DPP support, some Cypress part update - nl80211: per-link statistics support ==================== Link: https://patch.msgid.link/20260726105205.942922-60-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27vxlan: use pskb_network_may_pull() for transmit path header pullsEric Dumazet
In vxlan_xmit(), arp_reduce(), and vxlan_mdb_entry_skb_get(), pskb_may_pull() was being called to verify the availability of network layer headers (ARP, IPv6/ND, IP/IPv6 MDB keys). However, during transmit skb->data points to the MAC header, so skb_network_offset(skb) is ETH_HLEN (14 bytes). Using pskb_may_pull(skb, len) only checks len bytes from skb->data rather than skb_network_offset(skb) + len, which can leave part of the network header in non-linear frags. Replace these remaining pskb_may_pull() calls with pskb_network_may_pull() to properly account for the MAC header offset. Fixes: e4f67addf158 ("add DOVE extensions for VXLAN") Fixes: f564f45c4518 ("vxlan: add ipv6 proxy support") Fixes: 0f83e69f44bf ("vxlan: Add MDB data path support") Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: stable@vger.kernel.org Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260723144249.759100-6-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27vxlan: use pskb_network_may_pull() in route_shortcircuit()Eric Dumazet
route_shortcircuit() currently calls pskb_may_pull(skb, sizeof(struct iphdr)) (or ipv6hdr), which checks if bytes are available starting from skb->data. However, in vxlan_xmit(), skb->data points to the MAC header, so skb_network_offset(skb) is ETH_HLEN (14 bytes). Using pskb_may_pull(skb, 20) only checks 20 bytes from skb->data (which is 14 bytes MAC header + 6 bytes of IP header), leaving the rest of the IP header potentially un-pulled in non-linear frags. Subsequent dereferences of ip_hdr(skb)->daddr can read beyond the pulled linear buffer length. Fix this by using pskb_network_may_pull(), which adds skb_network_offset(skb) to the length check to ensure the full network header is present in the linear buffer. Fixes: e4f67addf158 ("add DOVE extensions for VXLAN") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20260723144249.759100-5-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27vxlan: use neigh_ha_snapshot() in route_shortcircuit()Eric Dumazet
The neighbour hardware address n->ha can be updated asynchronously by the neighbour subsystem, protected by n->ha_lock seqlock. Reading n->ha without holding the seqlock loop can lead to torn reads or reading a partially updated MAC address. Use neigh_ha_snapshot() in route_shortcircuit() to safely copy n->ha under read_seqbegin()/read_seqretry() lock protection before using it. Note that arp_reduce() and neigh_reduce() seem to have the same issue left for future patches. Fixes: e4f67addf158 ("add DOVE extensions for VXLAN") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20260723144249.759100-4-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27vxlan: unclone skb head before modifying eth header in route_shortcircuit()Eric Dumazet
When route_shortcircuit() performs L3 short-circuit routing, it modifies the Ethernet header of the skb in-place: memcpy(eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, dev->addr_len); memcpy(eth_hdr(skb)->h_dest, n->ha, dev->addr_len); If the incoming skb is cloned (for example by packet sockets, tcpdump, or dev_queue_xmit), modifying the Ethernet header without uncloning can corrupt the packet header for other readers holding a reference to the cloned skb. Ensure the skb header is writable and unshared by calling skb_cow_head(skb, 0) prior to updating the Ethernet header. If skb_cow_head() fails, abort short-circuiting and return false to allow standard packet processing fallback. Fixes: e4f67addf158 ("add DOVE extensions for VXLAN") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260723144249.759100-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27vxlan: re-fetch eth header after route_shortcircuit()Eric Dumazet
Before route_shortcircuit(), the eth header pointer is cached from eth_hdr(skb). Inside route_shortcircuit(), pskb_may_pull() can be called, which may reallocate skb->head. In this case, returning to vxlan_xmit() leaves the cached eth pointer pointing to freed memory, leading to a use-after-free when dereferencing eth->h_dest. Fix this by updating eth = eth_hdr(skb) after calling route_shortcircuit(). Fixes: ae8840825605 ("VXLAN: Allow L2 redirection with L3 switching") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20260723144249.759100-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-27watchdog: atcwdt200: fix return value when watchdog is enabledSurendra Singh Chouhan
atcwdt_get_int_timer_type() returned TMR_UNKNOWN (enum value 3) when CTRL_WDT_EN was set in the control register. Because atcwdt_probe() checks "ret = atcwdt_get_int_timer_type(drv_data); if (ret) return ret;", returning TMR_UNKNOWN caused probe() to return 3 instead of a valid negative error code. Fix this by returning -EBUSY via dev_err_probe() when the watchdog is already enabled and update the kernel-doc description accordingly. Fixes: e4e0848ad046 ("watchdog: atcwdt200: Add driver for Andes ATCWDT200") Signed-off-by: Surendra Singh Chouhan <kr494167@gmail.com> Link: https://lore.kernel.org/r/20260723022634.8642-1-kr494167@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-07-27hwmon: (nct6775-core) Prevent access to unsupported weight registersGuenter Roeck
Sashiko reports: During initialization of the nct6116 chip, the driver sets data->pwm_num to 5. However, it assigns several NCT6106 register arrays (such as NCT6106_REG_WEIGHT_DUTY_STEP, NCT6106_REG_WEIGHT_TEMP_SEL, and NCT6106_REG_WEIGHT_TEMP_*) to data->REG_PWM and data->REG_WEIGHT_TEMP. These arrays only contain 3 elements. In nct6775_update_pwm(), the driver iterates up to data->pwm_num. If data->has_pwm has bits 3 or 4 set (which is structurally possible for nct6116), the loop attempts to read elements at index 3 and 4 from these 3-element arrays. This results in a global out-of-bounds read, which can be caught by KASAN. Furthermore, the driver uses these garbage out-of-bounds values as hardware register addresses for subsequent read and write operations. This leads to invalid hardware register access, potentially causing hardware misconfiguration or system crashes. The underlying problem is that the chip does support up to five fan control channels, but only the first three support weight control. Fix the problem by extending the affected weight register arrays with zeroed fields. The driver uses zeroed register addresses to determine if a register is supported or not, and skips accesses for unsupported registers. Reported-by: Sashiko <sashiko-bot@kernel.org> Fixes: 29c7cb485b32 ("hwmon: (nct6775) Integrate new model nct6116") Cc: Björn Gerhart <gerhart@posteo.de> Cc: Florian Bezdeka <florian.bezdeka@siemens.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-07-27hwmon: (lm63) Mask PWM frequency multiplier to supported bitsGuenter Roeck
Sashiko is concerned that reading a PWM frequency multiplier outside the supported range of [1, 31] might result in bad PWM values written to the chip. Technically, the chip should never return a value with the upper 3 bits set, so this should never happen. However, it is unknown if there are LM63 variants where the upper bits of the register can be written. Mask the register value read from the chip to only accept the lower 5 bit when reading it from the chip to avoid the problem. Reported-by: Sashiko <sashiko-bot@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-07-27iio: chemical: bme680: Use dev_err_probe()Vojtěch Krátký
Used dev_err_probe() instead of dev_err() to simplify error handling. Signed-off-by: Vojtěch Krátký <vo.kratky@seznam.cz> Reviewed-by: Siratul Islam <siratul.islam@linux.dev> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: light: cm3323: use dev_err_probe() in probe pathAldo Conte
Replace dev_err() calls with dev_err_probe() in cm3323_init() and cm3323_probe(). cm3323_init() is called by cm3323_probe(), so using dev_err_probe() ensures that deferred probing is handled correctly and simplifies error paths. Remove the redundant error message in cm3323_probe(). Tested on a Raspberry Pi 3B using i2c-stub. The driver probes successfully and successfully read integration_time after this change. Reviewed-by: Andy Shevchenko <andy@kernel.org> Suggested-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Aldo Conte <aldocontelk@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: pressure: abp2030pa: Remove unreachable return in abp2_read_raw()Babanpreet Singh
In the IIO_CHAN_INFO_RAW case every arm of the inner switch on channel->type returns so this final return is never reached. Found by smatch: drivers/iio/pressure/abp2030pa.c:382 abp2_read_raw() warn: ignoring unreachable code. Assisted-by: Claude:claude-opus-5 Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com> Reviewed-by: Siratul Islam <siratul.islam@linux.dev> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: dac: ad5686: extend device support with new partsRodrigo Alencar
Add support for AD5313R, AD5317R, AD5674, AD5679, AD5687, AD5687R, AD5689, AD5689R to the AD5686 SPI driver. Also adding support for AD5316R, AD5675, AD5697R to the AD5696 I2C driver. This includes the creation of seven chip info struct instances and reuse of existing ones. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: dac: ad5686: refactor device list and file header commentsRodrigo Alencar
Refactor device list in Kconfig, sorting devices by channel count. Also, remove device description from file headers. One can rely on the ID table(s) to check for supported devices. AD5337R is ommited as it does not seem to exist, i.e. its documentation could not be found. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: dac: ad5696: add AD5673R/AD5677R entries to of_match tableRodrigo Alencar
Populate of_match table with AD5673R/AD5677R entries, already supported by the driver and available in the id_table. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: temperature: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq() automatically log detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: light: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq() automatically log detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Standardize error check on if (ret) rather than if (ret < 0). Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: proximity: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq() automatically log detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Standardize error check on if (ret) rather than if (ret < 0) Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: pressure: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq() automatically log detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: magnetometer: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_threaded_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: imu: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_threaded_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: humidity: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_threaded_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: health: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq() automatically log detailed error messages on failure. Remove the now-redundant driver-specific dev_err() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: gyro: adxrs290: Remove redundant dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: st_sensors: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_threaded_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: chemical: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq() automatically log detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Gustavo Silva <gustavograzs@gmail.com> # for ens160 Reviewed-by: Maxwell Doose <maxwell@maxwelld.cc> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
2026-07-27iio: addac: ad74413r: Remove redundant dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>