lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 27 Dec 2020 15:08:49 +0800
From:   kernel test robot <lkp@...el.com>
To:     Holger Assmann <h.assmann@...gutronix.de>,
        Giuseppe Cavallaro <peppe.cavallaro@...com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        Jose Abreu <joabreu@...opsys.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Rayagond Kokatanur <rayagond@...avyalabs.com>
Cc:     kbuild-all@...ts.01.org, netdev@...r.kernel.org,
        kernel@...gutronix.de, Holger Assmann <h.assmann@...gutronix.de>
Subject: Re: [PATCH 1/2] net: stmmac: retain PTP-clock at hwtstamp_set

Hi Holger,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on 3db1a3fa98808aa90f95ec3e0fa2fc7abf28f5c9]

url:    https://github.com/0day-ci/linux/commits/Holger-Assmann/net-stmmac-retain-PTP-clock-at-hwtstamp_set/20201216-194127
base:    3db1a3fa98808aa90f95ec3e0fa2fc7abf28f5c9
config: arm-randconfig-r021-20201221 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/303da978c0e8ad80e7577245b7c399f601a29b7a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Holger-Assmann/net-stmmac-retain-PTP-clock-at-hwtstamp_set/20201216-194127
        git checkout 303da978c0e8ad80e7577245b7c399f601a29b7a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c: In function 'stmmac_hwtstamp_set':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:528:7: warning: variable 'xmac' set but not used [-Wunused-but-set-variable]
     528 |  bool xmac;
         |       ^~~~


vim +/xmac +528 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

