🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Vadim Fedorenko Thu, 05 Nov 2026 22:14
Re: [PATCH net 1/2] dpll: notify about a reference sync pair only if it was added
#11896
Author: Vadim Fedorenko
Date: Thu, 05 Nov 2026 22:14
38 lines
10040 bytes
On 05/11/2026 13:11, Ivan Vecera wrote:
> dpll_pin_ref_sync_pair_add() sends a pin change notification even when
> xa_insert() fails and nothing has changed. zl3073x gets -EBUSY when
> another channel has already added the same pair and ignores it, so user
> space is notified about a change that did not happen.
> 
> Send the notification only after a successful insert.
> 
> Found by code review. Reproduced on a ZL30732A board with kprobes on
> dpll_pin_ref_sync_pair_add() and __dpll_pin_change_ntf(): loading the
> driver adds one pair twice and the add failing with -EBUSY sends a
> notification. With this patch it does not, and the successful add still
> does. A test module adding one pair twice shows the same on the monitor
> group.
> 
> Fixes: 58256a26bfb3 ("dpll: add reference sync get/set")
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> ---
>   drivers/dpll/dpll_core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
> index 8389983f425695..277692d12d3d1e 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -1081,7 +1081,8 @@ int dpll_pin_ref_sync_pair_add(struct dpll_pin *pin,
>   	mutex_lock(&dpll_lock);
>   	ret = xa_insert(&pin->ref_sync_pins, ref_sync_pin->id,
>   			ref_sync_pin, GFP_KERNEL);
> -	__dpll_pin_change_ntf(pin);
> +	if (!ret)
> +		__dpll_pin_change_ntf(pin);
>   	mutex_unlock(&dpll_lock);
>   
>   	return ret;

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads