net/ena: fix missing lock when update devlink params
Subsystems (3)
PATCH 1/1 net/ena: fix missing lock when update devlink params
From: Frank Liang <[email protected]>
Fix assert lock warning while calling devl_param_driverinit_value_set() in ena.
WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90 Call Trace: <TASK> devl_param_driverinit_value_set+0x15/0x1c0 ena_devlink_alloc+0x18c/0x220 [ena] ? __pfx_ena_devlink_alloc+0x10/0x10 [ena] ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? devm_ioremap_wc+0x9a/0xd0 ena_probe+0x4d2/0x1b20 [ena] ? __lock_acquire+0x56a/0xbd0 ? __pfx_ena_probe+0x10/0x10 [ena] ? local_clock+0x15/0x30 ? __lock_release.isra.0+0x1c9/0x340 ? mark_held_locks+0x40/0x70 ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170 ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? __pfx_ena_probe+0x10/0x10 [ena] ...... </TASK>
--- drivers/net/ethernet/amazon/ena/ena_devlink.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/amazon/ena/ena_devlink.c +4 -0
@@ -53,10 +53,12 @@ void ena_devlink_disable_phc_param(struct devlink *devlink) {union devlink_param_value value; +devl_lock (devlink); value.vbool = false;devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink); }static void ena_devlink_port_register (struct devlink *devlink)
@@ -144,11 +146,13 @@ static int ena_devlink_configure_params(struct devlink *devlink)netdev_err (adapter->netdev,"Failed to register devlink params\n" );return rc; } +devl_lock (devlink); value.vbool =ena_phc_is_enabled (adapter);devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink);return 0 ; }
Signature · 1 line
2.52.0
Quoted 63 lines
Fix assert lock warning while calling
devl_param_driverinit_value_set()in ena.WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90 Call Trace: <TASK> devl_param_driverinit_value_set+0x15/0x1c0 ena_devlink_alloc+0x18c/0x220 [ena] ? __pfx_ena_devlink_alloc+0x10/0x10 [ena] ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? devm_ioremap_wc+0x9a/0xd0 ena_probe+0x4d2/0x1b20 [ena] ? __lock_acquire+0x56a/0xbd0 ? __pfx_ena_probe+0x10/0x10 [ena] ? local_clock+0x15/0x30 ? __lock_release.isra.0+0x1c9/0x340 ? mark_held_locks+0x40/0x70 ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170 ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? __pfx_ena_probe+0x10/0x10 [ena] ...... </TASK>Signed-off-by Frank Liang <[email protected] <mailto:[email protected]>>---
drivers/net/ethernet/amazon/ena/ena_devlink.c| 4 ++++1 file changed, 4 insertions(+)drivers/net/ethernet/amazon/ena/ena_devlink.c +2
-0@@ -53,10 +53,12 @@ void ena_devlink_disable_phc_param(struct devlink *devlink) {union devlink_param_value value; +devl_lock (devlink); value.vbool = false;devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink); }static void
ena_devlink_port_register(struct devlink *devlink)
drivers/net/ethernet/amazon/ena/ena_devlink.c static int ena_devlink_configure_params(struct devlink *devlink) · line 149
Quoted 4 lines
drivers/net/ethernet/amazon/ena/ena_devlink.c +1
-0@@ -144,11 +146,13 @@ static int ena_devlink_configure_params(struct devlink *devlink)netdev_err (adapter->netdev,"Failed to register devlink params\n" );return rc; } +devl_lock (devlink);
Can you please move the call to be above "value.vbool =" and maintain the newline after the "}"?
drivers/net/ethernet/amazon/ena/ena_devlink.c static int ena_devlink_configure_params(struct devlink *devlink) · line 158
Quoted 11 lines
drivers/net/ethernet/amazon/ena/ena_devlink.c +1
-0value.vbool =ena_phc_is_enabled (adapter);devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink);return 0 ; }
Thanks for identifying the issue and making the change. Added a small nit.
PATCH v2 1/1 net/ena: fix missing lock when update devlink params
In reply to Xiao LiangFrom: Frank Liang <[email protected]>
Fix assert lock warning while calling devl_param_driverinit_value_set() in ena.
WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90 Call Trace: <TASK> devl_param_driverinit_value_set+0x15/0x1c0 ena_devlink_alloc+0x18c/0x220 [ena] ? __pfx_ena_devlink_alloc+0x10/0x10 [ena] ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? devm_ioremap_wc+0x9a/0xd0 ena_probe+0x4d2/0x1b20 [ena] ? __lock_acquire+0x56a/0xbd0 ? __pfx_ena_probe+0x10/0x10 [ena] ? local_clock+0x15/0x30 ? __lock_release.isra.0+0x1c9/0x340 ? mark_held_locks+0x40/0x70 ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170 ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? __pfx_ena_probe+0x10/0x10 [ena] ...... </TASK>
--- drivers/net/ethernet/amazon/ena/ena_devlink.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/amazon/ena/ena_devlink.c +4 -0
@@ -53,10 +53,12 @@ void ena_devlink_disable_phc_param(struct devlink *devlink) {union devlink_param_value value; +devl_lock (devlink); value.vbool = false;devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink); }static void ena_devlink_port_register (struct devlink *devlink)
@@ -145,10 +147,12 @@ static int ena_devlink_configure_params(struct devlink *devlink)return rc; } +devl_lock (devlink); value.vbool =ena_phc_is_enabled (adapter);devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink);return 0 ; }
Signature · 1 line
2.52.0
Quoted 73 lines
From: Frank Liang <[email protected]>
Fix assert lock warning while calling
devl_param_driverinit_value_set()in ena.WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90 Call Trace: <TASK> devl_param_driverinit_value_set+0x15/0x1c0 ena_devlink_alloc+0x18c/0x220 [ena] ? __pfx_ena_devlink_alloc+0x10/0x10 [ena] ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? devm_ioremap_wc+0x9a/0xd0 ena_probe+0x4d2/0x1b20 [ena] ? __lock_acquire+0x56a/0xbd0 ? __pfx_ena_probe+0x10/0x10 [ena] ? local_clock+0x15/0x30 ? __lock_release.isra.0+0x1c9/0x340 ? mark_held_locks+0x40/0x70 ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170 ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? __pfx_ena_probe+0x10/0x10 [ena] ...... </TASK>Signed-off-by Frank Liang <[email protected]>Reviewed-by David Arinzon <[email protected]>---
drivers/net/ethernet/amazon/ena/ena_devlink.c| 4 ++++1 file changed, 4 insertions(+)drivers/net/ethernet/amazon/ena/ena_devlink.c +4
-1@@ -53,10 +53,12 @@ void ena_devlink_disable_phc_param(struct devlink *devlink) {union devlink_param_value value; +devl_lock (devlink); value.vbool = false;devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink); }static void ena_devlink_port_register (struct devlink *devlink)@@ -145,10 +147,12 @@ static int ena_devlink_configure_params(struct devlink *devlink)return rc; } +devl_lock (devlink); value.vbool =ena_phc_is_enabled (adapter);devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink);return 0 ; } --
Quoted 1 line
2.52.0
LGTM. Thanks for making the change.
Quoted 36 lines · Wed, Dec 31, 2025 at 02:20:30AM +0100, [email protected] wrote:
From: Frank Liang <[email protected]>
Fix assert lock warning while calling
devl_param_driverinit_value_set()in ena.WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90 Call Trace: <TASK> devl_param_driverinit_value_set+0x15/0x1c0 ena_devlink_alloc+0x18c/0x220 [ena] ? __pfx_ena_devlink_alloc+0x10/0x10 [ena] ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? devm_ioremap_wc+0x9a/0xd0 ena_probe+0x4d2/0x1b20 [ena] ? __lock_acquire+0x56a/0xbd0 ? __pfx_ena_probe+0x10/0x10 [ena] ? local_clock+0x15/0x30 ? __lock_release.isra.0+0x1c9/0x340 ? mark_held_locks+0x40/0x70 ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170 ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? __pfx_ena_probe+0x10/0x10 [ena] ...... </TASK>
Quoted 2 lines
Signed-off-by Frank Liang <[email protected]>Reviewed-by David Arinzon <[email protected]>
Missing "Fixes" tag?
PATCH v3 1/1 net/ena: fix missing lock when update devlink params
In reply to Xiao LiangFrom: Frank Liang <[email protected]>
Fix assert lock warning while calling devl_param_driverinit_value_set() in ena.
WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90 Call Trace: <TASK> devl_param_driverinit_value_set+0x15/0x1c0 ena_devlink_alloc+0x18c/0x220 [ena] ? __pfx_ena_devlink_alloc+0x10/0x10 [ena] ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? devm_ioremap_wc+0x9a/0xd0 ena_probe+0x4d2/0x1b20 [ena] ? __lock_acquire+0x56a/0xbd0 ? __pfx_ena_probe+0x10/0x10 [ena] ? local_clock+0x15/0x30 ? __lock_release.isra.0+0x1c9/0x340 ? mark_held_locks+0x40/0x70 ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170 ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? __pfx_ena_probe+0x10/0x10 [ena] ...... </TASK>
--- drivers/net/ethernet/amazon/ena/ena_devlink.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/amazon/ena/ena_devlink.c +4 -0
@@ -53,10 +53,12 @@ void ena_devlink_disable_phc_param(struct devlink *devlink) {union devlink_param_value value; +devl_lock (devlink); value.vbool = false;devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink); }static void ena_devlink_port_register (struct devlink *devlink)
@@ -145,10 +147,12 @@ static int ena_devlink_configure_params(struct devlink *devlink)return rc; } +devl_lock (devlink); value.vbool =ena_phc_is_enabled (adapter);devl_param_driverinit_value_set (devlink,DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC , value); +devl_unlock (devlink);return 0 ; }
Signature · 1 line
2.52.0
Quoted 36 lines · Wed, Dec 31, 2025 at 03:58:08PM +0100, [email protected] wrote:
From: Frank Liang <[email protected]>
Fix assert lock warning while calling
devl_param_driverinit_value_set()in ena.WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90 Call Trace: <TASK> devl_param_driverinit_value_set+0x15/0x1c0 ena_devlink_alloc+0x18c/0x220 [ena] ? __pfx_ena_devlink_alloc+0x10/0x10 [ena] ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? devm_ioremap_wc+0x9a/0xd0 ena_probe+0x4d2/0x1b20 [ena] ? __lock_acquire+0x56a/0xbd0 ? __pfx_ena_probe+0x10/0x10 [ena] ? local_clock+0x15/0x30 ? __lock_release.isra.0+0x1c9/0x340 ? mark_held_locks+0x40/0x70 ? lockdep_hardirqs_on_prepare.part.0+0x92/0x170 ? trace_hardirqs_on+0x18/0x140 ? lockdep_hardirqs_on+0x8c/0x130 ? __raw_spin_unlock_irqrestore+0x5d/0x80 ? __raw_spin_unlock_irqrestore+0x46/0x80 ? __pfx_ena_probe+0x10/0x10 [ena] ...... </TASK>
Quoted 3 lines
Fixes 816b52624cf6 ("net: ena: Control PHC enable through devlink")Signed-off-by Frank Liang <[email protected]>Reviewed-by David Arinzon <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 5 lines · On Wed, 31 Dec 2025 22:58:08 +0800 you wrote:
From: Frank Liang <[email protected]>
Fix assert lock warning while calling
devl_param_driverinit_value_set()in ena.
Quoted 7 lines
WARNING: net/devlink/core.c:261 at devl_assert_locked+0x62/0x90, CPU#0: kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted 6.19.0-rc2+ #1 PREEMPT(lazy) Hardware name: Amazon EC2 m8i-flex.4xlarge/, BIOS 1.0 10/16/2017 Workqueue: events work_for_cpu_fn RIP: 0010:devl_assert_locked+0x62/0x90[...]
Here is the summary with links:
- [v3] net/ena: fix missing lock when update devlink params
https://git.kernel.org/netdev/net/c/8da901ffe497
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html