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 E411263C; Thu, 15 Aug 2024 14:28:43 +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=1723732124; cv=none; b=Ha5QKzieZZ6SWw5pmV06yyiIMzaiuNv7JtwDutokXG6dmaR7VxdzXd0T4kjFqml0RrLAYZiOJ2rmTVv/aAZwBzWUqB0B/YglpmnqGHIZN56b4J8rEjgDV5Z6XPzDvSX2SIzJY+ZhE0HV4so6ea+be3zvazLEKVPVPQ4+aXXEs+g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723732124; c=relaxed/simple; bh=UpxKnFTWJPv9Nd2MAHUyT0RW7gA05MgiTexvxQ+jF74=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bihu0BXFbAnLp5hVSrS8U7TNgqSK1sfRoUZv3tGdVWQ9CV/3uXQqrfMKMywhkAB556ey0RWYU/N3G9PDVFhMN02eJA33pLDXoxsM/hbcN2tTwTjg9BsGVZxZcuAXwVkTrJs1Ig7KQIb5Fd6rF4kDJs5OPBOfz/+2hmOK8V/oxp4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xIDjpClJ; 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="xIDjpClJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 063C3C32786; Thu, 15 Aug 2024 14:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723732123; bh=UpxKnFTWJPv9Nd2MAHUyT0RW7gA05MgiTexvxQ+jF74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xIDjpClJCXmqw11rNxWoCvyA0PGeDsEanmOYRMA7nmZ+qaabtK6+h67Tv6efaEe/R 0NGGttUdGibT/VfT8welgSPCCQ76wtFDBCuL68j/0EuVxXWj3086qRiuB1IQcCe0cP ++QozGG+hgSMcc6JZENAK0Xw3q/ieOIF99ODzrY8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Richard Cochran , Andrew Lunn , =?UTF-8?q?Cs=C3=B3k=C3=A1s, =20Bence?= , Wei Fang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 050/352] net: fec: Fix FEC_ECR_EN1588 being cleared on link-down Date: Thu, 15 Aug 2024 15:21:56 +0200 Message-ID: <20240815131921.173857990@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240815131919.196120297@linuxfoundation.org> References: <20240815131919.196120297@linuxfoundation.org> User-Agent: quilt/0.67 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Csókás, Bence [ Upstream commit c32fe1986f27cac329767d3497986e306cad1d5e ] FEC_ECR_EN1588 bit gets cleared after MAC reset in `fec_stop()`, which makes all 1588 functionality shut down, and all the extended registers disappear, on link-down, making the adapter fall back to compatibility "dumb mode". However, some functionality needs to be retained (e.g. PPS) even without link. Fixes: 6605b730c061 ("FEC: Add time stamping code and a PTP hardware clock") Cc: Richard Cochran Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/netdev/5fa9fadc-a89d-467a-aae9-c65469ff5fe1@lunn.ch/ Signed-off-by: Csókás, Bence Reviewed-by: Wei Fang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/fec_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 269c6365ec09b..a591ca0b37787 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1201,6 +1201,12 @@ fec_stop(struct net_device *ndev) writel(FEC_ECR_ETHEREN, fep->hwp + FEC_ECNTRL); writel(rmii_mode, fep->hwp + FEC_R_CNTRL); } + + if (fep->bufdesc_ex) { + val = readl(fep->hwp + FEC_ECNTRL); + val |= FEC_ECR_EN1588; + writel(val, fep->hwp + FEC_ECNTRL); + } } static void -- 2.43.0