linux/drivers/phy
Sven Peter 7d55b44e2b phy: apple: atc: Actually check return value of devm_apple_tunable_parse
Let's actually check the return value of devm_apple_tunable_parse
instead of trying to check IS_ERR on a pointer to the return value which
is always going to be valid. This prevent a oops when the tunables are
invalid or when they don't exist:

[   57.664567] Unable to handle kernel paging request at virtual address fffffffffffffffe
[   57.664584] Mem abort info:
[   57.664589]   ESR = 0x0000000096000007
[   57.664595]   EC = 0x25: DABT (current EL), IL = 32 bits
[   57.664602]   SET = 0, FnV = 0
[   57.664607]   EA = 0, S1PTW = 0
[   57.664611]   FSC = 0x07: level 3 translation fault
[   57.664617] Data abort info:
[   57.664621]   ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000
[   57.664626]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[   57.664631]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[   57.664640] swapper pgtable: 16k pages, 47-bit VAs, pgdp=0000000b4391c000
[   57.664647] [fffffffffffffffe] pgd=0000000000000000, p4d=0000000000000000, pud=0000000b44188403, pmd=0000000b4418c403, pte=0000000000000000
[   57.664670] Internal error: Oops: 0000000096000007 [#1]  SMP
[   57.665047] CPU: 1 UID: 0 PID: 23 Comm: kworker/1:0 Tainted: G S                  6.18.2+ #2 PREEMPTLAZY
[   57.665061] Tainted: [S]=CPU_OUT_OF_SPEC
[   57.665066] Hardware name: Apple Mac mini (M1, 2020) (DT)
[   57.665072] Workqueue: events cd321x_update_work [tps6598x]
[   57.665100] pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
[   57.665111] pc : apple_tunable_apply+0x8/0x80 [apple_tunable]
[   57.665121] lr : atcphy_mux_set+0x3e0/0x1138 [phy_apple_atc]
[   57.665133] sp : ffffc000802a7c00
[   57.665138] x29: ffffc000802a7c00 x28: 0000000000000003 x27: ffff800016c84080
[   57.665151] x26: 0000000000000002 x25: ffff800016c84090 x24: ffff800016c8408f
[   57.665163] x23: 0000000000020004 x22: 0000000000000001 x21: 0000000000000006
[   57.665175] x20: ffff80000d6da9b0 x19: ffff80000d6da880 x18: 0000000000000002
[   57.665188] x17: 0000000000000000 x16: ffffe22de59e0e38 x15: 0000000000000002
[   57.665199] x14: ffffe22de76ecff8 x13: 0000000000000001 x12: ffff9dd5f90bc000
[   57.665211] x11: 00000000000000c0 x10: 048abc15ceba0919 x9 : ffffe22dbc5fde10
[   57.665223] x8 : ffff80000175e0d8 x7 : 0000000000000004 x6 : 0000000000000000
[   57.665234] x5 : 0000000000000001 x4 : 0000000d6d132db7 x3 : 00000000000155db
[   57.665246] x2 : 0000000000000000 x1 : fffffffffffffffe x0 : ffffc00082b80000
[   57.665258] Call trace:
[   57.665265]  apple_tunable_apply+0x8/0x80 [apple_tunable] (P)
[   57.665276]  typec_mux_set+0x74/0xe0 [typec]
[   57.665315]  cd321x_update_work+0x440/0x8c0 [tps6598x]
[   57.665332]  process_one_work+0x178/0x3d0
[   57.665346]  worker_thread+0x260/0x390
[   57.665354]  kthread+0x150/0x250
[   57.665369]  ret_from_fork+0x10/0x20
[   57.665386] Code: e69a0ae8 ffffe22d aa1e03e9 d503201f (f9400022)
[   57.665394] ---[ end trace 0000000000000000 ]---

Reported-by: Thomas Glanzmann <thomas@glanzmann.de>
Fixes: 8e98ca1e74 ("phy: apple: Add Apple Type-C PHY")
Signed-off-by: Sven Peter <sven@kernel.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260104-atcphy-tunable-fix-v2-1-84e5c2a57aaa@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-01-14 19:42:53 +05:30
..
allwinner phy: sun4i-usb: replace use of system_wq with system_percpu_wq 2026-01-14 14:54:17 +05:30
amlogic phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe 2025-04-11 17:07:15 +05:30
apple phy: apple: atc: Actually check return value of devm_apple_tunable_parse 2026-01-14 19:42:53 +05:30
broadcom phy: broadcom: bcm63xx-usbh: fix section mismatches 2025-11-20 22:01:55 +05:30
cadence phy: cadence-torrent: Add PCIe + XAUI multilink configuration for 100MHz refclk 2026-01-14 15:03:09 +05:30
freescale phy: freescale: phy-fsl-samsung-hdmi: convert from round_rate() to determine_rate() 2025-12-24 12:53:35 +05:30
hisilicon phy: hisilicon: Remove redundant ternary operators 2025-09-01 18:13:54 +05:30
ingenic phy: ingenic: use core driver model helper to handle probe errors 2025-08-20 22:25:38 +05:30
intel phy: Switch back to struct platform_driver::remove() 2024-10-17 20:33:03 +05:30
lantiq phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30
marvell phy: drop probe registration printks 2025-06-16 22:54:21 +05:30
mediatek phy: adjust function name reference 2026-01-01 15:55:23 +05:30
microchip phy: PHY_LAN966X_SERDES should depend on SOC_LAN966 || MCHP_LAN966X_PCI 2025-02-14 18:04:57 +05:30
motorola phy: mapphone-mdm6600: use gpiod_multi_set_value_cansleep 2025-02-17 14:27:34 +01:00
mscc phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30
nuvoton phy: nuvoton: add new driver for the Nuvoton MA35 SoC USB 2.0 PHY 2024-08-29 23:52:37 +05:30
qualcomm phy: qcom: edp: Fix NULL pointer dereference for phy v6 (x1e80100) 2026-01-14 19:07:30 +05:30
ralink phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30
realtek USB / Thunderbolt (USB4) changes for 6.13-rc1 2024-11-29 11:19:31 -08:00
renesas phy: renesas: rcar-gen2: Simplify with scoped for each OF child loop 2026-01-01 16:28:56 +05:30
rockchip phy: rockchip: usb: Simplify with scoped for each OF child loop 2026-01-01 16:28:56 +05:30
samsung phy: exynos5-usbdrd: support SS combo phy for ExynosAutov920 2025-12-23 23:11:05 +05:30
socionext phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30
sophgo phy: sophgo: Remove unused of_gpio.h 2025-11-12 20:35:50 +05:30
spacemit phy: spacemit: support K1 USB2.0 PHY controller 2026-01-01 16:25:49 +05:30
st phy: drop probe registration printks 2025-06-16 22:54:21 +05:30
starfive phy: starfive: jh7110-usb: Fix USB 2.0 host occasional detection failure 2025-05-14 09:45:12 +01:00
sunplus phy: sunplus: return negative error code in sp_usb_phy_probe 2023-11-27 18:39:18 +05:30
tegra phy: tegra: xusb: fix device and OF node leak at probe 2025-08-12 21:30:00 +05:30
ti phy: ti: phy-j721e-wiz: convert from round_rate() to determine_rate() 2025-12-24 12:53:36 +05:30
xilinx phy-zynqmp: Postpone getting clock rate until actually needed 2025-05-14 09:48:01 +01:00
Kconfig phy common properties 2026-01-14 18:52:57 +05:30
Makefile phy common properties 2026-01-14 18:52:57 +05:30
phy-airoha-pcie-regs.h phy: airoha: Fix REG_CSR_2L_RX{0,1}_REV0 definitions 2024-10-17 20:52:48 +05:30
phy-airoha-pcie.c phy: airoha: Fix REG_CSR_2L_JCPLL_SDM_HREN config in airoha_pcie_phy_init_ssc_jcpll() 2024-10-17 20:52:48 +05:30
phy-can-transceiver.c phy: phy-can-transceiver: Add support for TJA105{1,7} 2025-11-12 20:11:16 +05:30
phy-common-props-test.c phy: add phy_get_rx_polarity() and phy_get_tx_polarity() 2026-01-14 18:16:05 +05:30
phy-common-props.c phy: add phy_get_rx_polarity() and phy_get_tx_polarity() 2026-01-14 18:16:05 +05:30
phy-core-mipi-dphy.c phy: dphy: add support to calculate the timing based on hs_clk_rate 2022-10-27 14:38:04 +03:00
phy-core.c phy: core: Simplify with scoped for each OF child loop 2026-01-01 16:28:56 +05:30
phy-lgm-usb.c phy: Switch back to struct platform_driver::remove() 2024-10-17 20:33:03 +05:30
phy-lpc18xx-usb-otg.c
phy-nxp-ptn3222.c phy: add NXP PTN3222 eUSB2 to USB2 redriver 2024-10-17 20:48:27 +05:30
phy-pistachio-usb.c
phy-snps-eusb2.c phy-for-6.17 2025-08-01 12:31:50 -07:00
phy-spacemit-k1-pcie.c phy: spacemit: Introduce PCIe/combo PHY 2025-12-23 23:11:03 +05:30
phy-xgene.c phy: constify of_phandle_args in xlate 2024-02-23 17:43:14 +05:30