[linusw-nomadik:ux500-charging-v5.18-rc1 14/14] drivers/dma/qcom/bam_dma.c:1316:32: error: 'dma_work' undeclared

kernel test robot lkp at intel.com
Sat Apr 30 23:01:05 PDT 2022


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git ux500-charging-v5.18-rc1
head:   1e198cb5bdd34fd231f456c23fe57d35d71fdeda
commit: 1e198cb5bdd34fd231f456c23fe57d35d71fdeda [14/14] drivers/dma/*: replace tasklets with workqueue
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20220501/202205011351.PbUolxgm-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.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://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/commit/?id=1e198cb5bdd34fd231f456c23fe57d35d71fdeda
        git remote add linusw-nomadik https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git
        git fetch --no-tags linusw-nomadik ux500-charging-v5.18-rc1
        git checkout 1e198cb5bdd34fd231f456c23fe57d35d71fdeda
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/dma/qcom/

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 >>):

   In file included from include/linux/mm_types.h:18,
                    from include/linux/mmzone.h:21,
                    from include/linux/gfp.h:6,
                    from include/linux/slab.h:15,
                    from drivers/dma/qcom/bam_dma.c:29:
   drivers/dma/qcom/bam_dma.c: In function 'bam_dma_probe':
>> drivers/dma/qcom/bam_dma.c:1316:32: error: 'dma_work' undeclared (first use in this function)
    1316 |         INIT_WORK(&bdev->work, dma_work);
         |                                ^~~~~~~~
   include/linux/workqueue.h:232:34: note: in definition of macro '__INIT_WORK'
     232 |                 (_work)->func = (_func);                                \
         |                                  ^~~~~
   drivers/dma/qcom/bam_dma.c:1316:9: note: in expansion of macro 'INIT_WORK'
    1316 |         INIT_WORK(&bdev->work, dma_work);
         |         ^~~~~~~~~
   drivers/dma/qcom/bam_dma.c:1316:32: note: each undeclared identifier is reported only once for each function it appears in
    1316 |         INIT_WORK(&bdev->work, dma_work);
         |                                ^~~~~~~~
   include/linux/workqueue.h:232:34: note: in definition of macro '__INIT_WORK'
     232 |                 (_work)->func = (_func);                                \
         |                                  ^~~~~
   drivers/dma/qcom/bam_dma.c:1316:9: note: in expansion of macro 'INIT_WORK'
    1316 |         INIT_WORK(&bdev->work, dma_work);
         |         ^~~~~~~~~
   At top level:
   drivers/dma/qcom/bam_dma.c:1123:13: warning: 'dma_workqueue' defined but not used [-Wunused-function]
    1123 | static void dma_workqueue(struct work_struct *work)
         |             ^~~~~~~~~~~~~


vim +/dma_work +1316 drivers/dma/qcom/bam_dma.c

  1244	
  1245	static int bam_dma_probe(struct platform_device *pdev)
  1246	{
  1247		struct bam_device *bdev;
  1248		const struct of_device_id *match;
  1249		struct resource *iores;
  1250		int ret, i;
  1251	
  1252		bdev = devm_kzalloc(&pdev->dev, sizeof(*bdev), GFP_KERNEL);
  1253		if (!bdev)
  1254			return -ENOMEM;
  1255	
  1256		bdev->dev = &pdev->dev;
  1257	
  1258		match = of_match_node(bam_of_match, pdev->dev.of_node);
  1259		if (!match) {
  1260			dev_err(&pdev->dev, "Unsupported BAM module\n");
  1261			return -ENODEV;
  1262		}
  1263	
  1264		bdev->layout = match->data;
  1265	
  1266		iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  1267		bdev->regs = devm_ioremap_resource(&pdev->dev, iores);
  1268		if (IS_ERR(bdev->regs))
  1269			return PTR_ERR(bdev->regs);
  1270	
  1271		bdev->irq = platform_get_irq(pdev, 0);
  1272		if (bdev->irq < 0)
  1273			return bdev->irq;
  1274	
  1275		ret = of_property_read_u32(pdev->dev.of_node, "qcom,ee", &bdev->ee);
  1276		if (ret) {
  1277			dev_err(bdev->dev, "Execution environment unspecified\n");
  1278			return ret;
  1279		}
  1280	
  1281		bdev->controlled_remotely = of_property_read_bool(pdev->dev.of_node,
  1282							"qcom,controlled-remotely");
  1283		bdev->powered_remotely = of_property_read_bool(pdev->dev.of_node,
  1284							"qcom,powered-remotely");
  1285	
  1286		if (bdev->controlled_remotely || bdev->powered_remotely) {
  1287			ret = of_property_read_u32(pdev->dev.of_node, "num-channels",
  1288						   &bdev->num_channels);
  1289			if (ret)
  1290				dev_err(bdev->dev, "num-channels unspecified in dt\n");
  1291	
  1292			ret = of_property_read_u32(pdev->dev.of_node, "qcom,num-ees",
  1293						   &bdev->num_ees);
  1294			if (ret)
  1295				dev_err(bdev->dev, "num-ees unspecified in dt\n");
  1296		}
  1297	
  1298		if (bdev->controlled_remotely || bdev->powered_remotely)
  1299			bdev->bamclk = devm_clk_get_optional(bdev->dev, "bam_clk");
  1300		else
  1301			bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");
  1302	
  1303		if (IS_ERR(bdev->bamclk))
  1304			return PTR_ERR(bdev->bamclk);
  1305	
  1306		ret = clk_prepare_enable(bdev->bamclk);
  1307		if (ret) {
  1308			dev_err(bdev->dev, "failed to prepare/enable clock\n");
  1309			return ret;
  1310		}
  1311	
  1312		ret = bam_init(bdev);
  1313		if (ret)
  1314			goto err_disable_clk;
  1315	
> 1316		INIT_WORK(&bdev->work, dma_work);
  1317	
  1318		bdev->channels = devm_kcalloc(bdev->dev, bdev->num_channels,
  1319					sizeof(*bdev->channels), GFP_KERNEL);
  1320	
  1321		if (!bdev->channels) {
  1322			ret = -ENOMEM;
  1323			goto err_wq_kill;
  1324		}
  1325	
  1326		/* allocate and initialize channels */
  1327		INIT_LIST_HEAD(&bdev->common.channels);
  1328	
  1329		for (i = 0; i < bdev->num_channels; i++)
  1330			bam_channel_init(bdev, &bdev->channels[i], i);
  1331	
  1332		ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq,
  1333				IRQF_TRIGGER_HIGH, "bam_dma", bdev);
  1334		if (ret)
  1335			goto err_bam_channel_exit;
  1336	
  1337		/* set max dma segment size */
  1338		bdev->common.dev = bdev->dev;
  1339		ret = dma_set_max_seg_size(bdev->common.dev, BAM_FIFO_SIZE);
  1340		if (ret) {
  1341			dev_err(bdev->dev, "cannot set maximum segment size\n");
  1342			goto err_bam_channel_exit;
  1343		}
  1344	
  1345		platform_set_drvdata(pdev, bdev);
  1346	
  1347		/* set capabilities */
  1348		dma_cap_zero(bdev->common.cap_mask);
  1349		dma_cap_set(DMA_SLAVE, bdev->common.cap_mask);
  1350	
  1351		/* initialize dmaengine apis */
  1352		bdev->common.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
  1353		bdev->common.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT;
  1354		bdev->common.src_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
  1355		bdev->common.dst_addr_widths = DMA_SLAVE_BUSWIDTH_4_BYTES;
  1356		bdev->common.device_alloc_chan_resources = bam_alloc_chan;
  1357		bdev->common.device_free_chan_resources = bam_free_chan;
  1358		bdev->common.device_prep_slave_sg = bam_prep_slave_sg;
  1359		bdev->common.device_config = bam_slave_config;
  1360		bdev->common.device_pause = bam_pause;
  1361		bdev->common.device_resume = bam_resume;
  1362		bdev->common.device_terminate_all = bam_dma_terminate_all;
  1363		bdev->common.device_issue_pending = bam_issue_pending;
  1364		bdev->common.device_tx_status = bam_tx_status;
  1365		bdev->common.dev = bdev->dev;
  1366	
  1367		ret = dma_async_device_register(&bdev->common);
  1368		if (ret) {
  1369			dev_err(bdev->dev, "failed to register dma async device\n");
  1370			goto err_bam_channel_exit;
  1371		}
  1372	
  1373		ret = of_dma_controller_register(pdev->dev.of_node, bam_dma_xlate,
  1374						&bdev->common);
  1375		if (ret)
  1376			goto err_unregister_dma;
  1377	
  1378		if (!bdev->bamclk) {
  1379			pm_runtime_disable(&pdev->dev);
  1380			return 0;
  1381		}
  1382	
  1383		pm_runtime_irq_safe(&pdev->dev);
  1384		pm_runtime_set_autosuspend_delay(&pdev->dev, BAM_DMA_AUTOSUSPEND_DELAY);
  1385		pm_runtime_use_autosuspend(&pdev->dev);
  1386		pm_runtime_mark_last_busy(&pdev->dev);
  1387		pm_runtime_set_active(&pdev->dev);
  1388		pm_runtime_enable(&pdev->dev);
  1389	
  1390		return 0;
  1391	
  1392	err_unregister_dma:
  1393		dma_async_device_unregister(&bdev->common);
  1394	err_bam_channel_exit:
  1395		for (i = 0; i < bdev->num_channels; i++)
  1396			cancel_work_sync(&bdev->channels[i].vc.work);
  1397	err_wq_kill:
  1398		cancel_work_sync(&bdev->work);
  1399	err_disable_clk:
  1400		clk_disable_unprepare(bdev->bamclk);
  1401	
  1402		return ret;
  1403	}
  1404	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



More information about the linux-arm-kernel mailing list