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 CEDABC282D1 for ; Thu, 6 Mar 2025 16:13:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 77E3A83F19; Thu, 6 Mar 2025 16:13:09 +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 CbCfG2wvebrp; Thu, 6 Mar 2025 16:13:08 +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 D760083F1B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1741277588; bh=SC6AHDf1+LSGmHO4yF1LlfxNEvEUB10IW0zw+9ERfVQ=; h=From:To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=A4ZiCEWLXXIGAkeJp1m4qjbNAGHYNrFwcLfbp8RTc7bWX4sObelFfVJdbcuDMpPt5 35dSd1qtlggM8rykgJT22iFaUYJzacGbqxDIXrU2Vd9/XASdk0aDj7NhDm+EdLbKhR a3r6dVuq9Ame4TNYcW9uIAp41deJd5dFJ74Sd28xiiPu5vGjKwC7MBG03jfdkdOYb/ aav209FKtFgNBNHMocJzVVdVUR4ShmUtGlLv9nudOmgSRqFhN/XCTgLCCXHzoDam6t eCeZpX+4fLYw499SYJSDRU2GKrEfNAC8XQ4yADACiKP5Qei81ZKdfoZvFeDN5arLpz PMOyDnvV1XXGg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id D760083F1B; Thu, 6 Mar 2025 16:13:08 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id 5126295F for ; Thu, 6 Mar 2025 10:14:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2119640CCF for ; Thu, 6 Mar 2025 10:14:19 +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 GVhKJeWiPvz0 for ; Thu, 6 Mar 2025 10:14:18 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::22d; helo=mail-lj1-x22d.google.com; envelope-from=rand.sec96@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 12D6840500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 12D6840500 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by smtp4.osuosl.org (Postfix) with ESMTPS id 12D6840500 for ; Thu, 6 Mar 2025 10:14:17 +0000 (UTC) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-30be983a3b9so4337711fa.0 for ; Thu, 06 Mar 2025 02:14:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741256056; x=1741860856; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SC6AHDf1+LSGmHO4yF1LlfxNEvEUB10IW0zw+9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aA== X-Received: by 2002:a2e:bc06:0:b0:30b:cd68:b69c with SMTP id 38308e7fff4ca-30bd7a1c6admr24523521fa.3.1741256055483; Thu, 06 Mar 2025 02:14:15 -0800 (PST) Received: from rand-ubuntu-development.dl.local (mail.confident.ru. [85.114.29.218]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30be98d09e2sm1550631fa.12.2025.03.06.02.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 02:14:15 -0800 (PST) From: Rand Deeb To: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org (moderated list:INTEL ETHERNET DRIVERS), netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Cc: deeb.rand@confident.ru, lvc-project@linuxtesting.org, voskresenski.stanislav@confident.ru, Rand Deeb Date: Thu, 6 Mar 2025 13:12:00 +0300 Message-Id: <20250306101201.1938376-1-rand.sec96@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 06 Mar 2025 16:13:06 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741256056; x=1741860856; darn=lists.osuosl.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SC6AHDf1+LSGmHO4yF1LlfxNEvEUB10IW0zw+9ERfVQ=; b=GyxW/AjQQY4plUGD5qSQAj6c33fwJzCuBGipBp5wH5TvJzSGVzXEe4T89vZ30nPbVU P3xeHktf9GkK6g8E9Ng19fWWwMpCO/bzAiDS+2YSOE1WHaGOxnKA4DmO5ivnHLmzrD7u QCRbxbwoi5vPfEYpC8y6PxEqmOzX0ZS9inW8JHK3/JFExhZ/m8H2nRlnCjuQE3oEzdPy gsLqXLDwkEtcAfm18/CTezM9ne970dMGecbJC2KJOvO4/ylfsG7/e9hCsN40ozvyN9WW b4l1nnrNBYsNsbYUeqJTxggj86l1oJ/+EJPrlHCaE+1lM4cHRQDqQiNrXcm1pnfNxYSC UP1A== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=GyxW/AjQ Subject: [Intel-wired-lan] [PATCH] ixgbe: Fix unreachable retry logic in combined and byte I2C write functions 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" The current implementation of `ixgbe_write_i2c_combined_generic_int` and `ixgbe_write_i2c_byte_generic_int` sets `max_retry` to `1`, which makes the condition `retry < max_retry` always evaluate to `false`. This renders the retry mechanism ineffective, as the debug message and retry logic are never executed. This patch increases `max_retry` to `3` in both functions, aligning them with the retry logic in `ixgbe_read_i2c_combined_generic_int`. This ensures that the retry mechanism functions as intended, improving robustness in case of I2C write failures. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Rand Deeb --- drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c index 0a03a8bb5f88..2d54828bdfbb 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c @@ -167,7 +167,7 @@ int ixgbe_write_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, u16 reg, u16 val, bool lock) { u32 swfw_mask = hw->phy.phy_semaphore_mask; - int max_retry = 1; + int max_retry = 3; int retry = 0; u8 reg_high; u8 csum; @@ -2285,7 +2285,7 @@ static int ixgbe_write_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr, u8 data, bool lock) { u32 swfw_mask = hw->phy.phy_semaphore_mask; - u32 max_retry = 1; + u32 max_retry = 3; u32 retry = 0; int status; -- 2.34.1