Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2676018rwd; Fri, 16 Jun 2023 06:56:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70EJq8DNDFRN+zQJm5E/paaMgtXM+Bu7Qe+frbyZ9k1YGOc0Rq8ZG7lWsCClvMPgiqxytF X-Received: by 2002:a05:6a00:14ca:b0:64d:42f6:4c7b with SMTP id w10-20020a056a0014ca00b0064d42f64c7bmr2460625pfu.27.1686923807317; Fri, 16 Jun 2023 06:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686923807; cv=none; d=google.com; s=arc-20160816; b=F0pBWOiplRytjYU0qCGT0ja4ZwKBsTIRyI5siUpWeGwUkA3iUsT/0IPRQaxHVeBhXS oTxluA/WRWAsPAoQ4hMFerGRiHlosfry8NjYQpZiQ+enjK8/Y3qUBmqussNimE+g4MW8 w8ZwI21FPBvflU+FMxF0X18MPRaWNT+qmhRGjAI5WNI1xvU9aFDj76Tqp8PYwqkTQGPz k5AtkEyqsDJ+Y3NL3t7F3FaPEZC4zU9NopMruLfoEg2FnyHvth+s5b8/8nvExzbM5izu HmQ4Gy+6Yl2mbntsDG2n/YGc2XaOpMI7UF/0NOGwibs7jHnucvdBI0Bb0jwBgmBICteQ rNeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8oK/JD/VfQBaYnT9KJx8BUomsRwXIR/Wq47zzH/xURI=; b=sUVsALfBOfrfI1CRiJwwzRTx5uIsNyNdY5388EtfunTrVn3UtxtuWxYdoxvcItJBm5 K3FdJlG58mzsqZPUpfH5XNW1gvm7L6KZA/Bo+Fepz+X7FOwlkZAjvF5xWuVOmb6hNiR8 O8vkxos6Wgq5YRi4GGumoJWQs1K29YWB3sN8g2UwBLm7gYnGOOECS3A26WTkZZIdk56N pm2je3/FQjdkmn3vfbfSHFhSEKQYGEe3mgUA9qwP+LthaMFJJlnKPdZLJcNj55WaAv7l Irc8jSWKnMRUE70wF3U8qEoShhyGVK0ZC39Sn08NwpsyH+TdcrbxzIc+va5NP9GBUErH +MwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=N95uKDkF; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020aa796f4000000b00647514cfd36si14101743pfq.242.2023.06.16.06.56.33; Fri, 16 Jun 2023 06:56:47 -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=@bootlin.com header.s=gm1 header.b=N95uKDkF; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344676AbjFPNsl (ORCPT + 99 others); Fri, 16 Jun 2023 09:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244629AbjFPNsd (ORCPT ); Fri, 16 Jun 2023 09:48:33 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F4763593; Fri, 16 Jun 2023 06:48:27 -0700 (PDT) X-GND-Sasl: alexis.lothore@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686923305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8oK/JD/VfQBaYnT9KJx8BUomsRwXIR/Wq47zzH/xURI=; b=N95uKDkFRvrLUoacdiLx3mrcBstb+8fwzdVsf2ul7uf6Ax64ehU/HuBfHioTUQcfai6VdU QwWC6u36IDmXlt5k2bwHon2DQo6M+6hGsv5SI0s4cnNnhHxYWbqtb5uQDl8vlNcZl7M5Ys yJGDB8+0+hmhrF+Im+MswNcoH7a7Od/7ytGcjOSSFddRP6HI/C8zFDDXUjQZ6iAzRtLk4k CddbTmcvec/b2kFDxlFnPJmRiwjw8z27pXSbRLm/erjIHp5vdUW2uuKBJXVeZKt94/gqYj 9ytK2pvllhb7xJ3erhfBiNnX0Ui+FN5TQaCxqRLEC/4YNaaRhwbK6qk1BrREog== X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com X-GND-Sasl: alexis.lothore@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id E9A18FF806; Fri, 16 Jun 2023 13:48:21 +0000 (UTC) Message-ID: <71492ab7-9d6b-e41c-e392-1bee04860f18@bootlin.com> Date: Fri, 16 Jun 2023 15:48:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH net-next 3/8] net: stmmac: move PTP interrupt handling to IP-specific DWMAC file To: Simon Horman Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Thomas Petazzoni , Nicolas Carrier References: <20230616100409.164583-1-alexis.lothore@bootlin.com> <20230616100409.164583-4-alexis.lothore@bootlin.com> Content-Language: en-US From: =?UTF-8?Q?Alexis_Lothor=c3=a9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hello Simon, On 6/16/23 15:34, Simon Horman wrote: > On Fri, Jun 16, 2023 at 12:04:04PM +0200, alexis.lothore@bootlin.com wrote: >> From: Alexis Lothoré >> >> As for auxiliary snapshot triggers configuration, reading snapshots depends >> on specific registers addresses and layout. As a consequence, move >> PTP-specific part of stmmac interrupt handling to specific DWMAC IP file >> >> Signed-off-by: Alexis Lothoré > > Hi Alexis, > > thanks for your patch. > > ... > >> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c >> index 01c0822d37e6..b36fbb0fa5da 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c > > ... > >> +static void dwmac4_ptp_isr(struct stmmac_priv *priv) >> +{ >> + u32 num_snapshot, ts_status; >> + struct ptp_clock_event event; >> + unsigned long flags; >> + u64 ptp_time; >> + int i; > > Please use reverse xmas tree - longest line to shortest - for new > Networking code. > > struct ptp_clock_event event; > u32 num_snapshot, ts_status; > unsigned long flags; > u64 ptp_time; > int i; > ACK > ... > >> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h >> index 9e0ff2cec352..92ed421702b9 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h >> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h >> @@ -23,9 +23,6 @@ >> #define PTP_STSUR 0x10 /* System Time – Seconds Update Reg */ >> #define PTP_STNSUR 0x14 /* System Time – Nanoseconds Update Reg */ >> #define PTP_TAR 0x18 /* Timestamp Addend Reg */ >> -#define PTP_ACR 0x40 /* Auxiliary Control Reg */ > > Unfortunately this seems to break the build of > drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c > on an x86_64 alllodconfig, as PTP_ACR is used in that file. > >> -#define PTP_ATNR 0x48 /* Auxiliary Timestamp - Nanoseconds Reg */ >> -#define PTP_ATSR 0x4c /* Auxiliary Timestamp - Seconds Reg */ >> >> #define PTP_STNSUR_ADDSUB_SHIFT 31 >> #define PTP_DIGITAL_ROLLOVER_MODE 0x3B9ACA00 /* 10e9-1 ns */ Ouch. thanks for spotting the issue and the providing build details, I'll fix this and wait a bit for more comments before sending v2 > > -- > pw-bot: changes-requested > -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com