Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp886786lqt; Fri, 7 Jun 2024 01:19:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWt/oJBFJaKuPO96eVgrX6VNG8SYSkRRtNxXeTPK3qESPno9gHJZRLtk8plvI5xyCCrC4wKc8spZMruAdsDgT57kwtPQZvtyHHVuhTwiA== X-Google-Smtp-Source: AGHT+IFKpnOA73YZg+n2ZorIJeMba6/e47LFzPDd2AN6bRGTHy/DIfod8bkRosA2/fVLWYJDTQuU X-Received: by 2002:a05:6870:8326:b0:24c:ac7e:8a5c with SMTP id 586e51a60fabf-25464c3dbc1mr1909233fac.21.1717748398648; Fri, 07 Jun 2024 01:19:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717748398; cv=pass; d=google.com; s=arc-20160816; b=Vg2HARaLn13yb8+61lClZhYqdL4QGxt/h4eW8n/XHvw5S0kuofU5QGzt40tgyYRJ19 Kyz2m7LN1YN2Wkqh8Hh12ZBCANIQXIbQX75tOnz+tx0rNNsaoRq03pFItn4gz8DOEniD yIOfAgGh5b6v0QZIgyYj7Op1cXQCh7imFnOdmjExIIYrQF2OjKL8HlUIcoPGrAW0fsdy CeBS91RJ2NIpImTr7xqJyrbt3oh9jksEmYV0Z/NnyUvvF1RSu9tJayzqStZWdy60xzlT UAN2hwRXMDFJDOzzsP6lajbKBJ+yewKIWwSR8KgLsWKRIEz/Ia7uTSZUyrkOtKOksfJO cLPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=wg6qi7CwlG9mPI6UdwwMmwNTJpAiHxal7cH+O7K8jiE=; fh=J5G20XXyaDck+K6DHICWTwpTglsMqFOW+OuQlKzhQyI=; b=bhElGJOmRHFbT8VNYCvDHNtuoEYb7MvZsCEFRUiWbaiAFJg0Zljy016EooGWytwTdi z32yKG5Deb4OmoIgfX8do18fTlLg4dxkEd6pcGGl8bD6Eb2BQVpj7dOIoEgm73iLTcjx xpDkW7/V1iluz/bnwYVmCN74HqCJaljFLhKNPqhJDDUw388kA7xgxeiSW0f5r1x8Selh UCZ3H3YozppmdZKgXZNZAefBuluyXzjTw9hotrUl2TTcpmMXJfunJHk571gJgYz+bE+i qriiUttYC/YJOeDOR7wpRXIkVyr6o/5FdEsH++dGoc+lUecrcJYfmeDxECg+tiVzWnPF oLKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@prolan.hu header.s=mail header.b=V+hZ8qVS; arc=pass (i=1 spf=pass spfdomain=prolan.hu dkim=pass dkdomain=prolan.hu dmarc=pass fromdomain=prolan.hu); spf=pass (google.com: domain of linux-kernel+bounces-205592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=prolan.hu Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd38e652si2569731b3a.72.2024.06.07.01.19.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 01:19:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@prolan.hu header.s=mail header.b=V+hZ8qVS; arc=pass (i=1 spf=pass spfdomain=prolan.hu dkim=pass dkdomain=prolan.hu dmarc=pass fromdomain=prolan.hu); spf=pass (google.com: domain of linux-kernel+bounces-205592-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=prolan.hu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 53B12B22174 for ; Fri, 7 Jun 2024 08:19:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32F7615B0EA; Fri, 7 Jun 2024 08:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=prolan.hu header.i=@prolan.hu header.b="V+hZ8qVS" Received: from fw2.prolan.hu (fw2.prolan.hu [193.68.50.107]) (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 BAE9C15381F; Fri, 7 Jun 2024 08:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.68.50.107 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717748384; cv=none; b=HVfDJrUvxpyQZlhQEYJTxsKCVE5K7chdbqSmxT4qwW7TyssmA9Sr5km6xYaWTJw5kxHUpsiMj5m2PoXWVF/ia8TAsFr9AcItZa4egcmpF/sZKnPKTM5Uw48P2MQYSO4XIkf9qJSA+aB2yEgaiBC6M5rQN2XNOrdv2szZx/Boj5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717748384; c=relaxed/simple; bh=8ylq6lTmAICvJ78ovAeFFxwYjpztjGrZBRXCN4JMfuw=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JgN3eTQfLcnxJVrcmpvyJLO52XC9zVEfHjCDwVeDayXoNr7Qlp+SiC1vEwQRY9Ih10SYj6iSbj/Bo1ciO4fE5HrTiRTb83oSum39yQPX+NoSvijMnv9/m6ywsiBl49uS1GSJ3WPr/pqWuWuH0fgEIweemuV8sD96z/RbyyXLp0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=prolan.hu; spf=pass smtp.mailfrom=prolan.hu; dkim=pass (4096-bit key) header.d=prolan.hu header.i=@prolan.hu header.b=V+hZ8qVS; arc=none smtp.client-ip=193.68.50.107 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=prolan.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=prolan.hu Received: from proxmox-mailgw.intranet.prolan.hu (localhost.localdomain [127.0.0.1]) by proxmox-mailgw.intranet.prolan.hu (Proxmox) with ESMTP id 1EC07A041E; Fri, 7 Jun 2024 10:19:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prolan.hu; h=cc :cc:content-transfer-encoding:content-type:content-type:date :from:from:message-id:mime-version:reply-to:subject:subject:to :to; s=mail; bh=wg6qi7CwlG9mPI6UdwwMmwNTJpAiHxal7cH+O7K8jiE=; b= V+hZ8qVSziVHanXhxnf5+l5T8lhFnPf3WbTtMhh9mIwqxde3ceKpv8MK1K464NGC dgQlb3gp1+EEH1B7w1tqVS2HX5KlfRPniKxD9pOJWYtSfE0VfPJnbBOydx7Mwmz0 kXQV30RTeh2T3WiRkgwY/EH+2unCA5bZF7yYLJOHyT3KLEMhBGA/cS44mwp+gLIr OpxTXh8ZpGzZJFv9KPfFi9FQE0+dYjnIbch2INK35TvXITGLKYk7sO6IRFNmmSfv SXe0BCmV5mlO/Ljeg8k3U/4IOASRVAi98NnVO0cna3FlabHT9kZmBlGXw+LSM3cU kgvbYs5fhMx3ANzBDFYQa/FmsNeV9hgHo/xQUHSmtIPddNVJBs3WNP0Yze1Zd7lF Nqs9TUCDXCi2zdXYAiWn6z8Eh9Xffg6if5ItsQAdu5i4WmGvTwYCN6ydcGLP08KB 8ffNCf3d202CNMQUUpDXfw2HOdonumwbtZ1bX7xdVfPep0BJAG8BriuttgXmW9I2 y9MsalHyN/aT6Z/mm0XACJu1gBjVzQFtIr2CV2NrKI0Twv2Mpl5NXx48nJW5t4ef zFPz6FbooLpQTgKhbyGA5XgJNRbEvpErbndO7ML2iB1yTz3mTH3AoZiEbJJ9iRA8 BozzBl0+EEVyMvn9YHzoamYq4dOgbaxxV03oT2dpJ4A= From: =?UTF-8?q?Cs=C3=B3k=C3=A1s=2C=20Bence?= To: , , CC: =?UTF-8?q?Cs=C3=B3k=C3=A1s=2C=20Bence?= , Wei Fang , Shenwei Wang , Clark Wang , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni Subject: [PATCH v2] net: fec: Add ECR bit macros, fix FEC_ECR_EN1588 being cleared on link-down Date: Fri, 7 Jun 2024 10:18:55 +0200 Message-ID: <20240607081855.132741-1-csokas.bence@prolan.hu> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ESET-AS: R=OK;S=0;OP=CALC;TIME=1717748379;VERSION=7972;MC=3391927748;ID=131151;TRN=0;CRV=0;IPC=;SP=0;SIPS=0;PI=3;F=0 X-ESET-Antispam: OK X-EsetResult: clean, is OK X-EsetId: 37303A2945A12957627061 FEC_ECR_EN1588 bit gets cleared after MAC reset in `fec_stop()`, which makes all 1588 functionality shut down on link-down. However, some functionality needs to be retained (e.g. PPS) even without link. Signed-off-by: "Csókás, Bence" --- 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 881ece735dcf..fb19295529a2 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1361,6 +1361,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.34.1