From nobody Fri Dec 19 19:16:38 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3862EC4332F for ; Tue, 14 Nov 2023 11:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233089AbjKNLaC (ORCPT ); Tue, 14 Nov 2023 06:30:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232984AbjKNL3T (ORCPT ); Tue, 14 Nov 2023 06:29:19 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C9381BF8; Tue, 14 Nov 2023 03:28:59 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9856860008; Tue, 14 Nov 2023 11:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1699961337; 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=xRVp9zBKQvCZ72vII/R3dn2g9lLmskljfqZbCexdHAY=; b=QZQkWtSl7PmdL73sxcougZ9DULCoiLNr/Jy23LSSav81BScnnp7ruModPFv/n0nEIboFFm D5iZoMMk41fBXAPqdrVKt7/r4BnBMoUfV4X9S6iVLpH2EB+Ork30YBWIYXawhIj1fVUVoh Dbra9ThaRleSY6RFzg1cS83QpLJjSzzhKbquAMAhUyZNAB7doVXurnqrfczCriyGazI2dy GZ/t7Tb/2jSRP7RdO1gvbpnzP0RWTRf+k91zjln9irqjpc7DpsYlGSC4iCgMXXJTLNzzdJ 0hbFfz6MYhi+09uBslUlQ/LOSU3o3W9dhT7qf3H37nG6BiFQTQqiX4wX9e7PoQ== From: Kory Maincent Date: Tue, 14 Nov 2023 12:28:34 +0100 Subject: [PATCH net-next v7 06/16] net: phy: micrel: fix ts_info value in case of no phc MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20231114-feature_ptp_netnext-v7-6-472e77951e40@bootlin.com> References: <20231114-feature_ptp_netnext-v7-0-472e77951e40@bootlin.com> In-Reply-To: <20231114-feature_ptp_netnext-v7-0-472e77951e40@bootlin.com> To: Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier , Kory Maincent X-Mailer: b4 0.12.4 X-GND-Sasl: kory.maincent@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of no phc we should not return SOFTWARE TIMESTAMPING flags as we do not know whether the netdev supports of timestamping. Remove it from the lan8841_ts_info and simply return 0. Signed-off-by: Kory Maincent --- This patch is not tested but it seems consistent to me. Changes in v6: - Update the commit message. --- drivers/net/phy/micrel.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 99af1e500c6c..bd4cd082662f 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -3629,12 +3629,8 @@ static int lan8841_ts_info(struct mii_timestamper *m= ii_ts, =20 info->phc_index =3D ptp_priv->ptp_clock ? ptp_clock_index(ptp_priv->ptp_clock) : -1; - if (info->phc_index =3D=3D -1) { - info->so_timestamping |=3D SOF_TIMESTAMPING_TX_SOFTWARE | - SOF_TIMESTAMPING_RX_SOFTWARE | - SOF_TIMESTAMPING_SOFTWARE; + if (info->phc_index =3D=3D -1) return 0; - } =20 info->so_timestamping =3D SOF_TIMESTAMPING_TX_HARDWARE | SOF_TIMESTAMPING_RX_HARDWARE | --=20 2.25.1