summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2025-08-25net: phy: mxl-86110: fix indentation in struct phy_driverDaniel Golle
The .led_hw_control_get and .led_hw_control_set ops are indented with spaces instead of tabs, unlike the rest of the values of the PHY's struct phy_driver instance. Use tabs instead of spaces resulting in a uniform indentation style. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/b9b7336ae309facc5e73874c62e64492fd749cc6.1755884175.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: mxl-86110: add basic support for led_brightness_set opDaniel Golle
Add support for forcing each connected LED to be always on or always off by implementing the led_brightness_set() op. This is done by modifying the COM_EXT_LED_GEN_CFG register to enable force-mode and forcing the LED either on or off. When calling the led_hw_control_set() force-mode is again disabled for that LED. Implement mxl86110_modify_extended_reg() locked helper instead of manually acquiring and releasing the MDIO bus lock for single __mxl86110_modify_extended_reg() calls. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/58eeefc8c24e06cd2110d3cefbd4236b1a4f44a2.1755884175.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25Octeontx2-af: Fix NIX X2P calibration failuresHariprasad Kelam
Before configuring the NIX block, the AF driver initiates the "NIX block X2P bus calibration" and verifies that NIX interfaces such as CGX and LBK are active and functioning correctly. On few silicon variants(CNF10KA and CNF10KB), X2P calibration failures have been observed on some CGX blocks that are not mapped to the NIX block. Since both NIX-mapped and non-NIX-mapped CGX blocks share the same VENDOR,DEVICE,SUBSYS_DEVID, it's not possible to skip probe based on these parameters. This patch introuduces "is_cgx_mapped_to_nix" API to detect and skip probe of non NIX mapped CGX blocks. Fixes: aba53d5dbcea ("octeontx2-af: NIX block admin queue init") Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Link: https://patch.msgid.link/20250822105805.2236528-1-hkelam@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25ppp: remove rwlock usageQingfang Deng
In struct channel, the upl lock is implemented using rwlock_t, protecting access to pch->ppp and pch->bridge. As previously discussed on the list, using rwlock in the network fast path is not recommended. This patch replaces the rwlock with a spinlock for writers, and uses RCU for readers. - pch->ppp and pch->bridge are now declared as __rcu pointers. - Readers use rcu_dereference_bh() under rcu_read_lock_bh(). - Writers use spin_lock() to update. Signed-off-by: Qingfang Deng <dqfext@gmail.com> Link: https://patch.msgid.link/20250822012548.6232-1-dqfext@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: usb: lan78xx: add support for generic net selftests via ethtoolOleksij Rempel
Integrate generic net_selftest framework by wiring up .get_strings, .get_sset_count, and .self_test ethtool ops. This enables execution of standard self-tests using `ethtool -t <dev>` on LAN78xx devices. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://patch.msgid.link/20250822092555.2888870-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-26ata: ahci: Allow ignoring the external/hotplug capability of portsDamien Le Moal
Commit 4edf1505b76d ("ata: ahci: Disallow LPM policy control for external ports") introduced disabling link power management (LPM) for ports that are advertized as external/hotplug capable. This is necessary to force the maximum power policy (ATA_LPM_MAX_POWER) onto the port link to ensure that the hotplug capability of the port is functional. However, doing so blindly for all ports can prevent systems from going into a low power state, even if the external/hotplug ports on the system are unused. E.g., a laptop may see the internal SATA slot of a docking station as an external hotplug capable port, and in such case, the user may prefer to not use the port and to favor instead enabling LPM to allow the laptop to transition to low power states. Since there is no easy method to automatically detect such choice, introduce the new mask_port_ext module parameter to allow a user to ignore the external/hotplug capability of a port. The format for this parameter value is identical to the format used for the mask_port_map parameter: a mask can be defined for all AHCI adapters of a system or for a particular adapters identified with their PCI IDs (bus:dev.func format). The function ahci_get_port_map_mask() is renamed to ahci_get_port_mask() and modified to return a mask, either for the port map mask of an adapter (to ignore ports) or for the external/hotplug capability of an adapter. Differentiation between map_port_mask and map_port_ext_mask is done by passing the parameter string to ahci_get_port_mask() as a second argument. To be consistent with this change, the function ahci_apply_port_map_mask() is renamed ahci_port_mask() and changed to return a mask value. The mask for the external/hotplug capability for an adapter, if defined by the map_port_ext_mask parameter, is stored in the new field mask_port_ext of struct ahci_host_priv. ahci_mark_external_port() is modified to not set the ATA_PFLAG_EXTERNAL flag for a port if hpriv->mask_port_ext includes the number of the port. In such case, an information message is printed to notify that the external/hotplug capability is being ignored. Reported-by: Dieter Mummenschanz <dmummenschanz@web.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220465 Fixes: 4edf1505b76d ("ata: ahci: Disallow LPM policy control for external ports") Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Tested-by: Dieter Mummenschanz <dmummenschanz@web.de>
2025-08-25net: dsa: lantiq_gswip: store switch API version in privDaniel Golle
Store the switch API version in struct gswip_priv. As the hardware has the 'major/minor' version bytes in the wrong order preventing numerical comparisons the version to be stored in gswip_priv is constructed in such a way that the REV field is the most significant byte and the MOD field the least significant byte. Also provide a conveniance macro to allow comparing the stored version of the hardware against the already defined GSWIP_VERSION_* macros. This is done in order to prepare supporting newer features such as 4096 VLANs and per-port configurable learning which are only available starting from specific hardware versions. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/eddb51ae8d0b2046ca91906e93daad7be5af56d7.1755878232.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: dsa: lantiq_gswip: make DSA tag protocol model-specificDaniel Golle
While the older Lantiq / Intel which are currently supported all use the DSA_TAG_GSWIP tagging protocol, newer MaxLinear GSW1xx modules use another 8-byte tagging protocol. Move the tag protocol information to struct gswip_hw_info to make it possible for new models to specify a different tagging protocol. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/841281b62fdb472048fa98fbad6c88dfbf512825.1755878232.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: dsa: lantiq_gswip: load model-specific microcodeDaniel Golle
Load microcode as specified in struct hw_info instead of relying on a single array of instructions. This is done in preparation to allow loading different microcode for the MaxLinear GSW1xx family. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/486d95c085913d506745fbe4a0ab5d1ebdc3ed63.1755878232.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: dsa: lantiq_gswip: introduce bitmap for MII portsDaniel Golle
Instead of relying on hard-coded numbers for MII ports, introduce a bitmap for MII ports. This is done in order to prepare for supporting MaxLinear GSW1xx ICs which got a different layout of ports. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/019fc8ed06f2317976eac143320d1dc046e8f392.1755878232.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: dsa: lantiq_gswip: move definitions to headerDaniel Golle
Introduce header file and move register definitions as well as the definitions struct gswip_hw_info and struct gswip_priv there. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/551c72c93131cd200b38340741e68ff21793ba0b.1755878232.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: dsa: lantiq_gswip: prepare for more CPU port optionsDaniel Golle
The MaxLinear GSW1xx series of switches support using either the (R)(G)MII interface on port 5 or the SGMII interface on port 4 to be used as CPU port. Prepare for supporting them by defining a mask of allowed CPU ports instead of a single port. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/879c66672d26fe49c1f5d9aa40d8ebc0f31885ab.1755878232.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: dsa: lantiq_gswip: deduplicate dsa_switch_opsDaniel Golle
The two instances of struct dsa_switch_ops differ only by their .phylink_get_caps op. Instead of having two instances of dsa_switch_ops, rather just have a pointer to the phylink_get_caps function in struct gswip_hw_info. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/03d72eceeb3faecdbe03ce58aab40861cf6b77c1.1755878232.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-26clk: spacemit: ccu_pll: 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() using the Coccinelle semantic patch on the cover letter of this series. Signed-off-by: Brian Masney <bmasney@redhat.com> Reviewed-by: Haylen Chu <heylenay@4d2.org> Reviewed-by: Yixun Lan <dlan@kernel.org> Link: https://lore.kernel.org/r/20250811-clk-for-stephen-round-rate-v1-51-b3bf97b038dc@redhat.com Signed-off-by: Yixun Lan <dlan@gentoo.org>
2025-08-26clk: spacemit: ccu_mix: 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() using the Coccinelle semantic patch on the cover letter of this series. Signed-off-by: Brian Masney <bmasney@redhat.com> Reviewed-by: Haylen Chu <heylenay@4d2.org> Reviewed-by: Yixun Lan <dlan@kernel.org> Link: https://lore.kernel.org/r/20250811-clk-for-stephen-round-rate-v1-50-b3bf97b038dc@redhat.com Signed-off-by: Yixun Lan <dlan@gentoo.org>
2025-08-26clk: spacemit: ccu_ddn: 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() using the Coccinelle semantic patch on the cover letter of this series. Signed-off-by: Brian Masney <bmasney@redhat.com> Reviewed-by: Haylen Chu <heylenay@4d2.org> Reviewed-by: Yixun Lan <dlan@kernel.org> Link: https://lore.kernel.org/r/20250811-clk-for-stephen-round-rate-v1-49-b3bf97b038dc@redhat.com Signed-off-by: Yixun Lan <dlan@gentoo.org>
2025-08-25soc: qcom: use no-UBWC config for MSM8956/76Dmitry Baryshkov
Both MSM8956 and MSM8976 have MDSS 1.11 which doesn't support UBWC (although they also have Adreno 510, which might support UBWC). Disable UBWC support for those platforms. Fixes: 1924272b9ce1 ("soc: qcom: Add UBWC config provider") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/668503/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
2025-08-25soc: qcom: add configuration for MSM8929Dmitry Baryshkov
MSM8929 is similar to MSM8939, it doesn't support UBWC. Provide no-UBWC config for the platform. Fixes: 197713d0cf01 ("soc: qcom: ubwc: provide no-UBWC configuration") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/668502/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
2025-08-25soc: qcom: ubwc: add more missing platformsDmitry Baryshkov
Add UBWC configuration for SDA660 (modem-less variant of SDM660), SDM450 (similar to MSM8953), SDM632 (similar to MSM8953) and SM7325 (similar to SC7280). Fixes: 1924272b9ce1 ("soc: qcom: Add UBWC config provider") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/668501/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
2025-08-25soc: qcom: ubwc: use no-uwbc config for MSM8917Dmitry Baryshkov
MSM8917 has MDSS 1.15 and Adreno 308, neither of which support UBWC. Change UBWC configuration to point out that UBWC is not supported on this platform. Fixes: 1924272b9ce1 ("soc: qcom: Add UBWC config provider") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/668500/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
2025-08-25drm/msm/dpu: Add a null ptr check for dpu_encoder_needs_modesetChenyuan Yang
The drm_atomic_get_new_connector_state() can return NULL if the connector is not part of the atomic state. Add a check to prevent a NULL pointer dereference. This follows the same pattern used in dpu_encoder_update_topology() within the same file, which checks for NULL before using conn_state. Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com> Fixes: 1ce69c265a53 ("drm/msm/dpu: move resource allocation to CRTC") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/665188/ Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
2025-08-25floppy: Sort headers alphabeticallyAndy Shevchenko
Sorting headers alphabetically helps locating duplicates, and makes it easier to figure out where to insert new headers. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250825163545.39303-4-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-08-25floppy: Replace custom SZ_64K constantAndy Shevchenko
There are only two headers using the K_64 custom constant. Moreover, its usage tangles a code because the constant is defined in the C file, while users are in the headers. Replace it with well defined SZ_64K from sizes.h. Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250825163545.39303-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-08-25drm/gpuvm: fix various typos in .c and .h gpuvm fileAlice Ryhl
After working with this code for a while, I came across several typos. This patch fixes them. Signed-off-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250825-gpuvm-typo-fix-v1-1-14e9e78e28e6@google.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2025-08-25gpio: sim: don't use GPIO base in debugfs outputBartosz Golaszewski
We're in the process of removing unneeded references to the global GPIO base number treewide. Use the HW offset instead of the base number. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250815111733.79283-1-brgl@bgdev.pl Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-08-25gpio: mmio: Add compatible for the ixp4xx eb MMIOLinus Walleij
The IXP4xx expansion bus can have simple memory-mapped GPIO on it. Using the proper device tree bindings, support probing this directly from the device tree. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250822-ixp4xx-eb-mmio-gpio-v2-3-bd2edd4a9c74@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-08-25ACPI: Use str_low_high() helper in two placesChelsy Ratnawat
Replace hard-coded string choices with the str_low_high() helper in two places in the ACPI code. Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com> Link: https://patch.msgid.link/20250823220311.2035533-1-chelsyratnawat2001@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-08-25ACPI: sysfs: Use ACPI_FREE() for freeing an ACPI objectKaushlendra Kumar
Since str_obj is allocated by ACPICA in acpi_evaluate_object_typed(), it should be free with ACPI_FREE() rather than with kfree(), so use the former instead of the latter for freeing it. Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com> Link: https://patch.msgid.link/20250822061946.472594-1-kaushlendra.kumar@intel.com [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-08-25RDMA/erdma: Use vcalloc() instead of vzalloc()Qianfeng Rong
Replace vzalloc() with vcalloc() in vmalloc_to_dma_addrs(). As noted in the kernel documentation [1], open-coded multiplication in allocator arguments is discouraged because it can lead to integer overflow. Use vcalloc() to gain built-in overflow protection, making memory allocation safer when calculating allocation size compared to explicit multiplication. [1]: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Link: https://patch.msgid.link/r/20250821072209.510348-1-rongqianfeng@vivo.com Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2025-08-25IB/mlx5: Fix obj_type mismatch for SRQ event subscriptionsOr Har-Toov
Fix a bug where the driver's event subscription logic for SRQ-related events incorrectly sets obj_type for RMP objects. When subscribing to SRQ events, get_legacy_obj_type() did not handle the MLX5_CMD_OP_CREATE_RMP case, which caused obj_type to be 0 (default). This led to a mismatch between the obj_type used during subscription (0) and the value used during notification (1, taken from the event's type field). As a result, event mapping for SRQ objects could fail and event notification would not be delivered correctly. This fix adds handling for MLX5_CMD_OP_CREATE_RMP in get_legacy_obj_type, returning MLX5_EVENT_QUEUE_TYPE_RQ so obj_type is consistent between subscription and notification. Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX") Link: https://patch.msgid.link/r/8f1048e3fdd1fde6b90607ce0ed251afaf8a148c.1755088962.git.leon@kernel.org Signed-off-by: Or Har-Toov <ohartoov@nvidia.com> Reviewed-by: Edward Srouji <edwards@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2025-08-25ACPI: video: force native for Lenovo 82K8Mario Limonciello (AMD)
Lenovo 82K8 has a broken brightness control provided by nvidia_wmi_ec. Add a quirk to prevent using it. Reported-by: Wilson Alvarez <wilson.e.alvarez@rubonnek.com> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4512 Tested-by: Wilson Alvarez <wilson.e.alvarez@rubonnek.com> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org> Link: https://patch.msgid.link/20250820170927.895573-1-superm1@kernel.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-08-25bus: fsl-mc: Replace snprintf and sprintf with sysfs_emit in sysfs show ↵Chelsy Ratnawat
functions Use sysfs_emit() instead of snprintf()/sprintf() when writing to sysfs buffers, as recommended by the kernel documentation. Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com> Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/20250822124339.1739290-1-chelsyratnawat2001@gmail.com Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2025-08-25bus: fsl-mc: Check return value of platform_get_resource()Salah Triki
platform_get_resource() returns NULL in case of failure, so check its return value and propagate the error in order to prevent NULL pointer dereference. Fixes: 6305166c8771 ("bus: fsl-mc: Add ACPI support for fsl-mc") Cc: stable@vger.kernel.org Signed-off-by: Salah Triki <salah.triki@gmail.com> Acked-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/aKwuK6TRr5XNYQ8u@pc Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2025-08-25net: phy: aquantia: add support for AQR115Camelia Groza
AQR115 is similar to the already supported AQR115C, having speeds up to 2.5Gbps. In fact, the two differ only in the FCBGA package size (7x11mm vs 7x7mm for the Compact variant). So it makes sense that the feature set is identical for the 2 drivers. This PHY is present on the newest PCB revision E (v4.0) of the NXP LS1046A-RDB, having replaced the RTL8211FS SGMII PHY going to fm1-mac5. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-16-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: promote AQR813 and AQR114C to aqr_gen4_config_init()Vladimir Oltean
I'm not sure whether there is any similar real-life problem on AQR813 and AQR114C as were seen on the PHYs that these commit were written for: - a7f3abcf6357 ("net: phy: aquantia: only poll GLOBAL_CFG regs on aqr113, aqr113c and aqr115c") - bed90b06b681 ("net: phy: aquantia: clear PMD Global Transmit Disable bit during init") but the inconsistency in handling between PHYs of the same generation is striking. Apart from different firmware builds with different provisioning, the only difference between these PHYs should be the max link speed and/or the number of ports. Let's try and see if there's any problem if all PHYs from the same generation use the same config_init() method. Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Cc: Robert Marko <robimarko@gmail.com> Cc: Paweł Owoc <frut3k7@gmail.com> Cc: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-15-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: rename aqr113c_config_init() to aqr_gen4_config_init()Vladimir Oltean
aqr113c_config_init() is called by AQR113, AQR113C, AQR115C, all Gen4 PHYs. Thus, rename this to aqr_gen4_config_init(). Currently, aqr113c_config_init() calls aqr_gen2_config_init(). Since we've established that these are Gen4 PHYs, it makes sense to inherit the Gen3 feature set as well. Currently, aqr_gen3_config_init() just calls aqr_gen2_config_init(), so we can safely make this extra modification and expect no functional change. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-14-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: reimplement aqcs109_config_init() as aqr_gen2_config_init()Vladimir Oltean
I lack documentation for AQCS109, but from commit 99c864667c9f ("net: phy: aquantia: add support for AQCS109"), it is known that "From software point of view, it should be almost equivalent to AQR107." Based on further conjecture of the device numbering scheme, I am treating it as similar to AQR109 (a Gen2 PHY capable of to 2.5G). Its current instructions are also present in other init sequences as below: - aqr_wait_reset_complete() ... aqr107_chip_info() as well as aqr107_set_downshift() are in aqr_gen1_config_init() - aqr_gen2_fill_interface_modes() is in aqr_gen2_config_init() So it would be good to centralize this implementation by just calling aqr_gen2_config_init(). In practice this completes support for the following features, which are present on AQR109 already: - Potentially reverse MDI lane order via "marvell,mdi-cfg-order" - Restore polarity of active-high and active-low LEDs after reset. Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-13-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: call aqr_gen3_config_init() for AQR112 and AQR412(C)Vladimir Oltean
The AQrate Gen3 PHYs are AQR111(C), AQR112(C), and their multi-port variants, like AQR411(C), AQR412(C). Currently, AQR112, AQR412 and AQR412C are Gen3 PHYs supported by the driver which have no config_init() implementation. I have hardware and documentation that confirms they are compatible with the operations done in aqr_gen2_config_init(), a Gen2-level function. This is needed as a preparation for reading cached registers in aqr_gen2_read_status(), which is a function that these PHYs already call. The initial reading is done from: aqr_gen2_config_init() -> aqr_gen2_fill_interface_modes() -> aqr_gen2_read_global_syscfg() thus the need for them to also call aqr_gen2_config_init(), in order for the cached register values to be available. In expectation of Gen3-specific features, introduce aqr_gen3_config_init() which calls aqr_gen2_config_init(). Also modify the AQR111 silicon variants to call their generation-appropriate init function. No functional change for these, hence the minor mention. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-12-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: call aqr_gen2_fill_interface_modes() for AQCS109Vladimir Oltean
I don't have documentation or hardware to test, but according to commit 99c864667c9f ("net: phy: aquantia: add support for AQCS109"), "From software point of view, it should be almost equivalent to AQR107." I am relatively confident that the GLOBAL_CFG registers read by aqr_gen2_fill_interface_modes() are supported, because aqr_gen2_read_status(), currently used by AQCS109, also reads them, and I'm unaware of any reported problem. The change is necessary because a future patch will introduce a requirement for all aqr_gen2_read_status() callers to have previously called aqr_gen2_read_global_syscfg(). This is done through aqr_gen2_fill_interface_modes(). Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-11-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: merge and rename aqr105_read_status() and ↵Vladimir Oltean
aqr107_read_status() aqr105_read_status() and aqr107_read_status() are very similar. In fact, they are identical, save from a code snippet accessing a Gen2 feature (rate adaptation), placed at the end of aqr107_read_rate(), and absent from aqr105_read_rate(). The code structure is: aqr105_read_status() aqr107_read_status() -> aqr105_read_rate() -> aqr107_read_rate() After the recent change "net: phy: aquantia: use cached GLOBAL_CFG registers in aqr107_read_rate()", it is absolutely trivial to restructure the code as follows: aqr_gen2_read_status() -> aqr_gen1_read_status() -> Gen2-specific stuff (read GLOBAL_CFG registers to set rate_matching) Doing so reduces code duplication. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-10-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: use cached GLOBAL_CFG registers in aqr107_read_rate()Vladimir Oltean
aqr107_read_rate() - called from aqr107_read_status() even periodically if there is no PHY IRQ - currently reads GLOBAL_CFG registers to determine what kind of rate adaptation is in use for the current phydev->speed. However, GLOBAL_CFG registers are runtime invariants, so accessing the slow MDIO bus is unnecessary. Reimplement aqr107_read_rate() by reading from the priv->global_cfg[i].rade_adapt variables (where i is the entry corresponding to the current phydev->speed). Making this change also helps disentangle the code delta between aqr105_read_rate() and aqr107_read_rate(). They are now identical up to the code snippet which iterates over priv->global_cfg[]. This will help eliminate the duplicate code in the upcoming patch. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-9-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: remove handling for get_rate_matching(PHY_INTERFACE_MODE_NA)Vladimir Oltean
After commit 7642cc28fd37 ("net: phylink: fix PHY validation with rate adaption"), the API contract changed and PHY drivers are no longer required to respond to the .get_rate_matching() method for PHY_INTERFACE_MODE_NA. This was later followed up by documentation commit 6d4cfcf97986 ("net: phy: Update documentation for get_rate_matching"). As such, handling PHY_INTERFACE_MODE_NA in the Aquantia PHY driver implementation of this method is unnecessary and confusing. Remove it. Cc: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20250821152022.1065237-8-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: save a local shadow of GLOBAL_CFG register valuesVladimir Oltean
Currently, aqr_gen2_fill_interface_modes() reads VEND1_GLOBAL_CFG_* registers to populate phydev->supported_interfaces. But this is not the only place which needs to read these registers. There is also aqr107_read_rate(). Based on the premise that these values are statically set by firmware and the driver only needs to read them, the proposal is to read them only once, at config_init() time, and use the cached values also in aqr107_read_rate(). This patch only refactors the aqr_gen2_fill_interface_modes() code to save the registers to driver memory, and to populate supported_interfaces based on that. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-7-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: fill supported_interfaces for all aqr_gen2_config_init() ↵Vladimir Oltean
callers Since aqr_gen2_config_init() and aqr_gen2_fill_interface_modes() refer to the feature set common to the same generation, it means all callers of aqr_gen2_config_init() also support the Global System Configuration registers at addresses 1E.31B -> 1E.31F, and these should be read by the driver to figure out the list of supported interfaces for phylink. This affects the following PHYs supported by this driver: - Gen2: AQR107 - Gen3: AQR111, AQR111B0 - Gen4: AQR114C, AQR813. AQR113C, a Gen4 PHY, has unmodified logic after this change, because currently, the aqr_gen2_fill_interface_modes() call is chained after aqr_gen2_config_init(), and after this patch, it is tail-called from the latter function, leading to the same code flow. At the same time, move aqr_gen2_fill_interface_modes() upwards of its new caller, aqr_gen2_config_init(), to avoid a forward declaration. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-6-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: rename some aqr107 functions according to generationVladimir Oltean
Establish a more intuitive function naming convention in this driver. A GenX PHY must only call aqr_genY_ functions, where Y <= X. Loosely speaking, aqr107_ is representative of Gen2 and above, except for: - aqr107_config_init() - aqr107_suspend() - aqr107_resume() - aqr107_wait_processor_intensive_op() which are also called by AQR105, so these are renamed to Gen1. Actually aqr107_config_init() is renamed to aqr_gen1_config_init() when called by AQR105, and aqr_gen2_config_init() when called by all other PHYs. The Gen2 function calls the Gen1 function, so there is no functional change. This prefaces further Gen2-specific initialization steps which must be omitted for AQR105. These will be added to aqr_gen2_config_init(). In fact, many PHY drivers call an aqr*_config_init() beneath their generation's feature set: AQR114C is a Gen4 PHY which calls aqr_gen2_config_init(), even though AQR113C, also a Gen4 PHY which differs only in maximum link speed, calls the richer aqr113c_config_init() which also sets phydev->possible_interfaces. Many of the more subtle inconsistencies of this kind will be fixed up in later changes. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20250821152022.1065237-5-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: reorder AQR113C PMD Global Transmit Disable bit clearing ↵Vladimir Oltean
with supported_interfaces Introduced in commit bed90b06b681 ("net: phy: aquantia: clear PMD Global Transmit Disable bit during init"), the clearing of MDIO_PMA_TXDIS plus the call to aqr107_wait_processor_intensive_op() are only by chance placed between aqr107_config_init() and aqr107_fill_interface_modes(). In other words, aqr107_fill_interface_modes() does not depend in any way on these 2 operations. I am only 90% sure of that, and I intend to move aqr107_fill_interface_modes() to be a part of aqr107_config_init() in the future. So to isolate the issue for blame attribution purposes, make these 2 functions adjacent to each other again. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20250821152022.1065237-4-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: merge aqr113c_fill_interface_modes() into ↵Vladimir Oltean
aqr107_fill_interface_modes() I'm unsure whether intentionate or not, but I think the (partially observed) naming convention in this driver is that function prefixes denote the earliest generation when a feature is available. In case of aqr107_fill_interface_modes(), that means that the GLOBAL_CFG registers are a Gen2 feature. Supporting evidence: the AQR105, a Gen1 PHY, does not have these registers, thus the function is not named aqr105_*. Based on this inferred naming scheme, I am proposing a refinement of commit a7f3abcf6357 ("net: phy: aquantia: only poll GLOBAL_CFG regs on aqr113, aqr113c and aqr115c") which introduced aqr113c_fill_interface_modes(), suggesting this may be a Gen4 PHY feature. The long-term goal is for aqr107_config_init() to tail-call aqr107_fill_interface_modes(), such that the latter function is also called by AQR107 itself, and many other PHY drivers. Currently it can't, because aqr113c_config_init() calls aqr107_config_init() and then aqr113c_fill_interface_modes(). So this would lead to a duplicate call to aqr107_fill_interface_modes() for AQR113C. Centralize the reading of GLOBAL_CFG registers in the AQR107 method, and create a boolean, set to true by AQR113C, which tests whether waiting for a non-zero value in the GLOBAL_CFG_100M register is necessary. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20250821152022.1065237-3-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25net: phy: aquantia: rename AQR412 to AQR412C and add real AQR412Vladimir Oltean
I have noticed from schematics and firmware images that the PHY for which I've previously added support in commit 973fbe68df39 ("net: phy: aquantia: add AQR112 and AQR412 PHY IDs") is actually an AQR412C, not AQR412. These are actually PHYs from the same generation, and Marvell documents them as differing only in the size of the FCCSP package: 19x19 mm for the AQR412, vs 14x12mm for the Compact AQR412C. I don't think there is any point in backporting this to stable kernels, since the PHYs are identical in capabilities, and no functional difference is expected regardless of how the PHY is identified. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20250821152022.1065237-2-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25RDMA/mlx5: Fix vport loopback forcing for MPV devicePatrisious Haddad
Previously loopback for MPV was supposed to be permanently enabled, however other driver flows were able to over-ride that configuration and disable it. Add force_lb parameter that indicates that loopback should always be enabled which prevents all other driver flows from disabling it. Fixes: a9a9e68954f2 ("RDMA/mlx5: Fix vport loopback for MPV device") Link: https://patch.msgid.link/r/cfc6b1f0f99f8100b087483cc14da6025317f901.1755088808.git.leon@kernel.org Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2025-08-25RDMA/mlx5: Better estimate max_qp_wr to reflect WQE countOr Har-Toov
The mlx5 driver currently derives max_qp_wr directly from the log_max_qp_sz HCA capability: props->max_qp_wr = 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz); However, this value represents the number of WQEs in units of Basic Blocks (see MLX5_SEND_WQE_BB), not actual number of WQEs. Since the size of a WQE can vary depending on transport type and features (e.g., atomic operations, UMR, LSO), the actual number of WQEs can be significantly smaller than the WQEBB count suggests. This patch introduces a conservative estimation of the worst-case WQE size — considering largest segments possible with 1 SGE and no inline data or special features. It uses this to derive a more accurate max_qp_wr value. Fixes: 938fe83c8dcb ("net/mlx5_core: New device capabilities handling") Link: https://patch.msgid.link/r/7d992c9831c997ed5c33d30973406dc2dcaf5e89.1755088725.git.leon@kernel.org Reported-by: Chuck Lever <cel@kernel.org> Closes: https://lore.kernel.org/all/20250506142202.GJ2260621@ziepe.ca/ Signed-off-by: Or Har-Toov <ohartoov@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>