Update: Root cause found and workaround confirmed
After extensive debugging, we’ve identified the root cause of the SC16IS752 (/dev/ttySC*) devices disappearing on newer balenaOS versions (kernel 6.x+).
Root cause:
Starting with Linux kernel ~6.8+, the sc16is7xx driver was split into three separate kernel modules:
| Module |
Role |
sc16is7xx.ko |
Core driver (serial logic) |
sc16is7xx_i2c.ko |
I2C bus registration |
sc16is7xx_spi.ko |
SPI bus registration |
On older kernels (5.15 in balenaOS 6.1.24), the single sc16is7xx.ko module handled everything. On kernel 6.12 (balenaOS 6.10.24), the DT overlay sc16is752-i2c correctly loads sc16is7xx.ko via modalias matching, but does not trigger loading of sc16is7xx_i2c.ko, which is the module that actually registers the I2C driver.
The result: the device tree node is correctly populated (/proc/device-tree/soc/i2c@7e804000/sc16is752@4d exists), the I2C device is detected in sysfs (/sys/bus/i2c/devices/1-004d exists), the core module is loaded (lsmod | grep sc16is shows sc16is7xx), but no I2C driver is registered (/sys/bus/i2c/drivers/sc16is7xx/ does not exist), so the device never gets probed and /dev/ttySC* never appears.
Workaround:
modprobe sc16is7xx_i2c
This immediately creates /dev/ttySC0 and /dev/ttySC1. Confirmed on a Raspberry Pi 4 running balenaOS 6.10.24 (kernel 6.12.61-v8).
However this is volatile and lost on reboot. We’re currently looking for a way to make this persistent.
Suggested fix for balenaOS:
The sc16is7xx_i2c.ko (and sc16is7xx_spi.ko) modules should have proper modules.dep entries so that modprobe sc16is7xx automatically pulls in the bus-specific sub-modules, or the DT overlay modalias resolution should trigger loading of the correct sub-module. This seems like a module dependency / depmod issue that should be addressed at the OS level.
Diagnostic comparison (same fleet, same DT overlay config):
|
balenaOS 6.1.24 (works) |
balenaOS 6.10.24 (broken) |
| Kernel |
5.15.92-v8 |
6.12.61-v8 |
sc16is7xx.ko |
single module, registers I2C driver |
core only, no bus registration |
sc16is7xx_i2c.ko |
does not exist |
exists but not auto-loaded |
/dev/ttySC* |
present |
missing |
After modprobe sc16is7xx_i2c |
n/a |
fixed |
Could the balena team look into ensuring proper module dependency resolution for split kernel drivers in newer OS versions?
BR,
Firat.