From patchwork Tue Nov 14 11:28:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 13455185 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 814592D62E; Tue, 14 Nov 2023 11:29:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QZQkWtSl" 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 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 X-Patchwork-Delegate: kuba@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 *mii_ts, info->phc_index = ptp_priv->ptp_clock ? ptp_clock_index(ptp_priv->ptp_clock) : -1; - if (info->phc_index == -1) { - info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE | - SOF_TIMESTAMPING_RX_SOFTWARE | - SOF_TIMESTAMPING_SOFTWARE; + if (info->phc_index == -1) return 0; - } info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE | SOF_TIMESTAMPING_RX_HARDWARE |