Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2695574rdh; Mon, 30 Oct 2023 05:17:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwToY0rXksdryg7kVqSCUm177GaASzWy3AMCsAcwpWbChnfa32VIwbwwT26buRiPAo0i/8 X-Received: by 2002:a17:902:cecc:b0:1cc:5505:fff3 with SMTP id d12-20020a170902cecc00b001cc5505fff3mr1256045plg.30.1698668237886; Mon, 30 Oct 2023 05:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698668237; cv=none; d=google.com; s=arc-20160816; b=jcgwJmGPbt9AnLjQfgimGqBtHXA0BazSRYbgyNZuZ9KasZQI2WwBDPzQ8iAZ00lsdU G/31RfziUooqXvhhgVBhPZuiM774sHO3+lsZqlGp4mk2BQS8VspUXHML4EOg+2LgiO0O bhO7rLbo2Nh1q56S7vv9MSNPKc0QamVIMu8CdtJGOAs6Ewj2zI3XV8rCkoKWzRcwNRK4 5BSAi54T+8dT9/wcrmN3JY1NfJW7ToPD+hyGGFctnPdayGKi7Q44Kg73zMBx9yYy5YKr Dp8g5cnI+EC48HufIDm2Bp+/YAzMeX3U1Nh1iWDll+sf9sEviQOQV2uD41sIpdeVoS2o QM/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Cbm5lTXBFVIsSs+1ANa7wn2CrqJ6D0ati494gyw8FFM=; fh=lO8yq3AtIlPnFCDTSpqyMqihns/M+srZScAYTCdS2yA=; b=csJ1s4mJpnytgQ8zPDP9UhCo2CUPxyBr5nz88qujTNMlgSKMvkegt5SYNiClNOhRkV V5hp7CtWUp6GUe5BjLZftlh6c8JG0a2pZ/vfi1TwWQCQUCWajEOLIJI4ceQvvZbz0sTb 7m+4/RkqkUM0z/9IibgXpqFjoe6BChayyFfPjL6huc6LuG2DoOH77ovmXp+VjGHT3sxw /tde48YYUua5jtqK6kMruUJgzjG5Oe4tvLi6kFwMtfhuEEvq1QPuy//4VGw6v8TGewYI lGSEwiu2kxGsc7qkw4qq9h2yfG63vbw77JlpX3BpPPJTlH0pP/X2fAwAeUgJyN3KLgHF MfPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ebosuiKT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id l6-20020a170903244600b001c73626a1ffsi21920pls.412.2023.10.30.05.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 05:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ebosuiKT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 41737804C233; Mon, 30 Oct 2023 05:17:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233045AbjJ3MQ4 (ORCPT + 99 others); Mon, 30 Oct 2023 08:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjJ3MQz (ORCPT ); Mon, 30 Oct 2023 08:16:55 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A975A2; Mon, 30 Oct 2023 05:16:53 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507e85ebf50so6115429e87.1; Mon, 30 Oct 2023 05:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698668211; x=1699273011; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Cbm5lTXBFVIsSs+1ANa7wn2CrqJ6D0ati494gyw8FFM=; b=ebosuiKT12gVLtSyNgY6F1P2yZzM2MPDv07yAI3jhA7gr7KX5PzvuMUIZn7ZXJiw9B GxHgpv9e24gIB9tLRE+V9Y7/latOs5CYfBx9n9YV7CGl5wicwA9dmkeZx46IOB3IwRNw z3fEgbcl9oq9TE9v9G645ev/lviqvDUwbT12r0CTGnGaswauRVvy2RtR7lGEI/+jzy+Z ikvrexRu6J9PVqZcx80aTfrLHcnech9xgxZyvFiwBOSsPuTO8zS0eIDhB14Qq+WjLWIa e2I4GeTsNjOEZQimSfJCWSZhQwGbp546prv9eS0uqrh8kZZtaMoBcuacc3jbH20s2T88 /haA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698668211; x=1699273011; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Cbm5lTXBFVIsSs+1ANa7wn2CrqJ6D0ati494gyw8FFM=; b=dsPESA8mwPALnsqRJsmwRLfJzC2S6MupWzNkSuebGyDgjjLHDFkJDG8E353Fnxa2pk x1P80Jf1Ql3KhOYweq7PVRNLk7BJuKYXGsdF9K7f0rkfjsxxRoo8gS9xwxSXLVK5vdtX eni0Y6nU4AKXB3NA3fA7mxCwHGyBmRQL/HhymKjuVxBNJDey5CC0jt/AbjPXVwiUQtiB XvSA/jGg/l3JMRCkSLCtvdapi1zS4MQqrbI2oBBaUASHdZvr6l2rk+Ap/wDLuwy/oDH7 la8SrUNC5KOR6rSVu2qOfuTbf/BbQM4DWO76Q7rLY+nCHP30v84GBlG0YzyCeUP3RJH6 V1NA== X-Gm-Message-State: AOJu0YwKEWBaH6UdBE1tPswgSndTT3ALQTOEOOIVO6eLnVAdyrrOUfDO dE9pOSuHk8VyQKLKM1lBn6g= X-Received: by 2002:ac2:43bc:0:b0:508:1a4c:b9b8 with SMTP id t28-20020ac243bc000000b005081a4cb9b8mr5907776lfl.36.1698668210756; Mon, 30 Oct 2023 05:16:50 -0700 (PDT) Received: from mobilestation (srv1.baikalchip.ru. [87.245.175.227]) by smtp.gmail.com with ESMTPSA id f22-20020ac251b6000000b005007e7211f7sm1432686lfk.21.2023.10.30.05.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 05:16:50 -0700 (PDT) Date: Mon, 30 Oct 2023 15:16:48 +0300 From: Serge Semin To: Furong Xu <0x1207@gmail.com> Cc: "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto , Simon Horman , Jacob Keller , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, xfr@outlook.com, rock.xu@nio.com Subject: Re: [PATCH net] net: stmmac: xgmac: Fix support for multiple Flexible PPS outputs Message-ID: References: <20231027025603.1035668-1-0x1207@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 30 Oct 2023 05:17:15 -0700 (PDT) On Mon, Oct 30, 2023 at 02:03:50PM +0300, Serge Semin wrote: > On Fri, Oct 27, 2023 at 10:56:03AM +0800, Furong Xu wrote: > > From XGMAC Core 3.20 and later, each Flexible PPS has individual PPSEN bit > > to select Fixed mode or Flexible mode. The PPSEN must be set, or it stays > > in Fixed PPS mode by default. > > XGMAC Core prior 3.20, corresponding PPSEN bits are read-only reserved, > > always set PPSEN do not make things worse ;) > > > > Fixes: 95eaf3cd0a90 ("net: stmmac: dwxgmac: Add Flexible PPS support") > > Signed-off-by: Furong Xu <0x1207@gmail.com> > > Please don't forget to add the already got tags shall you need more > patch revisions. > > Reviewed-by: Serge Semin Ops, this was intended to be sent for v2... I'll send a copy there. -Serge(y) > > -Serge(y) > > > --- > > drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 +- > > drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h > > index 7a8f47e7b728..a4e8b498dea9 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h > > @@ -259,7 +259,7 @@ > > ((val) << XGMAC_PPS_MINIDX(x)) > > #define XGMAC_PPSCMD_START 0x2 > > #define XGMAC_PPSCMD_STOP 0x5 > > -#define XGMAC_PPSEN0 BIT(4) > > +#define XGMAC_PPSENx(x) BIT(4 + (x) * 8) > > #define XGMAC_PPSx_TARGET_TIME_SEC(x) (0x00000d80 + (x) * 0x10) > > #define XGMAC_PPSx_TARGET_TIME_NSEC(x) (0x00000d84 + (x) * 0x10) > > #define XGMAC_TRGTBUSY0 BIT(31) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > index f352be269deb..53bb8f16c481 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > > @@ -1178,7 +1178,7 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index, > > > > val |= XGMAC_PPSCMDx(index, XGMAC_PPSCMD_START); > > val |= XGMAC_TRGTMODSELx(index, XGMAC_PPSCMD_START); > > - val |= XGMAC_PPSEN0; > > + val |= XGMAC_PPSENx(index); > > > > writel(cfg->start.tv_sec, ioaddr + XGMAC_PPSx_TARGET_TIME_SEC(index)); > > > > -- > > 2.34.1 > > > >