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 4DBCF1714A8; Thu, 15 Aug 2024 13:43:35 +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=1723729415; cv=none; b=Tc8g8EbprBQGGFykaI2buD7sUgQW0qW6hzNRNS/8dLpLMJqF/y9GKF2FZf5uV91ZAwz7j3DS/4APzZbnZbcAsOp3FI0W8KNGoW4pxS5uGKo0SYA//3mmbyzS58kDccj3q8vC28stH2slcbPRD87OEqW75s7hn71xQ9I3zEbK7Tw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723729415; c=relaxed/simple; bh=LowJcJ0RCDS+xMmrOYQorpr/JUVYurtVWyuoCzmqysc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FhfDzUY7DCe7ey5VAugzhw7xxdGvhQ5N4fDlldyQ19w0RZB3+RS7PZdTuo/Vt59MlRpLoDGNfJE/uW+giGVrm9ijQftnMAoOcxhHyOKnG4jtOcZkPaou347prhWJlnS/L9m7cCCI+O74OJuTSBF4CWrtQT15hGH0ggUDE9dAmtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aZj1iEvX; 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="aZj1iEvX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C85D8C32786; Thu, 15 Aug 2024 13:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723729415; bh=LowJcJ0RCDS+xMmrOYQorpr/JUVYurtVWyuoCzmqysc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aZj1iEvXzfEiM+N6UwB/C2lqgMC7C2ZpUdTf2vs+UKBOuO6im2tLO9YSwU3bW/G5V cXtdwVMCpx18603FFi/AVIWSwB9g2m9DZhq3i23xYokEwBnMKi/o9Azx7Vwc7Efnmo w1vdOSwYmmBxeBcQSnOGFILBrvyYHCg/F53ZWUOk= 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.15 063/484] net: fec: Fix FEC_ECR_EN1588 being cleared on link-down Date: Thu, 15 Aug 2024 15:18:41 +0200 Message-ID: <20240815131943.716514236@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240815131941.255804951@linuxfoundation.org> References: <20240815131941.255804951@linuxfoundation.org> User-Agent: quilt/0.67 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-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 722810ce4068f..0a3cf22dc260b 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1242,6 +1242,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