Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412877rwa; Tue, 23 Aug 2022 04:29:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR7W1L+81ETioj+G/UBwUYMxVq1m/hxq1fz12NG7WFhgAdKBaHOQs6q4EbM4Uo212vUv/Gma X-Received: by 2002:aa7:9731:0:b0:536:7b04:acb6 with SMTP id k17-20020aa79731000000b005367b04acb6mr11293644pfg.43.1661254147615; Tue, 23 Aug 2022 04:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254147; cv=none; d=google.com; s=arc-20160816; b=vGKB9+d+PUm+Vorxv1J8cAXYi3h5y/h39Cz5UFHastmD4M412G7srTM22w1TtHXz3t 9vJuWLxTI2mm4TI0JSXUZn38EC5U+wDf46G2CIgxEqKTCP1KNMGyG2SsJOf8Iodlgh3W K0JvvoC6Fs67Kd5kTDM8LrnUWbU0TjjjdpAv8/UZlCmCFq2nXMnuF7YFI1Kb00LTjrBe vc6Chd7CnQ3Bkp3UPLSnGcquD77GVV/EAzyfN1lJ3OEr3h645JvFg9AfI5cfZ8PJahCT J0/1WMTQnDOzDual8TnDuow0whWzahKHgUOToKDPFBH6ag+ldyV99+yd6KidswEx9v8l CEbA== 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=KAGGt6o7MLvF1j2bCWj4VsTyVuPg7Pt+TSBu5R893bY=; b=y1RMz53RV1iL1kM/u4UqSPNABpAtfAIjTbbgC0zRuBfiqCpWOjsxKbtFT2Vi/Zm/TL Ns0yTEJkRBEEqoYid0WjA3c3h5ZbUq4yQHKfvGfE32hrpkGcsBpkBVHMSZ1VaFkBzyLI 8JVd9RT2xbearLW1/FDbrrS/QgNRDQwMAGx16qn+gwPowk5DhxwDtKa7JSt8P8J5kLk+ mNyEfz6F/rrWsNC8G8k80YgZGEvRks2kcaVSKbJM+5e3+EMIw0t04FP52VVZifgjWJ/8 PoP8MhHHi9OwVY3psvBOKFF0VJ6dWLqyCy6DMX1l6HUcdHGcPwMyQfMqXzj/LpKljpwM d9KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nnFOZPD5; 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 oa3-20020a17090b1bc300b001fb6116f766si1685934pjb.132.2022.08.23.04.28.56; Tue, 23 Aug 2022 04:29:07 -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=nnFOZPD5; 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 S1356304AbiHWK5a (ORCPT + 99 others); Tue, 23 Aug 2022 06:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357097AbiHWKxB (ORCPT ); Tue, 23 Aug 2022 06:53:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 208E0ACA04; Tue, 23 Aug 2022 02:13:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id 660A8B81C66; Tue, 23 Aug 2022 09:13:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A05C433C1; Tue, 23 Aug 2022 09:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245985; bh=NSWtoY/b14STqguOXNn0kkCnYB/ON/ex+GeP1Dr7dog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nnFOZPD591/xW/HK5V9pbvaK7Wu+GEC1pKpCSQt4ucAMsJBj5PS840H69mYTeJZjz nCiPqr21yoBdjgZyr/VLDjuiPOOFJw9c37AKvu2oBASG10JHojuqp7ivLf0cRoM97b klxWL6QYR3Xjkxnf7pH+aOKNhbamjdij7bs2C47c= 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.19 253/287] fec: Fix timer capture timing in `fec_ptp_enable_pps()` Date: Tue, 23 Aug 2022 10:27:02 +0200 Message-Id: <20220823080109.746251659@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 @@ -141,11 +141,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);