[xilinx-xlnx:master 10433/12535] drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:251:9: error: implicit declaration of function 'axienet_mcdma_rx_probe'; did you mean 'axienet_tsn_probe'?

kernel test robot lkp at intel.com
Mon Nov 8 15:39:40 PST 2021


tree:   https://github.com/Xilinx/linux-xlnx master
head:   0a88ef03d3015782318b4bc94ceb20dca375a01b
commit: a798643cd83ffa136df8a0938526671d424758fc [10433/12535] net: xilinx: Add a separate mcdma probe function for TSN IP
config: sparc64-randconfig-r021-20211103 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 11.2.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/Xilinx/linux-xlnx/commit/a798643cd83ffa136df8a0938526671d424758fc
        git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xilinx-xlnx master
        git checkout a798643cd83ffa136df8a0938526671d424758fc
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc64 

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

All errors (new ones prefixed by >>):

   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c: In function 'tsn_ep_open':
   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:57:23: error: implicit declaration of function 'axienet_mcdma_rx_q_init'; did you mean 'axienet_dma_q_init'? [-Werror=implicit-function-declaration]
      57 |                 ret = axienet_mcdma_rx_q_init(ndev, q);
         |                       ^~~~~~~~~~~~~~~~~~~~~~~
         |                       axienet_dma_q_init
   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:60:46: error: 'axienet_mcdma_rx_irq' undeclared (first use in this function); did you mean 'axienet_rx_irq'?
      60 |                 ret = request_irq(q->rx_irq, axienet_mcdma_rx_irq,
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              axienet_rx_irq
   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:60:46: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:66:30: error: 'axienet_mcdma_err_handler' undeclared (first use in this function); did you mean 'axienet_dma_err_handler'?
      66 |                              axienet_mcdma_err_handler,
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~~
         |                              axienet_dma_err_handler
   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:74:23: error: implicit declaration of function 'axienet_mcdma_tx_q_init'; did you mean 'axienet_dma_q_init'? [-Werror=implicit-function-declaration]
      74 |                 ret = axienet_mcdma_tx_q_init(ndev, q);
         |                       ^~~~~~~~~~~~~~~~~~~~~~~
         |                       axienet_dma_q_init
   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:76:46: error: 'axienet_mcdma_tx_irq' undeclared (first use in this function); did you mean 'axienet_tx_irq'?
      76 |                 ret = request_irq(q->tx_irq, axienet_mcdma_tx_irq,
         |                                              ^~~~~~~~~~~~~~~~~~~~
         |                                              axienet_tx_irq
   drivers/net/ethernet/xilinx/xilinx_tsn_ep.c: In function 'tsn_mcdma_probe':
>> drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:251:9: error: implicit declaration of function 'axienet_mcdma_rx_probe'; did you mean 'axienet_tsn_probe'? [-Werror=implicit-function-declaration]
     251 |         axienet_mcdma_rx_probe(pdev, lp, ndev);
         |         ^~~~~~~~~~~~~~~~~~~~~~
         |         axienet_tsn_probe
>> drivers/net/ethernet/xilinx/xilinx_tsn_ep.c:252:9: error: implicit declaration of function 'axienet_mcdma_tx_probe'; did you mean 'axienet_tsn_probe'? [-Werror=implicit-function-declaration]
     252 |         axienet_mcdma_tx_probe(pdev, np, lp);
         |         ^~~~~~~~~~~~~~~~~~~~~~
         |         axienet_tsn_probe
   cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for PTP_1588_CLOCK
   Depends on NET && POSIX_TIMERS
   Selected by
   - XILINX_TSN_PTP && NETDEVICES && ETHERNET && NET_VENDOR_XILINX && XILINX_TSN
   Selected by
   - XILINX_AXI_EMAC_HWTSTAMP && NETDEVICES && ETHERNET && NET_VENDOR_XILINX && XILINX_AXI_EMAC


vim +251 drivers/net/ethernet/xilinx/xilinx_tsn_ep.c

    30	
    31	/**
    32	 * tsn_ep_open - TSN EP driver open routine.
    33	 * @ndev:	Pointer to net_device structure
    34	 *
    35	 * Return: 0, on success.
    36	 *	    non-zero error value on failure
    37	 *
    38	 * This is the driver open routine. It also allocates interrupt service
    39	 * routines, enables the interrupt lines and ISR handling. Axi Ethernet
    40	 * core is reset through Axi DMA core. Buffer descriptors are initialized.
    41	 */
    42	static int tsn_ep_open(struct net_device *ndev)
    43	{
    44		int ret, i = 0;
    45		struct axienet_local *lp = netdev_priv(ndev);
    46		struct axienet_dma_q *q;
    47	
    48		for_each_tx_dma_queue(lp, i) {
    49			q = lp->dq[i];
    50			/*MCDMA TX RESET*/
    51			__axienet_device_reset(q);
    52		}
    53	
    54		for_each_rx_dma_queue(lp, i) {
    55			q = lp->dq[i];
    56	
    57			ret = axienet_mcdma_rx_q_init(ndev, q);
    58			/* Enable interrupts for Axi MCDMA Rx
    59			 */
    60			ret = request_irq(q->rx_irq, axienet_mcdma_rx_irq,
    61					  IRQF_SHARED, ndev->name, ndev);
    62			if (ret)
    63				goto err_dma_rx_irq;
    64	
    65			tasklet_init(&lp->dma_err_tasklet[i],
    66				     axienet_mcdma_err_handler,
    67				     (unsigned long)lp->dq[i]);
    68			napi_enable(&lp->napi[i]);
    69		}
    70	
    71		for_each_tx_dma_queue(lp, i) {
    72			q = lp->dq[i];
    73	
  > 74			ret = axienet_mcdma_tx_q_init(ndev, q);
    75			/* Enable interrupts for Axi MCDMA Tx */
  > 76			ret = request_irq(q->tx_irq, axienet_mcdma_tx_irq,
    77					  IRQF_SHARED, ndev->name, ndev);
    78			if (ret)
    79				goto err_dma_tx_irq;
    80		}
    81	
    82		netif_tx_start_all_queues(ndev);
    83		return 0;
    84	
    85	err_dma_tx_irq:
    86		for_each_rx_dma_queue(lp, i) {
    87			q = lp->dq[i];
    88			free_irq(q->rx_irq, ndev);
    89		}
    90	err_dma_rx_irq:
    91		return ret;
    92	}
    93	
    94	/**
    95	 * tsn_ep_stop - TSN EP driver stop routine.
    96	 * @ndev:	Pointer to net_device structure
    97	 *
    98	 * Return: 0, on success.
    99	 *
   100	 * This is the driver stop routine. It also removes the interrupt handlers
   101	 * and disables the interrupts. The Axi DMA Tx/Rx BDs are released.
   102	 */
   103	static int tsn_ep_stop(struct net_device *ndev)
   104	{
   105		u32 cr;
   106		u32 i;
   107		struct axienet_local *lp = netdev_priv(ndev);
   108		struct axienet_dma_q *q;
   109	
   110		for_each_tx_dma_queue(lp, i) {
   111			q = lp->dq[i];
   112			cr = axienet_dma_in32(q, XAXIDMA_TX_CR_OFFSET);
   113			axienet_dma_out32(q, XAXIDMA_TX_CR_OFFSET,
   114					  cr & (~XAXIDMA_CR_RUNSTOP_MASK));
   115			if (netif_running(ndev))
   116				netif_stop_queue(ndev);
   117			free_irq(q->tx_irq, ndev);
   118		}
   119		for_each_rx_dma_queue(lp, i) {
   120			q = lp->dq[i];
   121			cr = axienet_dma_in32(q, XAXIDMA_RX_CR_OFFSET);
   122			axienet_dma_out32(q, XAXIDMA_RX_CR_OFFSET,
   123					  cr & (~XAXIDMA_CR_RUNSTOP_MASK));
   124			if (netif_running(ndev))
   125				netif_stop_queue(ndev);
   126			napi_disable(&lp->napi[i]);
   127			tasklet_kill(&lp->dma_err_tasklet[i]);
   128	
   129			free_irq(q->rx_irq, ndev);
   130		}
   131	
   132		return 0;
   133	}
   134	
   135	/**
   136	 * tsn_ep_ioctl - TSN endpoint ioctl interface.
   137	 * @dev: Pointer to the net_device structure
   138	 * @rq: Socket ioctl interface request structure
   139	 * @cmd: Ioctl case
   140	 *
   141	 * Return: 0 on success, Non-zero error value on failure.
   142	 *
   143	 * This is the ioctl interface for TSN end point. Currently this
   144	 * supports only gate programming.
   145	 */
   146	static int tsn_ep_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
   147	{
   148		switch (cmd) {
   149	#ifdef CONFIG_XILINX_TSN_QBV
   150		case SIOCCHIOCTL:
   151			return axienet_set_schedule(dev, rq->ifr_data);
   152		case SIOC_GET_SCHED:
   153			return axienet_get_schedule(dev, rq->ifr_data);
   154	#endif
   155		default:
   156			return -EOPNOTSUPP;
   157		}
   158	}
   159	
   160	/**
   161	 * tsn_ep_xmit - TSN endpoint xmit routine.
   162	 * @skb: Packet data
   163	 * @dev: Pointer to the net_device structure
   164	 *
   165	 * Return: Always returns NETDEV_TX_OK.
   166	 *
   167	 * This is dummy xmit function for endpoint as all the data path is assumed to
   168	 * be connected by TEMAC1 as per linux view
   169	 */
   170	static int tsn_ep_xmit(struct sk_buff *skb, struct net_device *dev)
   171	{
   172		kfree_skb(skb);
   173		return NETDEV_TX_OK;
   174	}
   175	
   176	static const struct net_device_ops ep_netdev_ops = {
   177		.ndo_open = tsn_ep_open,
   178		.ndo_stop = tsn_ep_stop,
   179		.ndo_do_ioctl = tsn_ep_ioctl,
   180		.ndo_start_xmit = tsn_ep_xmit,
   181	};
   182	
   183	static const struct of_device_id tsn_ep_of_match[] = {
   184		{ .compatible = "xlnx,tsn-ep"},
   185		{},
   186	};
   187	
   188	MODULE_DEVICE_TABLE(of, tsn_ep_of_match);
   189	
   190	/* separate function is needed to probe tsn mcdma
   191	 * as there is asymmetry between rx channels and tx channels
   192	 * having unique probe for both tsn and axienet with mcdma is not possible
   193	 */
   194	static int __maybe_unused tsn_mcdma_probe(struct platform_device *pdev,
   195						  struct axienet_local *lp,
   196						  struct net_device *ndev)
   197	{
   198		int i, ret = 0;
   199		struct axienet_dma_q *q;
   200		struct device_node *np;
   201		struct resource dmares;
   202		const char *str;
   203		u32 num;
   204	
   205		ret = of_property_count_strings(pdev->dev.of_node, "xlnx,channel-ids");
   206		if (ret < 0)
   207			return -EINVAL;
   208	
   209		np = of_parse_phandle(pdev->dev.of_node, "axistream-connected-rx",
   210				      0);
   211		/* get number of associated queues */
   212		ret = of_property_read_u32(np, "xlnx,num-s2mm-channels", &num);
   213		if (ret < 0)
   214			return -EINVAL;
   215	
   216		lp->num_rx_queues = num;
   217		pr_info("%s: num_rx_queues: %d\n", __func__, lp->num_rx_queues);
   218	
   219		for_each_rx_dma_queue(lp, i) {
   220			q = kzalloc(sizeof(*q), GFP_KERNEL);
   221	
   222			/* parent */
   223			q->lp = lp;
   224			lp->dq[i] = q;
   225			ret = of_property_read_string_index(pdev->dev.of_node,
   226							    "xlnx,channel-ids", i,
   227							    &str);
   228			ret = kstrtou16(str, 16, &q->chan_id);
   229			lp->qnum[i] = i;
   230			lp->chan_num[i] = q->chan_id;
   231		}
   232	
   233		if (IS_ERR(np)) {
   234			dev_err(&pdev->dev, "could not find DMA node\n");
   235			return ret;
   236		}
   237	
   238		ret = of_address_to_resource(np, 0, &dmares);
   239		if (ret) {
   240			dev_err(&pdev->dev, "unable to get DMA resource\n");
   241			return ret;
   242		}
   243	
   244		lp->mcdma_regs = devm_ioremap_resource(&pdev->dev, &dmares);
   245		if (IS_ERR(lp->mcdma_regs)) {
   246			dev_err(&pdev->dev, "iormeap failed for the dma\n");
   247			ret = PTR_ERR(lp->mcdma_regs);
   248			return ret;
   249		}
   250	
 > 251		axienet_mcdma_rx_probe(pdev, lp, ndev);
 > 252		axienet_mcdma_tx_probe(pdev, np, lp);
   253	
   254		return 0;
   255	}
   256	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 37668 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211109/76091e7e/attachment-0001.gz>


More information about the linux-arm-kernel mailing list