From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793884320; b=Yn/f8OyNPZMyVSmGGLoGPWo4XTDvAlIZww0lxH3xQOn6Y1OkachFvRNqr18VljXzazV5 5UQhcQy6F9sHz4Zy5SjrE9xUIyQkApW4jgPwA4bjOB08RyXoPYbUvxDK2szpYIjal5nWR Prtf1D3PhjA6ATkLtDlBpnE6KJKUk+gdLV21oyef24Lkr21c5oUYoC3uGOdXsxDTrsh7/ 7R04AR37GCX8thqq+DIF54qki3TUg5znIya4dlVSXi6twtX9USzlv8FOIepCac5saZUmg vaQpd5NK8VqRhuRceThkqqMv+TqIouIEZZhJGSL0R/St9U7ZXdeU3FpWd1XiYu9a7+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793884320; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Scanned-By; bh=lbxTrL6lDBphgT8CaA+APHWFBvsQxapEffwn41oJXas=; b=ETNLLQajXsV2j3t9Jiqo7WGTk8hcF60o7nJBdwmRjfK0eTenJwgv60IqoCGVKs8bmwBF bXHKGmWHVFDr5UFxLZCX6fL7n+gnl9peEJABVcPllWS4NsPZ3kD6gTINAXo6pRjK2K1ex WMBbhcowo6rAewripA+INKb/3ZUHvM5Z2XuashbHCb7xcVfUUa1kRwaB1dmT/1JLr2/NX VMbWSGd+72s1ZZMP/zU5KsiGAnUN0fkCdNe8NJeWGfnalDTTN+oyjhqlJ4oEAIS8d3ahq X4++uf/9WwNVjieFMd84q0kNOCCowHkmPZkXG0+hECDduBhzbvljIEoHHFUb+2TckWA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=W93f690L; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BA52606D81D for ; Thu, 5 Nov 2026 13:11:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1BA52606D81D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=W93f690L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793884319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lbxTrL6lDBphgT8CaA+APHWFBvsQxapEffwn41oJXas=; b=W93f690LEfcJiSZZ899gmrzz3sOfIN11rhBSDTEMPJLBZSWw/1guIdtqOK6/R4tY+KQ6JS Ft9lXma6FH7PYTdXlgAeb+HxhEqndQ28jW8i++mA66jkTncYQXXBPFOXu7JOkkghN/ppQk WcnpencJtoQxC52d6Y2c84JkS5Rodv4= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-v41bgYcNOAan_TBZiidl7A-1; Thu, 05 Nov 2026 08:11:54 -0500 X-MC-Unique: v41bgYcNOAan_TBZiidl7A-1 X-Mimecast-MFC-AGG-ID: v41bgYcNOAan_TBZiidl7A_1793884313 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B5BAE1956069; Thu, 5 Nov 2026 13:11:52 +0000 (UTC) Received: from ivecera-thinkpadp16vgen1.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D9EE73001DA5; Thu, 5 Nov 2026 13:11:49 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Vadim Fedorenko , Arkadiusz Kubalewski , Jiri Pirko , Milena Olech , Przemek Kitszel , Jakub Kicinski , "David S. Miller" , Michal Michalik , linux-kernel@vger.kernel.org Subject: [PATCH net 1/2] dpll: notify about a reference sync pair only if it was added Date: Thu, 5 Nov 2026 14:11:44 +0100 Message-ID: <20261105131145.1010406-2-ivecera@redhat.com> In-Reply-To: <20261105131145.1010406-1-ivecera@redhat.com> References: <20261105131145.1010406-1-ivecera@redhat.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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 --- 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; -- 2.56.0