From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5D0DC43461 for ; Wed, 7 Apr 2021 14:21:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83CF6611C1 for ; Wed, 7 Apr 2021 14:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbhDGOVi (ORCPT ); Wed, 7 Apr 2021 10:21:38 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:38236 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbhDGOVf (ORCPT ); Wed, 7 Apr 2021 10:21:35 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lU93N-00FJmV-5Z; Wed, 07 Apr 2021 16:21:09 +0200 Date: Wed, 7 Apr 2021 16:21:09 +0200 From: Andrew Lunn To: Wong Vee Khee Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin , Voon Weifeng , Ong Boon Leong , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/1] net: stmmac: Add support for external trigger timestamping Message-ID: References: <20210407141537.2129-1-vee.khee.wong@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407141537.2129-1-vee.khee.wong@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 07, 2021 at 10:15:37PM +0800, Wong Vee Khee wrote: > From: Tan Tee Min > > The Synopsis MAC controller supports auxiliary snapshot feature that > allows user to store a snapshot of the system time based on an external > event. > > This patch add supports to the above mentioned feature. Users will be > able to triggered capturing the time snapshot from user-space using > application such as testptp or any other applications that uses the > PTP_EXTTS_REQUEST ioctl request. You forgot to Cc: the PTP maintainer. > @@ -159,6 +163,37 @@ static int stmmac_enable(struct ptp_clock_info *ptp, > priv->systime_flags); > spin_unlock_irqrestore(&priv->ptp_lock, flags); > break; > + case PTP_CLK_REQ_EXTTS: > + priv->plat->ext_snapshot_en = on; > + mutex_lock(&priv->aux_ts_lock); > + acr_value = readl(ptpaddr + PTP_ACR); > + acr_value &= ~PTP_ACR_MASK; > + if (on) { > + /* Enable External snapshot trigger */ > + acr_value |= priv->plat->ext_snapshot_num; > + acr_value |= PTP_ACR_ATSFC; > + pr_info("Auxiliary Snapshot %d enabled.\n", > + priv->plat->ext_snapshot_num >> > + PTP_ACR_ATSEN_SHIFT); dev_dbg()? > + /* Enable Timestamp Interrupt */ > + intr_value = readl(ioaddr + GMAC_INT_EN); > + intr_value |= GMAC_INT_TSIE; > + writel(intr_value, ioaddr + GMAC_INT_EN); > + > + } else { > + pr_info("Auxiliary Snapshot %d disabled.\n", > + priv->plat->ext_snapshot_num >> > + PTP_ACR_ATSEN_SHIFT); dev_dbg()? Do you really want to spam the kernel log with this?