From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E3BC742ECF for ; Thu, 20 Jul 2023 17:24:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DFDDB40685; Thu, 20 Jul 2023 17:24:51 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1F99D400D6 for ; Thu, 20 Jul 2023 17:24:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689866689; 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=9WM4cL77MG7unDvm1NpxMQuRaAd5kKPrlK+eqGyOSv0=; b=ZVUo8NSy1ZrkT/kEHcnbY097wf9Q3wSn4r4/zqsgJynG6u4tbNUmxkY8LVNVBtyWbKnMOo QO/bkKUSAxTslj97L0o6Ui7TxAtxvu/JAXh4as6jkd+H187ldbgG7J4+yBV5a1qQjyKnO5 soX5dfDcCeHApLPz/5/wmgnybepPmVg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-353-J0zQHWnrM82hqQBX-QTR4Q-1; Thu, 20 Jul 2023 11:22:48 -0400 X-MC-Unique: J0zQHWnrM82hqQBX-QTR4Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6466A835160; Thu, 20 Jul 2023 15:21:50 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28E53492C13; Thu, 20 Jul 2023 15:21:48 +0000 (UTC) From: Kevin Traynor To: Qiming Yang Cc: Vignesh Sridhar , Qi Zhang , dpdk stable Subject: patch 'net/ice/base: remove unreachable code' has been queued to stable release 21.11.5 Date: Thu, 20 Jul 2023 16:18:23 +0100 Message-ID: <20230720151942.262154-72-ktraynor@redhat.com> In-Reply-To: <20230720151942.262154-1-ktraynor@redhat.com> References: <20230720151942.262154-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/25/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/f420162557cea8f588c9a145d06d4b18d896bf11 Thanks. Kevin --- >From f420162557cea8f588c9a145d06d4b18d896bf11 Mon Sep 17 00:00:00 2001 From: Qiming Yang Date: Thu, 18 May 2023 15:16:36 +0000 Subject: [PATCH] net/ice/base: remove unreachable code [ upstream commit ca2011635fa38c71f47933d77ee618ca4d4f640f ] The default condition in the switch statement in ice_sched_get_psm_clk_freq() is an unreachable code. The variable clk_src is restricted to values 0 to 3 with the bit mask and shift values set. Fixes: 76ac9d771c97 ("net/ice/base: read PSM clock frequency from register") Signed-off-by: Vignesh Sridhar Signed-off-by: Qiming Yang Acked-by: Qi Zhang --- drivers/net/ice/base/ice_sched.c | 16 ++++++---------- drivers/net/ice/base/ice_sched.h | 5 +++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index 0841ec8c5b..f3655a820f 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -1395,9 +1395,4 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) GLGEN_CLKSTAT_SRC_PSM_CLK_SRC_S; -#define PSM_CLK_SRC_367_MHZ 0x0 -#define PSM_CLK_SRC_416_MHZ 0x1 -#define PSM_CLK_SRC_446_MHZ 0x2 -#define PSM_CLK_SRC_390_MHZ 0x3 - switch (clk_src) { case PSM_CLK_SRC_367_MHZ: @@ -1413,9 +1408,10 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) hw->psm_clk_freq = ICE_PSM_CLK_390MHZ_IN_HZ; break; - default: - ice_debug(hw, ICE_DBG_SCHED, "PSM clk_src unexpected %u\n", - clk_src); - /* fall back to a safe default */ - hw->psm_clk_freq = ICE_PSM_CLK_446MHZ_IN_HZ; + + /* default condition is not required as clk_src is restricted + * to a 2-bit value from GLGEN_CLKSTAT_SRC_PSM_CLK_SRC_M mask. + * The above switch statements cover the possible values of + * this variable. + */ } } diff --git a/drivers/net/ice/base/ice_sched.h b/drivers/net/ice/base/ice_sched.h index 1441b5f191..22ed09d2b1 100644 --- a/drivers/net/ice/base/ice_sched.h +++ b/drivers/net/ice/base/ice_sched.h @@ -36,4 +36,9 @@ #define ICE_PSM_CLK_390MHZ_IN_HZ 390625000 +#define PSM_CLK_SRC_367_MHZ 0x0 +#define PSM_CLK_SRC_416_MHZ 0x1 +#define PSM_CLK_SRC_446_MHZ 0x2 +#define PSM_CLK_SRC_390_MHZ 0x3 + struct rl_profile_params { u32 bw; /* in Kbps */ -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-07-20 16:18:03.582092242 +0100 +++ 0072-net-ice-base-remove-unreachable-code.patch 2023-07-20 16:17:54.889751439 +0100 @@ -1 +1 @@ -From ca2011635fa38c71f47933d77ee618ca4d4f640f Mon Sep 17 00:00:00 2001 +From f420162557cea8f588c9a145d06d4b18d896bf11 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit ca2011635fa38c71f47933d77ee618ca4d4f640f ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index a526c8f32c..b16b27dcbf 100644 +index 0841ec8c5b..f3655a820f 100644 @@ -26 +27 @@ -@@ -1418,9 +1418,4 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) +@@ -1395,9 +1395,4 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) @@ -36 +37 @@ -@@ -1436,9 +1431,10 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) +@@ -1413,9 +1408,10 @@ void ice_sched_get_psm_clk_freq(struct ice_hw *hw) @@ -53 +54 @@ -index 3724ef33a8..64ed5e0f9b 100644 +index 1441b5f191..22ed09d2b1 100644 @@ -56 +57 @@ -@@ -39,4 +39,9 @@ +@@ -36,4 +36,9 @@