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 43AD0146D6B; Mon, 6 Jan 2025 15:37:23 +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=1736177844; cv=none; b=P75uQqusLk23hWZzUHJ4hFvMO3rnTbZNY4nAx3sd7PH9pWtUnBpshumi0ulokrzn0Jv3ZoGo4TUIFvNpLzfTogz3e4NpcpAy8f+7vBB1MAbn3NDFI7Q/VK72D6QetHJd3D5+fPaZZWeBKB9S01kEwYAspwYU+BE2zL/IhcR91EQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736177844; c=relaxed/simple; bh=oobAfYDqfDeC+yxYqo4i6K+GziEWGNSP3i9G0MwjWwU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pKpNP8OZ0YVRXaCHqevFFkX3lEkzeEwM2Cxx4G0qXvujflS07wy1d5x1UPl99BsAUOjKaBZR2qfQ1glwqxsldAIFC7iWsmncC+Zz45+e7PjQYwPA8qHwO3Wmqw3GuxHl874FAglqreTMeeP8deWow3Eaq9I38zPRkHEg0TsTdjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KbSovDz5; 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="KbSovDz5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5584BC4CED2; Mon, 6 Jan 2025 15:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736177843; bh=oobAfYDqfDeC+yxYqo4i6K+GziEWGNSP3i9G0MwjWwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KbSovDz5QifM/nr9AE76d/RnFHZN4aV/GrmHwhzTaug/e2033Ri43IluJQChzz/lu VvtCNM+lfwxNnmHzpsgR23m1RDduV2QImNK6jTuLe2/33KgZkT9iqkbeTiZXfvNEGO FaH1FdBoPIxX8i46k/RueLU6DtWp3qd6UKD96wOo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Meghana Malladi , Roger Quadros , "David S. Miller" , Sasha Levin Subject: [PATCH 6.12 075/156] net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init Date: Mon, 6 Jan 2025 16:16:01 +0100 Message-ID: <20250106151144.557162013@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250106151141.738050441@linuxfoundation.org> References: <20250106151141.738050441@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Meghana Malladi [ Upstream commit 9b115361248dc6cce182a2dc030c1c70b0a9639e ] When ICSSG interfaces are brought down and brought up again, the pru cores are shut down and booted again, flushing out all the memories and start again in a clean state. Hence it is expected that the IEP_CMP_CFG register needs to be flushed during iep_init() to ensure that the existing residual configuration doesn't cause any unusual behavior. If the register is not cleared, existing IEP_CMP_CFG set for CMP1 will result in SYNC0_OUT signal based on the SYNC_OUT register values. After bringing the interface up, calling PPS enable doesn't work as the driver believes PPS is already enabled, (iep->pps_enabled is not cleared during interface bring down) and driver will just return true even though there is no signal. Fix this by disabling pps and perout. Fixes: c1e0230eeaab ("net: ti: icss-iep: Add IEP driver") Signed-off-by: Meghana Malladi Reviewed-by: Roger Quadros Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/icssg/icss_iep.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/ti/icssg/icss_iep.c b/drivers/net/ethernet/ti/icssg/icss_iep.c index 5d6d1cf78e93..768578c0d958 100644 --- a/drivers/net/ethernet/ti/icssg/icss_iep.c +++ b/drivers/net/ethernet/ti/icssg/icss_iep.c @@ -215,6 +215,9 @@ static void icss_iep_enable_shadow_mode(struct icss_iep *iep) for (cmp = IEP_MIN_CMP; cmp < IEP_MAX_CMP; cmp++) { regmap_update_bits(iep->map, ICSS_IEP_CMP_STAT_REG, IEP_CMP_STATUS(cmp), IEP_CMP_STATUS(cmp)); + + regmap_update_bits(iep->map, ICSS_IEP_CMP_CFG_REG, + IEP_CMP_CFG_CMP_EN(cmp), 0); } /* enable reset counter on CMP0 event */ @@ -780,6 +783,11 @@ int icss_iep_exit(struct icss_iep *iep) } icss_iep_disable(iep); + if (iep->pps_enabled) + icss_iep_pps_enable(iep, false); + else if (iep->perout_enabled) + icss_iep_perout_enable(iep, NULL, false); + return 0; } EXPORT_SYMBOL_GPL(icss_iep_exit); -- 2.39.5