Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp228017rdg; Tue, 10 Oct 2023 08:38:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVCu1AN8EaPI0uCo3Nm0SJz4J3gF6oueZGFKZD8bN3Dqna6rE3Tl0fj2uaeVe4jcm9KSQi X-Received: by 2002:a17:902:8c85:b0:1c8:7489:56e2 with SMTP id t5-20020a1709028c8500b001c8748956e2mr13338812plo.35.1696952290155; Tue, 10 Oct 2023 08:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696952290; cv=none; d=google.com; s=arc-20160816; b=BQ7LEBwhwZuNfEu4FYMcLGzYTeM7BZcAQL6NoYVJCa5AYZQTfKwwE5jrhoX7bB9uuw FgYm2kmX9qRwdYSaD5UBc2O6UP2pdGV8TXliEMvS1EwfbTzpXZD/T+RJmAJWxKF0mGR6 a4P5PG+1TbFxEMgfFEO/O7nTa2xAu3YVIFkt3hVl/A8l8f/WTxvwR3+inFJ4m+OSVdoq E4k1HUhHw4QPxkp65Ru9vGn8MPTGAaDCk8HV8GLhfg6/Ra976rn3DNiv23YW+b2JjTrM py7xmcVeyAKo+0r4LKq0rOgn6koHrzh+1Mr3vpyssGOCcwqQUN5Cl+41sSDd0cjXxzdx DkVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AJYxmLMgsxBG67CJ9vLQsnDKKsAwNcBYmQsmqhnPPII=; fh=Or1ZZ7YYchPSrQhYT6Sx7o/g1YHBDUFpLe8WgJow04I=; b=nzmi8WULGfdh5GEgFmTeX55HUPo3thKl/TPK+Mi72qYKfU5/+YtBQYMxf7Rqvd9PLW FUVzn3B6XzwAIkeMs+FSr3J7V2iWjzJK1MAjFSWqs3kxCbZ6KRnIMpw45nBsI/yZbx5A /tnvC+pLKgaBbWOC6Uj2RCnyIvZAOxXMKBPeg3JPIRx0lMg+F/4kY9qALNu4g+a5fY0/ cFa6BEPAGcuh6EVxr9LRnTZD080kKqtSlBBXQ9HIsMJYyrkhyA1a2pxwGV1sYdq5njsV CGpAvOinRMG5+C3Vtje6L0Ba+FVThB1WeT2NRxBiRJ10WbJZOdZoTWsb8D54/QE8bX7N Ubdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kG+srMFa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id h4-20020a170902f54400b001c61bd9db5csi10743927plf.317.2023.10.10.08.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 08:38:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kG+srMFa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3FCF680A7906; Tue, 10 Oct 2023 08:38:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233378AbjJJPh7 (ORCPT + 99 others); Tue, 10 Oct 2023 11:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233385AbjJJPh6 (ORCPT ); Tue, 10 Oct 2023 11:37:58 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03571D8; Tue, 10 Oct 2023 08:37:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE456C433C7; Tue, 10 Oct 2023 15:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696952274; bh=ccn0ErrI3BKGdflhAH1/B0pSw0wAE/4xTGwBpyvuDHw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kG+srMFaKg3Sy4x78n9VSvAOJFgmN0tdjNSTW/JeDSUZzFPLVe3WowEvrDEfZ+JSv DegXXrPaqpdMdctSGVLgHgU2EsUP9+VL0GbCMLEuA27pJl2InJCFBZnTdq+OCQE7m3 7dNritxb+Rz0HFEy0DvIWu+OWocGqGTSKH8pVS2BL1pO7s85X40JdKsKaLC4dHuuqE 6BOR5JmgtWj5yM8HibBVEJems72H2ueDl2y4Ph2mcebhKw/g6AcnAqKMIuF3K8zlKJ JIbFWypFUL53+BB3R4sIBMKQoV1iih1afXuD6Zflj2N+sUaIM3Lvrq/FPs2WYICkrZ M3cIxSC17Pn1Q== Date: Tue, 10 Oct 2023 17:37:47 +0200 From: Simon Horman To: =?utf-8?B?S8O2cnk=?= Maincent Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Thomas Petazzoni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Horatiu Vultur , UNGLinuxDriver@microchip.com, Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , Richard Cochran , Radu Pirea , Willem de Bruijn , Vladimir Oltean , Michael Walle , Jacob Keller , Maxime Chevallier Subject: Re: [PATCH net-next v5 01/16] net: Convert PHYs hwtstamp callback to use kernel_hwtstamp_config Message-ID: References: <20231009155138.86458-1-kory.maincent@bootlin.com> <20231009155138.86458-2-kory.maincent@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231009155138.86458-2-kory.maincent@bootlin.com> X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 10 Oct 2023 08:38:07 -0700 (PDT) X-Spam-Level: ** ... > diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c > index 7ab080ff02df..416484ea6eb3 100644 > --- a/drivers/net/phy/nxp-c45-tja11xx.c > +++ b/drivers/net/phy/nxp-c45-tja11xx.c > @@ -1022,24 +1022,21 @@ static bool nxp_c45_rxtstamp(struct mii_timestamper *mii_ts, > } > > static int nxp_c45_hwtstamp(struct mii_timestamper *mii_ts, > - struct ifreq *ifreq) > + struct kernel_hwtstamp_config *config, > + struct netlink_ext_ack *extack) > { > struct nxp_c45_phy *priv = container_of(mii_ts, struct nxp_c45_phy, > mii_ts); > struct phy_device *phydev = priv->phydev; > const struct nxp_c45_phy_data *data; > - struct hwtstamp_config cfg; > > - if (copy_from_user(&cfg, ifreq->ifr_data, sizeof(cfg))) > - return -EFAULT; > - > - if (cfg.tx_type < 0 || cfg.tx_type > HWTSTAMP_TX_ON) > + if (cfg->tx_type < 0 || cfg->tx_type > HWTSTAMP_TX_ON) Hi Köry, cfg is removed from this function by this patch, but is used here. > return -ERANGE; > > data = nxp_c45_get_data(phydev); > - priv->hwts_tx = cfg.tx_type; > + priv->hwts_tx = cfg->tx_type; > > - switch (cfg.rx_filter) { > + switch (cfg->rx_filter) { > case HWTSTAMP_FILTER_NONE: > priv->hwts_rx = 0; > break; > @@ -1047,7 +1044,7 @@ static int nxp_c45_hwtstamp(struct mii_timestamper *mii_ts, > case HWTSTAMP_FILTER_PTP_V2_L2_SYNC: > case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: > priv->hwts_rx = 1; > - cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT; > + cfg->rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT; > break; > default: > return -ERANGE; > @@ -1074,7 +1071,7 @@ static int nxp_c45_hwtstamp(struct mii_timestamper *mii_ts, > nxp_c45_clear_reg_field(phydev, &data->regmap->irq_egr_ts_en); > > nxp_c45_no_ptp_irq: > - return copy_to_user(ifreq->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0; > + return 0; > } > ...