891434b18ec0a21 Rayagond Kokatanur 2013-03-26  503  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  504  /**
d6228b7cdd6e790 Artem Panfilov     2019-01-20  505   *  stmmac_hwtstamp_set - control hardware timestamping.
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  506   *  @dev: device pointer.
8d45e42babb1c7b LABBE Corentin     2017-02-08  507   *  @ifr: An IOCTL specific structure, that can contain a pointer to
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  508   *  a proprietary structure used to pass information to the driver.
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  509   *  Description:
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  510   *  This function configures the MAC to enable/disable both outgoing(TX)
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  511   *  and incoming(RX) packets time stamping based on user input.
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  512   *  Return Value:
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  513   *  0 on success and an appropriate -ve integer on failure.
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  514   */
d6228b7cdd6e790 Artem Panfilov     2019-01-20  515  static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  516  {
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  517  	struct stmmac_priv *priv = netdev_priv(dev);
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  518  	struct hwtstamp_config config;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  519  	u32 ptp_v2 = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  520  	u32 tstamp_all = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  521  	u32 ptp_over_ipv4_udp = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  522  	u32 ptp_over_ipv6_udp = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  523  	u32 ptp_over_ethernet = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  524  	u32 snap_type_sel = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  525  	u32 ts_master_en = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  526  	u32 ts_event_en = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  527  	u32 value = 0;
7d9e6c5afab6bfb Jose Abreu         2018-08-08 @528  	bool xmac;
7d9e6c5afab6bfb Jose Abreu         2018-08-08  529  
7d9e6c5afab6bfb Jose Abreu         2018-08-08  530  	xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  531  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  532  	if (!(priv->dma_cap.time_stamp || priv->adv_ts)) {
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  533  		netdev_alert(priv->dev, "No support for HW time stamping\n");
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  534  		priv->hwts_tx_en = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  535  		priv->hwts_rx_en = 0;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  536  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  537  		return -EOPNOTSUPP;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  538  	}
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  539  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  540  	if (copy_from_user(&config, ifr->ifr_data,
d6228b7cdd6e790 Artem Panfilov     2019-01-20  541  			   sizeof(config)))
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  542  		return -EFAULT;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  543  
38ddc59d65b6d97 LABBE Corentin     2016-11-16  544  	netdev_dbg(priv->dev, "%s config flags:0x%x, tx_type:0x%x, rx_filter:0x%x\n",
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  545  		   __func__, config.flags, config.tx_type, config.rx_filter);
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  546  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  547  	/* reserved for future extensions */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  548  	if (config.flags)
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  549  		return -EINVAL;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  550  
5f3da3281932a79 Ben Hutchings      2013-11-14  551  	if (config.tx_type != HWTSTAMP_TX_OFF &&
5f3da3281932a79 Ben Hutchings      2013-11-14  552  	    config.tx_type != HWTSTAMP_TX_ON)
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  553  		return -ERANGE;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  554  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  555  	if (priv->adv_ts) {
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  556  		switch (config.rx_filter) {
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  557  		case HWTSTAMP_FILTER_NONE:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  558  			/* time stamp no incoming packet at all */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  559  			config.rx_filter = HWTSTAMP_FILTER_NONE;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  560  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  561  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  562  		case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  563  			/* PTP v1, UDP, any kind of event packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  564  			config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
7d8e249f393a1ac Ilias Apalodimas   2019-02-05  565  			/* 'xmac' hardware can support Sync, Pdelay_Req and
7d8e249f393a1ac Ilias Apalodimas   2019-02-05  566  			 * Pdelay_resp by setting bit14 and bits17/16 to 01
7d8e249f393a1ac Ilias Apalodimas   2019-02-05  567  			 * This leaves Delay_Req timestamps out.
7d8e249f393a1ac Ilias Apalodimas   2019-02-05  568  			 * Enable all events *and* general purpose message
7d8e249f393a1ac Ilias Apalodimas   2019-02-05  569  			 * timestamping
7d8e249f393a1ac Ilias Apalodimas   2019-02-05  570  			 */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  571  			snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  572  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  573  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  574  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  575  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  576  		case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  577  			/* PTP v1, UDP, Sync packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  578  			config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_SYNC;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  579  			/* take time stamp for SYNC messages only */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  580  			ts_event_en = PTP_TCR_TSEVNTENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  581  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  582  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  583  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  584  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  585  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  586  		case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  587  			/* PTP v1, UDP, Delay_req packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  588  			config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  589  			/* take time stamp for Delay_Req messages only */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  590  			ts_master_en = PTP_TCR_TSMSTRENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  591  			ts_event_en = PTP_TCR_TSEVNTENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  592  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  593  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  594  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  595  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  596  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  597  		case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  598  			/* PTP v2, UDP, any kind of event packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  599  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  600  			ptp_v2 = PTP_TCR_TSVER2ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  601  			/* take time stamp for all event messages */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  602  			snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  603  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  604  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  605  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  606  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  607  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  608  		case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  609  			/* PTP v2, UDP, Sync packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  610  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_SYNC;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  611  			ptp_v2 = PTP_TCR_TSVER2ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  612  			/* take time stamp for SYNC messages only */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  613  			ts_event_en = PTP_TCR_TSEVNTENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  614  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  615  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  616  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  617  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  618  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  619  		case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  620  			/* PTP v2, UDP, Delay_req packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  621  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  622  			ptp_v2 = PTP_TCR_TSVER2ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  623  			/* take time stamp for Delay_Req messages only */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  624  			ts_master_en = PTP_TCR_TSMSTRENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  625  			ts_event_en = PTP_TCR_TSEVNTENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  626  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  627  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  628  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  629  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  630  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  631  		case HWTSTAMP_FILTER_PTP_V2_EVENT:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  632  			/* PTP v2/802.AS1 any layer, any kind of event packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  633  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  634  			ptp_v2 = PTP_TCR_TSVER2ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  635  			snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
f2fb6b6275eba9d Fugang Duan        2020-05-25  636  			if (priv->synopsys_id != DWMAC_CORE_5_10)
14f347334bf2320 Jose Abreu         2019-09-30  637  				ts_event_en = PTP_TCR_TSEVNTENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  638  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  639  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  640  			ptp_over_ethernet = PTP_TCR_TSIPENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  641  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  642  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  643  		case HWTSTAMP_FILTER_PTP_V2_SYNC:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  644  			/* PTP v2/802.AS1, any layer, Sync packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  645  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_SYNC;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  646  			ptp_v2 = PTP_TCR_TSVER2ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  647  			/* take time stamp for SYNC messages only */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  648  			ts_event_en = PTP_TCR_TSEVNTENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  649  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  650  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  651  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  652  			ptp_over_ethernet = PTP_TCR_TSIPENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  653  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  654  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  655  		case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  656  			/* PTP v2/802.AS1, any layer, Delay_req packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  657  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_DELAY_REQ;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  658  			ptp_v2 = PTP_TCR_TSVER2ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  659  			/* take time stamp for Delay_Req messages only */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  660  			ts_master_en = PTP_TCR_TSMSTRENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  661  			ts_event_en = PTP_TCR_TSEVNTENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  662  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  663  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  664  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  665  			ptp_over_ethernet = PTP_TCR_TSIPENA;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  666  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  667  
e3412575488ac24 Miroslav Lichvar   2017-05-19  668  		case HWTSTAMP_FILTER_NTP_ALL:
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  669  		case HWTSTAMP_FILTER_ALL:
ceb694997e1b5d4 Giuseppe CAVALLARO 2013-04-08  670  			/* time stamp any incoming packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  671  			config.rx_filter = HWTSTAMP_FILTER_ALL;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  672  			tstamp_all = PTP_TCR_TSENALL;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  673  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  674  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  675  		default:
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  676  			return -ERANGE;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  677  		}
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  678  	} else {
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  679  		switch (config.rx_filter) {
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  680  		case HWTSTAMP_FILTER_NONE:
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  681  			config.rx_filter = HWTSTAMP_FILTER_NONE;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  682  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  683  		default:
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  684  			/* PTP v1, UDP, any kind of event packet */
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  685  			config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  686  			break;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  687  		}
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  688  	}
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  689  	priv->hwts_rx_en = ((config.rx_filter == HWTSTAMP_FILTER_NONE) ? 0 : 1);
5f3da3281932a79 Ben Hutchings      2013-11-14  690  	priv->hwts_tx_en = config.tx_type == HWTSTAMP_TX_ON;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  691  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  692  	if (!priv->hwts_tx_en && !priv->hwts_rx_en)
303da978c0e8ad8 Holger Assmann     2020-12-16  693  		stmmac_config_hw_tstamping(priv, priv->ptpaddr, STMMAC_HWTS_ACTIVE);
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  694  	else {
303da978c0e8ad8 Holger Assmann     2020-12-16  695  		value = (STMMAC_HWTS_ACTIVE |
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  696  			 tstamp_all | ptp_v2 | ptp_over_ethernet |
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  697  			 ptp_over_ipv6_udp | ptp_over_ipv4_udp | ts_event_en |
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  698  			 ts_master_en | snap_type_sel);
cc4c9001ce31e0c Jose Abreu         2018-04-16  699  		stmmac_config_hw_tstamping(priv, priv->ptpaddr, value);
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  700  		
303da978c0e8ad8 Holger Assmann     2020-12-16  701  		/* Store flags for later use */
9a8a02c9d46dcd4 Jose Abreu         2018-05-31  702  		priv->systime_flags = value;
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  703  	}
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  704  
d6228b7cdd6e790 Artem Panfilov     2019-01-20  705  	memcpy(&priv->tstamp_config, &config, sizeof(config));
d6228b7cdd6e790 Artem Panfilov     2019-01-20  706  
891434b18ec0a21 Rayagond Kokatanur 2013-03-26  707  	return copy_to_user(ifr->ifr_data, &config,
d6228b7cdd6e790 Artem Panfilov     2019-01-20  708  			    sizeof(config)) ? -EFAULT : 0;
d6228b7cdd6e790 Artem Panfilov     2019-01-20  709  }
d6228b7cdd6e790 Artem Panfilov     2019-01-20  710  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (23214 bytes)

Powered by blists - more mailing lists