Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3465574rwa; Tue, 23 Aug 2022 05:20:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4DR0sPyX8cNCLztkOkn6CEkJe/Qc37rllZ7UO7xJ4GN+roFObLxXgZNKsVY0AT4ChU8YtQ X-Received: by 2002:a17:903:24e:b0:172:6c9d:14e0 with SMTP id j14-20020a170903024e00b001726c9d14e0mr24300937plh.84.1661257225955; Tue, 23 Aug 2022 05:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257225; cv=none; d=google.com; s=arc-20160816; b=H7SiOiZN0zfsjg5nEPoyL86xR28iTxj6H4a9opt6pGg4i7k9u/kxkP8euKoo7dMk4S uqJRrtzTqK4QLjlRe9Ax0ot4ptnZiU0wGJGcFab2AUv04SaSeyUoZ9r1h0M3NNuyESy0 ExHmltugfQTmeEO0NcpRF3T2Pyoy0oMjHgH/aOv1gPyRRCtWQu6NSoDThaVFOnAeveSQ r5j1DEdJ7MJcKicy5yA1iuaJ0kWfEhCYehs+f8QxUpHSDQDu89gNFe5itNA7f/Uwfipx LFK6EMpoqGpfnBW1EiTaumRq/Ry+Qic/omLAeNAS63XXPe6rrvAHAGIGLXP69oPWosSV 5OYA== 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=9bXVfRyDoXZ0OPu0gM+BFIg1Ja9c8JHJ77YLAP/YrcI=; b=1JHcSaBwOBm2Xk2R/s8tbpxydEfdtN137ody1IRfhefjUqJa98iyW+++H4GE4FNj7W f2rU6ZvJhLtEFcfvH6+n4Cxg65yUVJK62nGGvsmfOT6M+2+H4cgNp8dVLbD+Bo3xnxZ7 dMMP4Fkeet5rClvaikFzrWk3kxH1bPsUL2DJmD5X/ly2S9rpmcgz3uRniReHpM6oyU7e 4tR+BCB0isPxgsWk8BBcqheRfT8Y+qo2nclozT4iEBtM5Rf3aZsdjO4MPhVyahTrDYja Q6en8bMDz7FeAZjiORUuefv+9HIWfn0AmAvt1PqnluJYnFVw3DMleNFGlmQhMjCyLxOw TpOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iI8VXE41; 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 p9-20020a63fe09000000b004129a78936fsi16356723pgh.1.2022.08.23.05.20.15; Tue, 23 Aug 2022 05:20: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=iI8VXE41; 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 S1353615AbiHWKPR (ORCPT + 99 others); Tue, 23 Aug 2022 06:15:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352820AbiHWKGU (ORCPT ); Tue, 23 Aug 2022 06:06:20 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC54D1E0; Tue, 23 Aug 2022 01:53:13 -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 sin.source.kernel.org (Postfix) with ESMTPS id 65A66CE1B41; Tue, 23 Aug 2022 08:53:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43F57C433D6; Tue, 23 Aug 2022 08:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244790; bh=wfxCBtMasHoEFMn9oqLYg4hdLmiDL38+6fTcxBgzW1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iI8VXE41VYyu8+fkTbYT4s+JZ7gxRmyC6XGsQ3u+V0+d2RdtorTwkGG3GXuirO2MN p5Ub47d5beX6dbfXKK4TH1Wj5I6SNs8mClaSOBON5TBVduB2+V4OWbikOuaCDKxUZV vjW5woFWS2mYhNUod9bvIIIrR3N+C6TypkpV3fzQ= 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 5.15 148/244] fec: Fix timer capture timing in `fec_ptp_enable_pps()` Date: Tue, 23 Aug 2022 10:25:07 +0200 Message-Id: <20220823080104.111648482@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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 @@ -136,11 +136,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);