Executive brief
The Linux kernel's pinctrl (pin control) subsystem contains a logic error in the SpacemiT K1 SoC pin configuration handler that causes hardware pin configuration settings to be silently ignored for the first GPIO pin in each group. This prevents proper initialization of critical pins like those used for Ethernet (GMAC) connectivity, potentially resulting in non-functional network hardware or other peripheral failures on affected devices.
Technical details
The spacemit_pin_set_config() function in the pinctrl-k1 driver checks the wrong variable when validating whether a pin lookup succeeded. The code retrieves a pin descriptor via spacemit_get_pin(pctrl, pin) into variable 'spin', but then checks 'if (!pin)' instead of 'if (!spin)'. Since 'pin' is an unsigned int pin ID and 0 is a valid pin identifier (GPIO_0), this incorrectly rejects pin 0, causing its PAD configuration (drive-strength and bias settings) to be silently dropped. The fix changes the check to validate 'spin' (the pointer) instead, preventing NULL-pointer dereference on spin->pin and restoring proper configuration for pin 0. The bug affects all kernel versions since the SpacemiT K1 support was added; patch commits 09c816e5c4d3 and 7a551951ebeb are available in stable trees.
Affected products
- Linux Linux Kernel all versions with spacemit pinctrl support (Linux 5.13+)
Timeline
- 2026-08-28: disclosed
- 2026-05-25: patched