From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A2707606A32C for ; Mon, 30 Nov 2026 23:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=PozFWpjD; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GDzuo9Ms DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-ID:Date :Cc:To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=9dbP14HBKDMReAZmTrF6eKOw0Xbv9NZ+wff2J9b/9pM=; b=PozFWpjDoptOvs0Gnw/hllzgNv vcUG17Xyh0Ft+2jz7XUTPTvZ5WREwMhien+BIz4CCt6OZe/H3FV1pKxV4OUExzD9SVmwYhm5IqbgT 6FdZdFXFIRupmwrOz3wUlweC6tHevT0hHxL4/HBE+oRnZccUbPh7ZE6uOBYM48Y/JeWQDrs+y5T3A aCMiuq14cgb8pW5QzEgmtuXK7S1O0a/3us7oa93ZJzMf+g4jPBawwhSlq99NqMWRH461WyB/GS2w7 nqhhFE4LDq00J+PS2O6pr3x+gPXb3HWe2AP9Ksbt+zN/yjoGuC0Iy2xD449YxBXIsO6AlKF4BjgA9 xyEA6ryQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYB6P-0000000649l-1mSd; Mon, 30 Nov 2026 23:48:09 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYB5y-000000063zv-0OVH; Mon, 30 Nov 2026 23:47:42 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 87D68612F7; Mon, 30 Nov 2026 23:47:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74E421F00898; Mon, 30 Nov 2026 23:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796082461; bh=9dbP14HBKDMReAZmTrF6eKOw0Xbv9NZ+wff2J9b/9pM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GDzuo9MsMeiUwwxdBn/sInZ3CCJlXexdQy2zC+iQFc8Mgrdz5GByqgX9aahMdp3tl evvQWy9Pbq7MSpPxn83poWOkMZ2uFOboFdICujBFP97fy9dQjFk7Z2QW3vIhBZwat+ pxgAhU3yaURzhqW4Se/7V+WtkSTdINfeA144vK2JZFOSCpi7becuiflFtGJ2BcntoH lSPTnzl5ygXrfbqH02ss9nYNQnbpyyegWjk/L6KqB5s7bc4rDq6jcScjQkLcDrg+Ai IdRKMaA9GdG7ikze06lAM1vF6IkEHXndyFwGk/vVa2LBhfAbjjgqT+3erY9zNKrduZ C3wdHuY3Sr50A== Subject: Re: [PATCH net-next v23 05/15] net: phylink: make phylink_validate state locked From: netdev-bot+sashiko@kernel.org To: ansuelsmth@gmail.com Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, willemb@google.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, lorenzo@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk, maxime.chevallier@bootlin.com, p.zabel@pengutronix.de, nathan@kernel.org, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com, rmk+kernel@armlinux.org.uk, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, llvm@lists.linux.dev, zhengping.zhang@airoha.com Date: Mon, 30 Nov 2026 23:47:39 +0000 Message-ID: <179608245900.3146.7642205996688289734@kernel.org> In-Reply-To: <20261129230558.612526-6-ansuelsmth@gmail.com> References: <20261129230558.612526-6-ansuelsmth@gmail.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] This patch removes the last in-tree caller of the exported phy_get_rate_matching(), but leaves the export in place. -- net: phylink: make phylink_validate state locked This commit makes the phylink validation helpers run under pl->state_mutex. It adds __phylink_validate(), __phylink_validate_mask() and __phylink_validate_phy() for callers that already hold the mutex. It also adds an internal __phy_get_rate_matching() helper in phy-internal.h for callers that already hold phydev->lock. > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index 079c53516f424..a6d6a7c1a96dd 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c [ ... ] > @@ -146,13 +147,11 @@ EXPORT_SYMBOL(phy_print_status); > int phy_get_rate_matching(struct phy_device *phydev, > phy_interface_t iface) > { > - int ret = RATE_MATCH_NONE; > + int ret; > > - if (phydev->drv->get_rate_matching) { > - mutex_lock(&phydev->lock); > - ret = phydev->drv->get_rate_matching(phydev, iface); > - mutex_unlock(&phydev->lock); > - } > + mutex_lock(&phydev->lock); > + ret = __phy_get_rate_matching(phydev, iface); > + mutex_unlock(&phydev->lock); > > return ret; > } [Severity: Low] Does phy_get_rate_matching() still have any in-tree users after this change? phylink was its only caller. This patch moves both phylink call sites to the new internal helper: phylink_validate_one(): tmp_state.rate_matching = __phy_get_rate_matching(phy, interface); __phylink_validate_phy(): state->rate_matching = __phy_get_rate_matching(phy, state->interface); After this patch, grepping for phy_get_rate_matching finds only these: - the definition and kernel-doc in drivers/net/phy/phy.c - EXPORT_SYMBOL_GPL(phy_get_rate_matching) - the prototype in include/linux/phy.h - the two __phy_get_rate_matching() calls in phylink.c This stays the same at the end of the series. The same patch also changes the exported function's locking. It now always takes phydev->lock, where before it only took the lock when phydev->drv->get_rate_matching was set. The commit message does not mention that the export is left with no callers. Should phy_get_rate_matching(), its export and its prototype be removed in this patch? If it is being kept on purpose, could the commit message say why? -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129230558.612526-1-ansuelsmth%40gmail.com