From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C100E6136; Mon, 23 Jun 2025 21:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714664; cv=none; b=L6ekeK3yiuloBllDCh/k38jThiTYx9EzreSUcv5iHpQlhNXPSOsdmm0lg4oI1hNbkIl7vyWQkX0DhJ3WZUwOT2K+MmCr+8dsbsg2a+B1Sj+6Gjl1O8Nxm3CH6rLi14mq2WCJIIk9YZK7FC14AIMrQBr9wzttnJ3r/mgV7c/Eqj0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750714664; c=relaxed/simple; bh=+fALVPS45Ji1d4efZYzPXEQuNeXNQjlgtD0YvKKKjlE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pKDyWriGnheJMpnBfu0UF3k4grJIi2xgE2HYmjhULgJZcqbbLb7ZWlXherx6nC9u9EzYLA5ZbF5af7NJaqTRRt2F3MiLrQY43lZFC2kmtSLRvN/s9rbWgXg2kLQNNPHVwqRDsHu0vEPvrIgq1ky4GG03i+X9DNT3xTUuLcko9uk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wbeWLE/h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wbeWLE/h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55472C4CEEA; Mon, 23 Jun 2025 21:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750714664; bh=+fALVPS45Ji1d4efZYzPXEQuNeXNQjlgtD0YvKKKjlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wbeWLE/h9jTEFwrYcj5YCqph//5RYu6ZApDD2feXyHVAjj1Ty0qw677VQF8A4NSIz cMdnNUfJE/WViHdeUKg35RU9DhC7dKoWs4lgr+w8Kmv/r65AU1p7da/e5n9H0pOtuX ovTRRxBDVm0tmWwcK28FTfxreHsnNCNqaUXPl9qM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Rand Deeb , Tony Nguyen , Sasha Levin , Rinitha S Subject: [PATCH 6.15 408/592] ixgbe: Fix unreachable retry logic in combined and byte I2C write functions Date: Mon, 23 Jun 2025 15:06:06 +0200 Message-ID: <20250623130710.141481918@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130700.210182694@linuxfoundation.org> References: <20250623130700.210182694@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rand Deeb [ Upstream commit cdcb3804eeda24d588348bbab6766cf14fddbeaa ] 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 Tested-by: Rinitha S (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- 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 0a03a8bb5f886..2d54828bdfbbc 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.39.5