linux/drivers/soc
Nishanth Menon 90a88306eb net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error
Make knav_dma_open_channel consistently return NULL on error instead
of ERR_PTR. Currently the header include/linux/soc/ti/knav_dma.h
returns NULL when the driver is disabled, but the driver
implementation does not even return NULL or ERR_PTR on failure,
causing inconsistency in the users. This results in a crash in
netcp_free_navigator_resources as followed (trimmed):

Unhandled fault: alignment exception (0x221) at 0xfffffff2
[fffffff2] *pgd=80000800207003, *pmd=82ffda003, *pte=00000000
Internal error: : 221 [#1] SMP ARM
Modules linked in:
CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.17.0-rc7 #1 NONE
Hardware name: Keystone
PC is at knav_dma_close_channel+0x30/0x19c
LR is at netcp_free_navigator_resources+0x2c/0x28c

[... TRIM...]

Call trace:
 knav_dma_close_channel from netcp_free_navigator_resources+0x2c/0x28c
 netcp_free_navigator_resources from netcp_ndo_open+0x430/0x46c
 netcp_ndo_open from __dev_open+0x114/0x29c
 __dev_open from __dev_change_flags+0x190/0x208
 __dev_change_flags from netif_change_flags+0x1c/0x58
 netif_change_flags from dev_change_flags+0x38/0xa0
 dev_change_flags from ip_auto_config+0x2c4/0x11f0
 ip_auto_config from do_one_initcall+0x58/0x200
 do_one_initcall from kernel_init_freeable+0x1cc/0x238
 kernel_init_freeable from kernel_init+0x1c/0x12c
 kernel_init from ret_from_fork+0x14/0x38
[... TRIM...]

Standardize the error handling by making the function return NULL on
all error conditions. The API is used in just the netcp_core.c so the
impact is limited.

Note, this change, in effect reverts commit 5b6cb43b4d ("net:
ethernet: ti: netcp_core: return error while dma channel open issue"),
but provides a less error prone implementation.

Suggested-by: Simon Horman <horms@kernel.org>
Suggested-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20251103162811.3730055-1-nm@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-11-04 19:15:36 -08:00
..
amlogic soc: amlogic: clk-measure: Add support for S4 2025-04-22 14:15:19 +02:00
apple soc: apple: sart: Add SARTv0 support 2025-09-06 08:02:52 +00:00
aspeed soc: aspeed: socinfo: Add AST27xx silicon IDs 2025-08-11 09:37:53 +09:30
atmel ARM: at91: Add Support in SoC driver for SAMA7D65 2025-02-24 12:16:28 +02:00
bcm mips: Replace __ASSEMBLY__ with __ASSEMBLER__ in the mips headers 2025-08-29 22:34:29 +02:00
canaan soc: canaan: Deprecate SOC_CANAAN and use SOC_CANAAN_K210 for K210 2024-04-05 16:42:50 +01:00
cirrus soc: ep93xx: drop reference to removed EP93XX_SOC_COMMON config 2024-09-26 12:58:18 +00:00
dove A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
fsl sound updates for 6.18-rc1 2025-10-02 11:37:19 -07:00
fujitsu soc: Switch back to struct platform_driver::remove() 2024-11-01 17:08:57 +01:00
gemini
hisilicon soc: hisilicon: kunpeng_hccs: Fix spelling mistake "decrese" -> "decrease" 2025-08-28 11:23:08 +00:00
imx soc: imx8m: Dump higher 64bits UID 2025-05-09 18:16:28 +08:00
ixp4xx soc: Switch back to struct platform_driver::remove() 2024-11-01 17:08:57 +01:00
lantiq
litex drivers/soc/litex: Use devm_register_restart_handler() 2025-01-19 14:05:35 -05:00
loongson soc: loongson: loongson2_guts: Add check for devm_kstrdup() 2025-02-20 22:29:05 +01:00
mediatek soc: mediatek: mtk-svs: fix device leaks on mt8192 probe failure 2025-09-10 11:48:56 +02:00
microchip soc: Switch back to struct platform_driver::remove() 2024-11-01 17:08:57 +01:00
nuvoton soc: nuvoton: Add SoC info driver for WPCM450 2023-02-01 17:11:36 +01:00
pxa soc: Switch back to struct platform_driver::remove() 2024-11-01 17:08:57 +01:00
qcom soc: driver updates for 6.18 2025-10-01 17:32:51 -07:00
renesas soc: renesas: Identify R-Car X5H 2025-09-11 20:21:42 +02:00
rockchip soc: rockchip: grf: switch to FIELD_PREP_WM16_CONST macro 2025-09-02 19:59:37 -04:00
samsung soc: samsung: exynos-pmu: Enable CPU Idle for gs101 2025-08-11 09:04:54 +02:00
sophgo soc: sophgo: cv1800: rtcsys: New driver (handling RTC only) 2025-05-07 08:40:02 +08:00
sunxi soc: sunxi: sram: register regmap as syscon 2025-09-10 20:51:26 +08:00
tegra soc: driver updates for 6.18 2025-10-01 17:32:51 -07:00
ti net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error 2025-11-04 19:15:36 -08:00
ux500
versatile soc: versatile: enable compile testing 2024-08-30 15:40:11 +02:00
vt8500 soc: Add VIA/WonderMedia SoC identification driver 2025-05-04 19:27:01 +02:00
xilinx arm64: ZynqMP SoC changes for 6.13 2024-11-04 14:31:16 +01:00
Kconfig RISC-V SoC for v6.16 2025-05-21 19:25:08 +02:00
Makefile RISC-V SoC for v6.16 2025-05-21 19:25:08 +02:00