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=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 71B1DC4361B for ; Thu, 17 Dec 2020 08:26:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BF23206CB for ; Thu, 17 Dec 2020 08:26:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726998AbgLQI0h (ORCPT ); Thu, 17 Dec 2020 03:26:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbgLQI0g (ORCPT ); Thu, 17 Dec 2020 03:26:36 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4423BC061794 for ; Thu, 17 Dec 2020 00:25:56 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1kpobh-0003su-Ub; Thu, 17 Dec 2020 09:25:53 +0100 Subject: Re: [PATCH 1/2] net: stmmac: retain PTP-clock at hwtstamp_set To: Jakub Kicinski , Holger Assmann Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Maxime Coquelin , Rayagond Kokatanur , kernel@pengutronix.de, Michael Olbrich , Jose Abreu , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Richard Cochran References: <20201216113239.2980816-1-h.assmann@pengutronix.de> <20201216171334.1e36fbff@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: Ahmad Fatoum Message-ID: Date: Thu, 17 Dec 2020 09:25:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201216171334.1e36fbff@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 17.12.20 02:13, Jakub Kicinski wrote: >> + netdev_warn(priv->dev, "HW Timestamping init failed: %pe\n", >> + ERR_PTR(ret)); > > why convert to ERR_PTR and use %pe and not just %d? To get a symbolic error name if support is compiled in (note the `e' after %p). > > also continuation misaligned > >> + } else { >> + ret = stmmac_init_ptp(priv); >> + if (ret == -EOPNOTSUPP) >> + netdev_warn(priv->dev, "PTP not supported by HW\n"); >> + else if (ret) >> + netdev_warn(priv->dev, "PTP init failed\n"); >> + } >> } >> >> priv->eee_tw_timer = STMMAC_DEFAULT_TWT_LS; >> @@ -5290,8 +5330,7 @@ int stmmac_resume(struct device *dev) >> /* enable the clk previously disabled */ >> clk_prepare_enable(priv->plat->stmmac_clk); >> clk_prepare_enable(priv->plat->pclk); >> - if (priv->plat->clk_ptp_ref) >> - clk_prepare_enable(priv->plat->clk_ptp_ref); >> + stmmac_init_hwtstamp(priv); > > This was optional, now you always init? Indeed, omitting the if condition here will lead to a needless warning on every reset. Cheers, Ahmad > >> /* reset the phy so that it's ready */ >> if (priv->mii) >> stmmac_mdio_reset(priv->mii); >> >> base-commit: 3db1a3fa98808aa90f95ec3e0fa2fc7abf28f5c9 > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |