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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 19BDECD37B2 for ; Mon, 11 May 2026 15:40:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id D28A083E1E; Mon, 11 May 2026 15:40:50 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 57uRjZfTkK6E; Mon, 11 May 2026 15:40:49 +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 smtp1.osuosl.org 8439A83E0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1778514049; bh=jkrwhwC37i0Ghp7RxMj/GDPhvhLRktyCbFNOYn8wbUk=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j2OjbLXMbqO1AbNFgvZiTdFVry4nVHuq8QlcMNfpzCwCcENDENd0+4Zszu+3F2O30 fZqAz7FokUwa0aReOOYry99lMfoOCLGO+vwwOGMlAKsktq4bx5yn3ntzRm5ek3OazJ Wt8HccNET5UVHy86aXPKPjY33WSsuqXLKIJC4wuC4CYlRu6enyn3LhNHiu+FEwH6AW qoCA4BqoC/ND0+QBz3hYJU3aTCcIlmhkfEtip/huKjWhaa2P/hSFBF5D/+lKTSv9lX SoAuJxyzZ2olKP3uwD7C8/IOLbJTSfT9uTcyjZHS9TRA3hobY1S9xjYldq45g7iRLM G3CmhZ6lXESYg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 8439A83E0E; Mon, 11 May 2026 15:40:49 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 208E1223 for ; Mon, 11 May 2026 15:40:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0641983E0E for ; Mon, 11 May 2026 15:40:48 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id W7B8eK0Ms3vs for ; Mon, 11 May 2026 15:40:47 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 6080583DD3 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6080583DD3 Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6080583DD3 for ; Mon, 11 May 2026 15:40:47 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id F403E42A3E; Mon, 11 May 2026 15:40:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EECEFC2BCB0; Mon, 11 May 2026 15:40:45 +0000 (UTC) Date: Mon, 11 May 2026 16:40:43 +0100 From: Simon Horman To: Aleksandr Loktionov Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com, netdev@vger.kernel.org Message-ID: <20260511154043.GC27589@horms.kernel.org> References: <20260508031226.3601800-1-aleksandr.loktionov@intel.com> <20260508031226.3601800-7-aleksandr.loktionov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260508031226.3601800-7-aleksandr.loktionov@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778514046; bh=kMyxVFHBsTENAImGfysO/vdBf+qJS/bcyql+j8HczTY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A+chN3i9ViZ7leomzi38CgzYvReG407/tsMJ6BPiS5NrTI93fdTcUvW3Utxw63crK hLZ90JHMtJa7Tgb8bDPrsgvn3VVh827FJNz1LHHkPy07ii8h6KWsKimQN6SMP4kUcN 3qHuYbwdK3VrjzLz/3ZC/8DXzqEdldWhnapacgGOZ8BqXMhaQE9zMelYd+apSVjVzL HftwDDfk43tgLzRzWvct0D0VJa86uw9+MVUSNx+DCzvwACPNPm5xmmYgOmwc4wGY7a yLFlMQL9x2mqMciRTQw280fXeva/UYVK4QS1GKDMAYGWWZt+XaCwVSbiVmp3SntaFh ExBrQpgzyz+jg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=A+chN3i9 Subject: Re: [Intel-wired-lan] [PATCH iwl-next 6/8] ixgbe: extract ixgbe_restart_auto_neg() to avoid code duplication 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: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Fri, May 08, 2026 at 05:12:24AM +0200, Aleksandr Loktionov wrote: > From: Jakub Chylkowski > > Both ixgbe_setup_phy_link_generic() and ixgbe_setup_phy_link_tnx() > end with the same three-line sequence that reads MDIO_CTRL1, sets > the MDIO_AN_CTRL1_RESTART bit, and writes MDIO_CTRL1 back. > > Factor it out into a static helper ixgbe_restart_auto_neg() and call > it from both sites. > > While at it, also check the return value of phy.ops.read_reg() in the > helper and skip the write on failure. The original inlined code > ignored the read result and would OR MDIO_AN_CTRL1_RESTART into a > stale autoneg_reg value (left over from the prior MDIO_AN_ADVERTISE > write) and unconditionally write it back to MDIO_CTRL1 if the read > failed. This is a small behavioral change: on read_reg() failure the > restart write is now skipped instead of being issued with a > potentially garbage value. > > Signed-off-by: Jakub Chylkowski > Signed-off-by: Aleksandr Loktionov Reviewed-by: Simon Horman FWIIW, the AI-generated review of this patch available on sashiko.dev flags that similar problems wrt write on failre exist earlier on in ixgbe_setup_phy_link_generic(). It may be good to address this area more holistically as a follow-up. (I am not suggesting increasing the scope of this patch/patch-set.) ...