Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp392757rdb; Thu, 19 Oct 2023 07:31:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGh+klHYNANOANhvmQ9vJtfHUsl9MUgYVM+N2v0kWlvSxBXtQw0HjW0KVwYe0Fh2p58+bgk X-Received: by 2002:a17:902:cec8:b0:1ca:7af1:8a85 with SMTP id d8-20020a170902cec800b001ca7af18a85mr3081186plg.57.1697725868248; Thu, 19 Oct 2023 07:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697725868; cv=none; d=google.com; s=arc-20160816; b=s7nCs58OlTSIuZpoStClcR19GT8AIMmY4cGfkd7eU+3uBZS3EtBtO9Jj8p9EHN/h5D CocFMaEJ+eUXPPsm69vquERJHZxKEoKEL64oAbxABYKqpuo4capAHMhdeBCRau55+sey gqq5EpKeXKyWWN7UzYVkuPh4tOOV4qqgOkO3EtKlQsbnZsCOguYzRkA5WpHwpnecv9lt +PVu+Gwwjjl70M6iO4HrgsAVhk53fc7lC9OSof+vnzD7k7KHksFHUbcUknt+s4cUlkbx 8fOAUQxF7KS5acbMIXuEkyLS9Docdey2xMd7M4vLBXqZU7B8XBaj4lx7DNvM7ikeHVF+ XvkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=xURoacXcM4pBrKyqRvjgBEjVThCkCkRaNKdoTaIAdxk=; fh=IL4Om7kRbYP5ILTMWk7kzVj5RVF0+t2ztL6E2Yzsl4U=; b=RRM1VA93+KEsSIkWXbVR8DHRYsHMLg6bRE69ePvXHAwIvMoqAdrppFf2ttNUyn/Q2x miztH7EqFjv22kG0mqRfYRDQB1ZGMnR6xOoIijL6XawqwhyvLB0ptSPcS1RGylfXg5Hc SPsSi9RPxWQI3hPoYRljrm2O0CihvRGUc4K/yq1Pp0ta8mch0Yd+yXNaB/tHvYKqIorG ooXXAiz9NQ7b2hAlxso1eXcDXts4WgszwDIuuOXK+f9mhsjVe+Dvogbk6jpho4b4DgDU RrXWqBLeKjh8t44Z2L/iLw7abr84mj+cJhHhQWvxOUlVxLc5ClOB2A+cCehR4YJ45qn0 juWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=k8QZBFky; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u14-20020a17090341ce00b001ca87c9e9d4si2480426ple.598.2023.10.19.07.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 07:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=k8QZBFky; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DD1BB8088A70; Thu, 19 Oct 2023 07:30:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346192AbjJSOaL (ORCPT + 99 others); Thu, 19 Oct 2023 10:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346085AbjJSO3w (ORCPT ); Thu, 19 Oct 2023 10:29:52 -0400 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 9E5F1B0; Thu, 19 Oct 2023 07:29:49 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id E52E960013; Thu, 19 Oct 2023 14:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697725788; 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=xURoacXcM4pBrKyqRvjgBEjVThCkCkRaNKdoTaIAdxk=; b=k8QZBFky9wJnXKs1a2UpjYNtGxE+b27BFWRhmJB6qytTIOPL6okxgbCC+t7jhHBfkeQqI2 E5ZpHOyAUPA5X9PqgxMQNwIaEAg1PVS8pvY44gMuJE2REY9NG1uud0powJF6bB1qqoqdVp dCqiziXMSwlg4/9C1AoqKmE2vtCn05wZAV0whey8Z0epn+xNvXTqOoMmIrNhR6G1dFyP0r 3E9TtgokJECVnk0+6Hl8nl31ljpWW4OzqYTaMYdJtxILIoh4dUBoCnfe8XDrJ9m896qSqb p5fhAT/bnUDxIToikyLTX9Y7nBbpbkZ1QmMoT1wUBCvuQqcW30TkvCVB7Pavcw== From: Kory Maincent Date: Thu, 19 Oct 2023 16:29:21 +0200 Subject: [PATCH net-next v6 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: 7bit Message-Id: <20231019-feature_ptp_netnext-v6-6-71affc27b0e5@bootlin.com> References: <20231019-feature_ptp_netnext-v6-0-71affc27b0e5@bootlin.com> In-Reply-To: <20231019-feature_ptp_netnext-v6-0-71affc27b0e5@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.3 X-GND-Sasl: kory.maincent@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 07:30:33 -0700 (PDT) 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 43d072b53839..4c115e55ffc0 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -3607,12 +3607,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 | -- 2.25.1