# Re: \[PATCH net\] amd-xgbe: synchronize KR training with device operations

- From: Paolo Abeni \<pabeni@redhat.com\>
- Date: 2026-03-17 12:09:47 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/03/3463729
- Thread: https://ratatoskr.run/netdev/2026/03/3457919/t.md

```text
On 3/13/26 2:42 PM, Raju Rangoju wrote:
> @@ -2115,7 +2160,9 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
>  	XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, COMMAND, cmd);
>  	XP_SET_BITS(s0, XP_DRIVER_SCRATCH_0, SUB_COMMAND, sub_cmd);
>  
> -	/* Issue the command */
> +	/* Acquire mailbox lock for firmware command */
> +	guard(mutex)(&pdata->mailbox_lock);

Also note that Documentation/process/maintainer-netdev.rst states:


Use of ``guard()`` is discouraged within any function longer than 20 lines,
``scoped_guard()`` is considered more readable. Using normal lock/unlock is
still (weakly) preferred.

/P

```
