> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of Bart
> Van Assche via Intel-wired-lan
> Sent: Saturday, March 21, 2026 2:58 AM
> To: Nguyen, Anthony L <[email protected]>
> Cc: Kitszel, Przemyslaw <[email protected]>;
> [email protected]; Bart Van Assche <[email protected]>;
> Loktionov, Aleksandr <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-net v4] ice: fix locking in
> ice_dcb_rebuild()
>
> Move the mutex_lock() call up to prevent that DCB settings change after the
> first ice_query_port_ets() call. The second ice_query_port_ets() call in
> ice_dcb_rebuild() is already protected by pf->tc_mutex.
>
> This also fixes a bug in an error path, as before taking the first "goto
> dcb_error" in the function jumped over mutex_lock() to mutex_unlock().
>
> This bug has been detected by the clang thread-safety analyzer.
>
> Cc: Aleksandr Loktionov <[email protected]>
> Cc: [email protected]
> Fixes: 242b5e068b25 ("ice: Fix DCB rebuild after reset")
> Signed-off-by: Bart Van Assche <[email protected]>
> ---
>
> v4 (this patch): Changed "[PATCH] iwl-net:" into "[PATCH iwl-net]".
>
> v3 (2026-03-20): Modified patch description. See also
>
> https://lore.kernel.org/all/[email protected]/#t
>
> v2 (2026-02-23): Combined the two patches into one patch and
> increased the amount of code covered by tc_mutex. See also
>
> https://lore.kernel.org/all/[email protected]/
>
> v1 (2025-02-06): Two patches. See also
> https://lore.kernel.org/all/[email protected]/
>
> drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Tested-by: Arpana Arland <[email protected]> (A Contingent worker at
Intel)