Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3403597rwa; Tue, 23 Aug 2022 04:19:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR53ii1hf+OyX8SuMlhcAiRQitOTP8M8wg4Mn5oFWfQYBWQJR7NF1BQEOa+AGtJWDL0fuxuP X-Received: by 2002:a05:6a00:9a5:b0:536:29e:c91d with SMTP id u37-20020a056a0009a500b00536029ec91dmr20745565pfg.22.1661253565044; Tue, 23 Aug 2022 04:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253565; cv=none; d=google.com; s=arc-20160816; b=FRtaSQC3h9czfi72cDweL02ET1fsPtjm9ez0ZYVOYwJh6RO/D6X7vb0ahVW9ZLPZDk lCHLiSIlJ7UhByLmY4FbnsbEKkRHCSHl8VmfiAXuvhtfx2WMZv3iiZ9u5g1Sut+2stR6 iy/K/mu7KWaGqq1qSU0giFkgTH7nRWWL+wpjJ8/tFUcl885GYpKz9EI7WXTXfoNxbNtx 783ddKLpYJ2W1+S1wpYc0lYATX/MuP1Vc89zLUsNqWoDuC6KSgHW7YyIRQCCyA5sqg2t 5JL4vsB5b46eIG/ZxzDzU99zHS53GMqQeNbyGa6vdSiZ7PrL/u9eg9Vtv27Eoo/gn0HI nISQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Pe3dk8Bce3+LCoHQ884bTJUISSjvmOg8p5VgVckPIhE=; b=I2wmQxfoiDQChvmch0amq1Klclf3imPcgKneUCNQeomxdNwVgHtzBgv1EIDudFyr7n I4m8dKVVElYtW3G0Tkg+xOAPoAu0FogKBUwidpT+G++EctpGLvjTqhdgaRDHrl0oDvUG jcCUEejtsJKhWnbXUBJ3TGbjG0/NC6AAy9vLu+QgPMOV6SNT3R+wrmyTtuAzsFf2Oagr j2sq/6NpM/7x3taUwavhHBCsf+/mt6I2uvWp7EDc3hseqHnSZPtRmr31tjcBQxF2kJCm ZlHHb/Lmt0/fFLHD8kG3Rhv0noL9wU47yxEY6Z2AoNzk7aC1NNogoo46YLcvDcGhEY9a yFvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0G8ftpog; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t185-20020a6381c2000000b0042a37db75f6si11141745pgd.535.2022.08.23.04.19.13; Tue, 23 Aug 2022 04:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0G8ftpog; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353968AbiHWKTZ (ORCPT + 99 others); Tue, 23 Aug 2022 06:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352697AbiHWKIc (ORCPT ); Tue, 23 Aug 2022 06:08:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0A396CD14; Tue, 23 Aug 2022 01:54:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E1D916150F; Tue, 23 Aug 2022 08:54:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7D7EC433C1; Tue, 23 Aug 2022 08:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244881; bh=wzYSU7PSI22ZxSnt8HJeG089qUc1YXYvyYmqR9gjY2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0G8ftpogScWYLBsQ65gS1XJLwqB4hVrS5IC0Tu7P4jSOnAT7iFb1Jxfe+IRKC83g1 8BYf+fVIYowtZymn7YjR3JuDwYeR19+NPToYqt8w7Wtt8yDkh4ZLgSPMsZuLy0H+KK 5n2XiGRfQKmmbeGlxwkHo/lpIKltXD3CX1HkMHf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Cs=C3=B3k=C3=A1s=20Bence?= , Jakub Kicinski Subject: [PATCH 4.14 206/229] fec: Fix timer capture timing in `fec_ptp_enable_pps()` Date: Tue, 23 Aug 2022 10:26:07 +0200 Message-Id: <20220823080101.012155497@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Csókás Bence commit 61d5e2a251fb20c2c5e998c3f1d52ed6d5360319 upstream. Code reimplements functionality already in `fec_ptp_read()`, but misses check for FEC_QUIRK_BUG_CAPTURE. Replace with function call. Fixes: 28b5f058cf1d ("net: fec: ptp: fix convergence issue to support LinuxPTP stack") Signed-off-by: Csókás Bence Link: https://lore.kernel.org/r/20220811101348.13755-1-csokas.bence@prolan.hu Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/fec_ptp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/drivers/net/ethernet/freescale/fec_ptp.c +++ b/drivers/net/ethernet/freescale/fec_ptp.c @@ -155,11 +155,7 @@ static int fec_ptp_enable_pps(struct fec * NSEC_PER_SEC - ts.tv_nsec. Add the remaining nanoseconds * to current timer would be next second. */ - tempval = readl(fep->hwp + FEC_ATIME_CTRL); - tempval |= FEC_T_CTRL_CAPTURE; - writel(tempval, fep->hwp + FEC_ATIME_CTRL); - - tempval = readl(fep->hwp + FEC_ATIME); + tempval = fep->cc.read(&fep->cc); /* Convert the ptp local counter to 1588 timestamp */ ns = timecounter_cyc2time(&fep->tc, tempval); ts = ns_to_timespec64(ns);