Skip to contentSkip to conversation

toradex: select EVENT for TDX_CFG_BLOCK

PATCH In review Mehmet Fide 3 participants 3 messages Aug 7 – Aug 12

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toradex: select EVENT for TDX_CFG_BLOCK

From: Mehmet Fide <[email protected]>

The Toradex config block is read by settings_r(), which is reachable only as an event spy:

  EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);

board_r.c does call INITCALL_EVT(EVT_SETTINGS_R) unconditionally, but with CONFIG_EVENT disabled event_notify_null() is an empty inline, so the spy is never reached and settings_r() never runs. Nothing else selects EVENT for colibri_vf, and CONFIG_EVENT has no prompt, so a defconfig cannot turn it on by itself.

The effect is that serial#, ethaddr and eth1addr are never populated from the config block. serial# in turn is what fdt_root() copies into the device tree as "serial-number", so Linux loses /proc/device-tree/serial-number along with anything deriving a MAC address or a device identity from it. The failure is quiet: a module whose saved environment predates the conversion to the event framework keeps the old values and looks healthy until the environment is rewritten.

Verified on a Colibri VF50. Before the change "printenv serial#" reports "not defined" and no "MISSING TORADEX CONFIG BLOCK" is printed, which is the signature of the spy never running. After it the banner shows

Model: Toradex 0013 Colibri VF50 128MB IT V1.2B
Serial#: 03135809

and Linux finds /proc/device-tree/serial-number again.

TDX_CFG_BLOCK cannot work without the spy, so select what it needs.

---
 board/toradex/common/Kconfig | 1 +
 1 file changed, 1 insertion(+)
board/toradex/common/Kconfig +1 -0
index b85893ab44e..05f8341e4c3 100644
@@ -3,6 +3,7 @@
 
 menuconfig TDX_CFG_BLOCK
 	bool "Enable Toradex config block support"
+	select EVENT
 	select OF_BOARD_SETUP
 	select SYSINFO
 	help
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Mehmet Fide

From: Mehmet Fide <[email protected]>

The Toradex config block is read by settings_r(), which is reachable only as an event spy:

  EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);

board_r.c does call INITCALL_EVT(EVT_SETTINGS_R) unconditionally, but with CONFIG_EVENT disabled event_notify_null() is an empty inline, so the spy is never reached and settings_r() never runs. Nothing else selects EVENT for colibri_vf, and CONFIG_EVENT has no prompt, so a defconfig cannot turn it on by itself.

The effect is that serial#, ethaddr and eth1addr are never populated from the config block. serial# in turn is what fdt_root() copies into the device tree as "serial-number", so Linux loses /proc/device-tree/serial-number along with anything deriving a MAC address or a device identity from it. The failure is quiet: a module whose saved environment predates the conversion to the event framework keeps the old values and looks healthy until the environment is rewritten.

Verified on a Colibri VF50. Before the change "printenv serial#" reports "not defined" and no "MISSING TORADEX CONFIG BLOCK" is printed, which is the signature of the spy never running. After it the banner shows

Quoted 8 lines

Model: Toradex 0013 Colibri VF50 128MB IT V1.2B
Serial#: 03135809

and Linux finds /proc/device-tree/serial-number again.

TDX_CFG_BLOCK cannot work without the spy, so select what it needs.

Fixes 118b17b84fc7 ("toradex: common: Use SETTINGS_R event to read toradex config block")
Signature · 1 line
Tom
Acked-by on v1 1/1
#2 lore raw
In reply to Mehmet Fide
Quoted 27 lines · Mehmet Fide

From: Mehmet Fide <[email protected]>

The Toradex config block is read by settings_r(), which is reachable only as an event spy:

  EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);

board_r.c does call INITCALL_EVT(EVT_SETTINGS_R) unconditionally, but with CONFIG_EVENT disabled event_notify_null() is an empty inline, so the spy is never reached and settings_r() never runs. Nothing else selects EVENT for colibri_vf, and CONFIG_EVENT has no prompt, so a defconfig cannot turn it on by itself.

The effect is that serial#, ethaddr and eth1addr are never populated from the config block. serial# in turn is what fdt_root() copies into the device tree as "serial-number", so Linux loses /proc/device-tree/serial-number along with anything deriving a MAC address or a device identity from it. The failure is quiet: a module whose saved environment predates the conversion to the event framework keeps the old values and looks healthy until the environment is rewritten.

Verified on a Colibri VF50. Before the change "printenv serial#" reports "not defined" and no "MISSING TORADEX CONFIG BLOCK" is printed, which is the signature of the spy never running. After it the banner shows

Quoted 8 lines

Model: Toradex 0013 Colibri VF50 128MB IT V1.2B
Serial#: 03135809

and Linux finds /proc/device-tree/serial-number again.

TDX_CFG_BLOCK cannot work without the spy, so select what it needs.