Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp392264rdb; Thu, 19 Oct 2023 07:30:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFER7nbepylmH5SNnuur1PjFEwwqKPXmHFoAUDg8OStYBaIb6rMPjExMVvIPLykKkFDvs2j X-Received: by 2002:a05:6a20:2594:b0:17b:7dda:c10b with SMTP id k20-20020a056a20259400b0017b7ddac10bmr2085908pzd.5.1697725832368; Thu, 19 Oct 2023 07:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697725832; cv=none; d=google.com; s=arc-20160816; b=to59Xo0ioGd8eVBt4QEy60ID9Oxv0j2jC88A4BdTuuOl9UDYA4sy1MvjxEaqB/VLnY HNQZiIud+Ywni9p/cr/YoQ1aNMnNpaa9ePfbXBaf/QJrBMJW6mVAsov4af4KpLS33S4R K0U3rN0SP4ZUu1DaC/BDtcDxLxmjICWheLEq5gwB8hUhPv97BLKwGX8p4qNJxH8rk9sK AN6iJc6Cwrlq2IrvEcUHjM7BzS5TN4DO5ibkKQDkm7Aeii1J7U5oZDTVtq6gCXzaialz a/DfvkTIpkaP/pH3bB56YQwhzJWR9WZqKTdlrgt8svf7hyyd2WRMc74yWxYeL1/aRYOR pDJg== 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=iLcv2U5/tJBWHcDOVIYyQDAJQb5WKSZvw4UjIoMJnco=; fh=IL4Om7kRbYP5ILTMWk7kzVj5RVF0+t2ztL6E2Yzsl4U=; b=DtNWWmw81zkwZjX1mhnENhuoQ/6VTLnOFaba39evJ1GEQCFgzqnF3l+vFHu5ff++hv P2csjedOZTjbjGOCj+Le8ufTl6lK1oC6J9v7qIVj2ORXkbDoiQKgsGtdHh9kJdsNtQ95 GpCBhjwBmEtdFKRAQOH9jUXDjHMrTEX6dQshkMGL3dAWe856DqOwilmhhomA9eof/5aS J1ePwdA4UGmdfhSgPorGOtpbGGyUMClHQwygbF1X2pMA+MPHvGCvpNy8ESwwjC9xydWW a42nOwRj5cFVevJGTU1Z/tnqqkA5/mTBfa7BUS+q8TPAOIL+inFJxB/bGmw4JwQhGn06 +9gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Ij3j/CTi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e11-20020a17090a804b00b00276671731e3si2323646pjw.136.2023.10.19.07.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 07:30:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Ij3j/CTi"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 51F9A83B7A81; Thu, 19 Oct 2023 07:30:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346103AbjJSO3r (ORCPT + 99 others); Thu, 19 Oct 2023 10:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345641AbjJSO3q (ORCPT ); Thu, 19 Oct 2023 10:29:46 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A3AA119; Thu, 19 Oct 2023 07:29:43 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7527A60004; Thu, 19 Oct 2023 14:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697725782; 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=iLcv2U5/tJBWHcDOVIYyQDAJQb5WKSZvw4UjIoMJnco=; b=Ij3j/CTi+ULBqRLsOa3XYt71BVUJlYUwYm01CUtgNBboUfUX4Jc+GiMLIqYoQzklhsFR47 daVnAx59wx+o4YsMICB6sSTMwp94gkGEwzvxUI5nkgNgF4GloaI56kg8nJxfZop5a4hudu o915NnGDC1iMHXLMBlfAVVI66T0hNGzLkaM1l+8hANBkEL6/OQowSHwyjqTAk1jDxRrSvX EHqIrNIuVvklbCioJ2BBRwSzwEel7Tsh8fR3yMxSN512QPaw7ndMFMhvUCX8ybtn3AvBwr 5t6ZHHW5N5fR9oW2Sceop8lKr3fF+ld+u3VqOIjwwzaNYzAjH9MWHySWm7QEbg== From: Kory Maincent Date: Thu, 19 Oct 2023 16:29:17 +0200 Subject: [PATCH net-next v6 02/16] net: phy: Remove the call to phy_mii_ioctl in phy_hwstamp_get/set MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231019-feature_ptp_netnext-v6-2-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 fry.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 (fry.vger.email [0.0.0.0]); Thu, 19 Oct 2023 07:30:00 -0700 (PDT) __phy_hwtstamp_set function were calling the phy_mii_ioctl function which will then use the ifreq pointer to call the hwtstamp callback. Now that ifreq has been removed from the hwstamp callback parameters it seems more logical to not go through the phy_mii_ioctl function and pass directly kernel_hwtstamp_config parameter to the hwtstamp callback. Lets do the same for __phy_hwtstamp_get function and return directly EOPNOTSUPP as SIOCGHWTSTAMP is not supported for now for the PHYs. Signed-off-by: Kory Maincent Reviewed-by: Florian Fainelli --- drivers/net/phy/phy.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index d058316666ba..3376e58e2b88 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -486,7 +486,7 @@ int __phy_hwtstamp_get(struct phy_device *phydev, if (!phydev) return -ENODEV; - return phy_mii_ioctl(phydev, config->ifr, SIOCGHWTSTAMP); + return -EOPNOTSUPP; } /** @@ -503,7 +503,10 @@ int __phy_hwtstamp_set(struct phy_device *phydev, if (!phydev) return -ENODEV; - return phy_mii_ioctl(phydev, config->ifr, SIOCSHWTSTAMP); + if (phydev->mii_ts && phydev->mii_ts->hwtstamp) + return phydev->mii_ts->hwtstamp(phydev->mii_ts, config, extack); + + return -EOPNOTSUPP; } /** -- 2.25.1