From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FDCFF8A163 for ; Thu, 16 Apr 2026 11:40:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CD3BF6070E; Thu, 16 Apr 2026 11:40:19 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id PgnymcpWa1gx; Thu, 16 Apr 2026 11:40:17 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9AC566070A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1776339617; bh=7y4RG+Ooy20ucTBsnvZrm2OADKlaSNt80O0jTVn3eCg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=RN5bG8JhyaiEtZLGOvVE2s6EsxLRm6Sn2iCORt0GQZMXDg3pJo5kMWVbbmC4jvB5a nmwPM66/dRCdAGrTyF3o0WSScXAhR8MI8q1Yii4h5M+V+U4oo2TXfbnEgoBGy0WjQt SPTtNbad9CkbVIoJj7/r6x0Vc8RQbE3nu3ZgluViceAA8LD8spt+LDbCpfbE7hQ8qN hpq+MlGVWY5YZeDm8qjUOOBTtb5Wut2zlAQddi7IcxQWSI2Bq1KjgD5VUABYyCWpGX xmJ4vl2UXyTIyj5Ocz2+dlhtqMLF0E3aq2i67ErlBTuEHt9vuATdmS28SxouJzcqa2 SMhb+xF09S06Q== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 9AC566070A; Thu, 16 Apr 2026 11:40:17 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id C624F775 for ; Thu, 16 Apr 2026 11:40:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B88E440478 for ; Thu, 16 Apr 2026 11:40:16 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lrMMLmxjEaDL for ; Thu, 16 Apr 2026 11:40:16 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=poros@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org A984A40475 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A984A40475 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id A984A40475 for ; Thu, 16 Apr 2026 11:40:15 +0000 (UTC) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-HRIe96FFPWqaQpJJXgMH5w-1; Thu, 16 Apr 2026 07:40:09 -0400 X-MC-Unique: HRIe96FFPWqaQpJJXgMH5w-1 X-Mimecast-MFC-AGG-ID: HRIe96FFPWqaQpJJXgMH5w_1776339607 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4110518005AB; Thu, 16 Apr 2026 11:40:07 +0000 (UTC) Received: from ShadowPeak.redhat.com (unknown [10.44.32.76]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BB88D180047F; Thu, 16 Apr 2026 11:40:01 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Date: Thu, 16 Apr 2026 13:39:51 +0200 Message-ID: <20260416113952.389405-2-poros@redhat.com> In-Reply-To: <20260416113952.389405-1-poros@redhat.com> References: <20260416113952.389405-1-poros@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-MFC-PROC-ID: nYxOn0IWV9XyDlr3qooWdZG8OltPQ8oRJ7XIon9fLP8_1776339607 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776339614; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7y4RG+Ooy20ucTBsnvZrm2OADKlaSNt80O0jTVn3eCg=; b=hUL+B/VIL8Dd+1KzQ34d6etID/VtiHHOcSXk3C1ZrXM4qJgVn77yajwp5uRxXUQNP76xVM 985mExDzgSgnG/CNwXmifPP1fGCEieU3KZM3r4k1cCqoTlbRmMvUB1hgPCAfvM9aDsXt33 7GTPb+K6iuNimWN/bXLl4DoyIwB/8Pw= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hUL+B/VI Subject: [Intel-wired-lan] [PATCH net v6 1/2] dpll: export __dpll_pin_change_ntf() for use under dpll_lock X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ivan Vecera , Jiri Pirko , Rinitha S , Przemek Kitszel , Eric Dumazet , Arkadiusz Kubalewski , Aleksandr Loktionov , Andrew Lunn , Tony Nguyen , Simon Horman , Jakub Kicinski , Jacob Keller , Vadim Fedorenko , Paolo Abeni , "David S. Miller" , linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" From: Ivan Vecera Export __dpll_pin_change_ntf() so that drivers can send pin change notifications from within pin callbacks, which are already called under dpll_lock. Using dpll_pin_change_ntf() in that context would deadlock. Add lockdep_assert_held() to catch misuse without the lock held. Signed-off-by: Ivan Vecera Signed-off-by: Petr Oros --- drivers/dpll/dpll_netlink.c | 10 ++++++++++ drivers/dpll/dpll_netlink.h | 2 -- include/linux/dpll.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c index 83cbd64abf5a47..95ae786e98aab3 100644 --- a/drivers/dpll/dpll_netlink.c +++ b/drivers/dpll/dpll_netlink.c @@ -842,11 +842,21 @@ int dpll_pin_delete_ntf(struct dpll_pin *pin) return dpll_pin_event_send(DPLL_CMD_PIN_DELETE_NTF, pin); } +/** + * __dpll_pin_change_ntf - notify that the pin has been changed + * @pin: registered pin pointer + * + * Context: caller must hold dpll_lock. Suitable for use inside pin + * callbacks which are already invoked under dpll_lock. + * Return: 0 if succeeds, error code otherwise. + */ int __dpll_pin_change_ntf(struct dpll_pin *pin) { + lockdep_assert_held(&dpll_lock); dpll_pin_notify(pin, DPLL_PIN_CHANGED); return dpll_pin_event_send(DPLL_CMD_PIN_CHANGE_NTF, pin); } +EXPORT_SYMBOL_GPL(__dpll_pin_change_ntf); /** * dpll_pin_change_ntf - notify that the pin has been changed diff --git a/drivers/dpll/dpll_netlink.h b/drivers/dpll/dpll_netlink.h index dd28b56d27c56d..a9cfd55f57fc42 100644 --- a/drivers/dpll/dpll_netlink.h +++ b/drivers/dpll/dpll_netlink.h @@ -11,5 +11,3 @@ int dpll_device_delete_ntf(struct dpll_device *dpll); int dpll_pin_create_ntf(struct dpll_pin *pin); int dpll_pin_delete_ntf(struct dpll_pin *pin); - -int __dpll_pin_change_ntf(struct dpll_pin *pin); diff --git a/include/linux/dpll.h b/include/linux/dpll.h index 2ce295b46b8cdc..8f97120ee7b37d 100644 --- a/include/linux/dpll.h +++ b/include/linux/dpll.h @@ -276,6 +276,7 @@ int dpll_pin_ref_sync_pair_add(struct dpll_pin *pin, int dpll_device_change_ntf(struct dpll_device *dpll); +int __dpll_pin_change_ntf(struct dpll_pin *pin); int dpll_pin_change_ntf(struct dpll_pin *pin); int register_dpll_notifier(struct notifier_block *nb); -- 2.52.0