[omap-audio:peter/ti-linux-5.4.y/wip 25/34] drivers/dma/ti/k3-udma-glue.c:662:1: warning: unused label 'err_ringrx_free'
by kernel test robot
tree: https://github.com/omap-audio/linux-audio peter/ti-linux-5.4.y/wip
head: 00f8eae5e721a0a2673c070c612b26aee41e0c07
commit: 499fed33f5b68bb522b77c9121ad86ba25df5e16 [25/34] dmaengine: ti: k3-udma: Switch to k3_ringacc_request_rings_pair
config: arm64-randconfig-r004-20200716 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed6b578040a85977026c93bf4188f996148f3218)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git checkout 499fed33f5b68bb522b77c9121ad86ba25df5e16
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/dma/ti/k3-udma-glue.c:662:1: warning: unused label 'err_ringrx_free' [-Wunused-label]
err_ringrx_free:
^~~~~~~~~~~~~~~~
1 warning generated.
vim +/err_ringrx_free +662 drivers/dma/ti/k3-udma-glue.c
ebc6a5418e45fa Grygorii Strashko 2019-12-09 554
ebc6a5418e45fa Grygorii Strashko 2019-12-09 555 static int k3_udma_glue_cfg_rx_flow(struct k3_udma_glue_rx_channel *rx_chn,
ebc6a5418e45fa Grygorii Strashko 2019-12-09 556 u32 flow_idx,
ebc6a5418e45fa Grygorii Strashko 2019-12-09 557 struct k3_udma_glue_rx_flow_cfg *flow_cfg)
ebc6a5418e45fa Grygorii Strashko 2019-12-09 558 {
ebc6a5418e45fa Grygorii Strashko 2019-12-09 559 struct k3_udma_glue_rx_flow *flow = &rx_chn->flows[flow_idx];
ebc6a5418e45fa Grygorii Strashko 2019-12-09 560 const struct udma_tisci_rm *tisci_rm = rx_chn->common.tisci_rm;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 561 struct device *dev = rx_chn->common.dev;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 562 struct ti_sci_msg_rm_udmap_flow_cfg req;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 563 int rx_ring_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 564 int rx_ringfdq_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 565 int ret = 0;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 566
ebc6a5418e45fa Grygorii Strashko 2019-12-09 567 flow->udma_rflow = xudma_rflow_get(rx_chn->common.udmax,
ebc6a5418e45fa Grygorii Strashko 2019-12-09 568 flow->udma_rflow_id);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 569 if (IS_ERR(flow->udma_rflow)) {
ebc6a5418e45fa Grygorii Strashko 2019-12-09 570 ret = PTR_ERR(flow->udma_rflow);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 571 dev_err(dev, "UDMAX rflow get err %d\n", ret);
a2058b7895a45f Christophe JAILLET 2020-03-18 572 return ret;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 573 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 574
ebc6a5418e45fa Grygorii Strashko 2019-12-09 575 if (flow->udma_rflow_id != xudma_rflow_get_id(flow->udma_rflow)) {
a2058b7895a45f Christophe JAILLET 2020-03-18 576 ret = -ENODEV;
a2058b7895a45f Christophe JAILLET 2020-03-18 577 goto err_rflow_put;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 578 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 579
ebc6a5418e45fa Grygorii Strashko 2019-12-09 580 /* request and cfg rings */
499fed33f5b68b Peter Ujfalusi 2020-07-01 581 ret = k3_ringacc_request_rings_pair(rx_chn->common.ringacc,
499fed33f5b68b Peter Ujfalusi 2020-07-01 582 flow_cfg->ring_rxq_id,
499fed33f5b68b Peter Ujfalusi 2020-07-01 583 flow_cfg->ring_rxfdq0_id,
499fed33f5b68b Peter Ujfalusi 2020-07-01 584 &flow->ringrxfdq,
499fed33f5b68b Peter Ujfalusi 2020-07-01 585 &flow->ringrx);
499fed33f5b68b Peter Ujfalusi 2020-07-01 586 if (ret) {
499fed33f5b68b Peter Ujfalusi 2020-07-01 587 dev_err(dev, "Failed to get RX/RXFDQ rings %d\n", ret);
a2058b7895a45f Christophe JAILLET 2020-03-18 588 goto err_rflow_put;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 589 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 590
ebc6a5418e45fa Grygorii Strashko 2019-12-09 591 ret = k3_ringacc_ring_cfg(flow->ringrx, &flow_cfg->rx_cfg);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 592 if (ret) {
ebc6a5418e45fa Grygorii Strashko 2019-12-09 593 dev_err(dev, "Failed to cfg ringrx %d\n", ret);
a2058b7895a45f Christophe JAILLET 2020-03-18 594 goto err_ringrxfdq_free;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 595 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 596
ebc6a5418e45fa Grygorii Strashko 2019-12-09 597 ret = k3_ringacc_ring_cfg(flow->ringrxfdq, &flow_cfg->rxfdq_cfg);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 598 if (ret) {
ebc6a5418e45fa Grygorii Strashko 2019-12-09 599 dev_err(dev, "Failed to cfg ringrxfdq %d\n", ret);
a2058b7895a45f Christophe JAILLET 2020-03-18 600 goto err_ringrxfdq_free;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 601 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 602
ebc6a5418e45fa Grygorii Strashko 2019-12-09 603 if (rx_chn->remote) {
ebc6a5418e45fa Grygorii Strashko 2019-12-09 604 rx_ring_id = TI_SCI_RESOURCE_NULL;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 605 rx_ringfdq_id = TI_SCI_RESOURCE_NULL;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 606 } else {
ebc6a5418e45fa Grygorii Strashko 2019-12-09 607 rx_ring_id = k3_ringacc_get_ring_id(flow->ringrx);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 608 rx_ringfdq_id = k3_ringacc_get_ring_id(flow->ringrxfdq);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 609 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 610
ebc6a5418e45fa Grygorii Strashko 2019-12-09 611 memset(&req, 0, sizeof(req));
ebc6a5418e45fa Grygorii Strashko 2019-12-09 612
ebc6a5418e45fa Grygorii Strashko 2019-12-09 613 req.valid_params =
ebc6a5418e45fa Grygorii Strashko 2019-12-09 614 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_EINFO_PRESENT_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 615 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PSINFO_PRESENT_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 616 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_ERROR_HANDLING_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 617 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DESC_TYPE_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 618 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_QNUM_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 619 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_SEL_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 620 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_SEL_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 621 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_SEL_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 622 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_SEL_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 623 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ0_SZ0_QNUM_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 624 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ1_QNUM_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 625 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ2_QNUM_VALID |
ebc6a5418e45fa Grygorii Strashko 2019-12-09 626 TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ3_QNUM_VALID;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 627 req.nav_id = tisci_rm->tisci_dev_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 628 req.flow_index = flow->udma_rflow_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 629 if (rx_chn->common.epib)
ebc6a5418e45fa Grygorii Strashko 2019-12-09 630 req.rx_einfo_present = 1;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 631 if (rx_chn->common.psdata_size)
ebc6a5418e45fa Grygorii Strashko 2019-12-09 632 req.rx_psinfo_present = 1;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 633 if (flow_cfg->rx_error_handling)
ebc6a5418e45fa Grygorii Strashko 2019-12-09 634 req.rx_error_handling = 1;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 635 req.rx_desc_type = 0;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 636 req.rx_dest_qnum = rx_ring_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 637 req.rx_src_tag_hi_sel = 0;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 638 req.rx_src_tag_lo_sel = flow_cfg->src_tag_lo_sel;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 639 req.rx_dest_tag_hi_sel = 0;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 640 req.rx_dest_tag_lo_sel = 0;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 641 req.rx_fdq0_sz0_qnum = rx_ringfdq_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 642 req.rx_fdq1_qnum = rx_ringfdq_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 643 req.rx_fdq2_qnum = rx_ringfdq_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 644 req.rx_fdq3_qnum = rx_ringfdq_id;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 645
ebc6a5418e45fa Grygorii Strashko 2019-12-09 646 ret = tisci_rm->tisci_udmap_ops->rx_flow_cfg(tisci_rm->tisci, &req);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 647 if (ret) {
ebc6a5418e45fa Grygorii Strashko 2019-12-09 648 dev_err(dev, "flow%d config failed: %d\n", flow->udma_rflow_id,
ebc6a5418e45fa Grygorii Strashko 2019-12-09 649 ret);
a2058b7895a45f Christophe JAILLET 2020-03-18 650 goto err_ringrxfdq_free;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 651 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 652
ebc6a5418e45fa Grygorii Strashko 2019-12-09 653 rx_chn->flows_ready++;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 654 dev_dbg(dev, "flow%d config done. ready:%d\n",
ebc6a5418e45fa Grygorii Strashko 2019-12-09 655 flow->udma_rflow_id, rx_chn->flows_ready);
ebc6a5418e45fa Grygorii Strashko 2019-12-09 656
ebc6a5418e45fa Grygorii Strashko 2019-12-09 657 return 0;
a2058b7895a45f Christophe JAILLET 2020-03-18 658
a2058b7895a45f Christophe JAILLET 2020-03-18 659 err_ringrxfdq_free:
a2058b7895a45f Christophe JAILLET 2020-03-18 660 k3_ringacc_ring_free(flow->ringrxfdq);
a2058b7895a45f Christophe JAILLET 2020-03-18 661
a2058b7895a45f Christophe JAILLET 2020-03-18 @662 err_ringrx_free:
a2058b7895a45f Christophe JAILLET 2020-03-18 663 k3_ringacc_ring_free(flow->ringrx);
a2058b7895a45f Christophe JAILLET 2020-03-18 664
a2058b7895a45f Christophe JAILLET 2020-03-18 665 err_rflow_put:
a2058b7895a45f Christophe JAILLET 2020-03-18 666 xudma_rflow_put(rx_chn->common.udmax, flow->udma_rflow);
a2058b7895a45f Christophe JAILLET 2020-03-18 667 flow->udma_rflow = NULL;
a2058b7895a45f Christophe JAILLET 2020-03-18 668
ebc6a5418e45fa Grygorii Strashko 2019-12-09 669 return ret;
ebc6a5418e45fa Grygorii Strashko 2019-12-09 670 }
ebc6a5418e45fa Grygorii Strashko 2019-12-09 671
:::::: The code at line 662 was first introduced by commit
:::::: a2058b7895a45fa9668bf77d4235302e803d6fac dmaengine: ti: k3-udma-glue: Fix an error handling path in 'k3_udma_glue_cfg_rx_flow()'
:::::: TO: Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
:::::: CC: Peter Ujfalusi <peter.ujfalusi(a)ti.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[sashal-linux-stable:queue-4.9 41/55] drivers/iio/magnetometer/ak8974.c:511:40: sparse: sparse: incorrect type in argument 2 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.9
head: aa9f1bc6b4d5d72c1f760e733b504a8a1bdd096f
commit: 6d6b3333319ff8bd6bafa09b1b495bc5822d19c8 [41/55] iio:magnetometer:ak8974: Fix alignment and data leak issues
config: x86_64-randconfig-s022-20200717 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout 6d6b3333319ff8bd6bafa09b1b495bc5822d19c8
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/iio/magnetometer/ak8974.c:408:16: sparse: sparse: cast to restricted __le16
drivers/iio/magnetometer/ak8974.c:485:29: sparse: sparse: cast to restricted __le16
>> drivers/iio/magnetometer/ak8974.c:511:40: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected signed short [usertype] *result @@ got restricted __le16 * @@
>> drivers/iio/magnetometer/ak8974.c:511:40: sparse: expected signed short [usertype] *result
>> drivers/iio/magnetometer/ak8974.c:511:40: sparse: got restricted __le16 *
vim +511 drivers/iio/magnetometer/ak8974.c
497
498 static void ak8974_fill_buffer(struct iio_dev *indio_dev)
499 {
500 struct ak8974 *ak8974 = iio_priv(indio_dev);
501 int ret;
502
503 pm_runtime_get_sync(&ak8974->i2c->dev);
504 mutex_lock(&ak8974->lock);
505
506 ret = ak8974_trigmeas(ak8974);
507 if (ret) {
508 dev_err(&ak8974->i2c->dev, "error triggering measure\n");
509 goto out_unlock;
510 }
> 511 ret = ak8974_getresult(ak8974, ak8974->scan.channels);
512 if (ret) {
513 dev_err(&ak8974->i2c->dev, "error getting measures\n");
514 goto out_unlock;
515 }
516
517 iio_push_to_buffers_with_timestamp(indio_dev, &ak8974->scan,
518 iio_get_time_ns(indio_dev));
519
520 out_unlock:
521 mutex_unlock(&ak8974->lock);
522 pm_runtime_mark_last_busy(&ak8974->i2c->dev);
523 pm_runtime_put_autosuspend(&ak8974->i2c->dev);
524 }
525
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[joro:sev-es-client-tip 29/76] arch/x86/kernel/head64.c:514:13: warning: no previous prototype for function 'startup_64_setup_env'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/joro/linux.git sev-es-client-tip
head: 57349dbe54433697c5b96bd5d8b5bd7499754d2b
commit: c12cc81e6b52de5e4c779e29d7ec903eff341cbc [29/76] x86/head/64: Install startup GDT
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed6b578040a85977026c93bf4188f996148f3218)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout c12cc81e6b52de5e4c779e29d7ec903eff341cbc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> arch/x86/kernel/head64.c:514:13: warning: no previous prototype for function 'startup_64_setup_env' [-Wmissing-prototypes]
void __head startup_64_setup_env(unsigned long physbase)
^
arch/x86/kernel/head64.c:514:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __head startup_64_setup_env(unsigned long physbase)
^
static
1 warning generated.
vim +/startup_64_setup_env +514 arch/x86/kernel/head64.c
510
511 /*
512 * Setup boot CPU state needed before kernel switches to virtual addresses.
513 */
> 514 void __head startup_64_setup_env(unsigned long physbase)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH v10 7/9] misc: bcm-vk: add Broadcom VK driver
by kernel test robot
Hi Scott,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20200706]
[also build test ERROR on v5.8-rc5]
[cannot apply to char-misc/char-misc-testing integrity/next-integrity driver-core/driver-core-testing linus/master v5.8-rc4 v5.8-rc3 v5.8-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Scott-Branden/firmware-add-reque...
base: 5680d14d59bddc8bcbc5badf00dbbd4374858497
config: alpha-allyesconfig (attached as .config)
compiler: alpha-linux-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/misc/bcm-vk/bcm_vk_dev.c:138:5: warning: no previous prototype for 'bcm_vk_intf_ver_chk' [-Wmissing-prototypes]
138 | int bcm_vk_intf_ver_chk(struct bcm_vk *vk)
| ^~~~~~~~~~~~~~~~~~~
drivers/misc/bcm-vk/bcm_vk_dev.c: In function 'bcm_vk_probe':
>> drivers/misc/bcm-vk/bcm_vk_dev.c:1161:8: error: implicit declaration of function 'bcm_vk_sysfs_init'; did you mean 'bcm_vk_msg_init'? [-Werror=implicit-function-declaration]
1161 | err = bcm_vk_sysfs_init(pdev, misc_device);
| ^~~~~~~~~~~~~~~~~
| bcm_vk_msg_init
drivers/misc/bcm-vk/bcm_vk_dev.c: In function 'bcm_vk_remove':
>> drivers/misc/bcm-vk/bcm_vk_dev.c:1266:2: error: implicit declaration of function 'bcm_vk_sysfs_exit'; did you mean 'bcm_vk_tty_exit'? [-Werror=implicit-function-declaration]
1266 | bcm_vk_sysfs_exit(pdev, misc_device);
| ^~~~~~~~~~~~~~~~~
| bcm_vk_tty_exit
cc1: some warnings being treated as errors
vim +1161 drivers/misc/bcm-vk/bcm_vk_dev.c
1004
1005 static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1006 {
1007 int err;
1008 int i;
1009 int id;
1010 int irq;
1011 char name[20];
1012 struct bcm_vk *vk;
1013 struct device *dev = &pdev->dev;
1014 struct miscdevice *misc_device;
1015 uint32_t boot_status;
1016
1017 /* allocate vk structure which is tied to kref for freeing */
1018 vk = kzalloc(sizeof(*vk), GFP_KERNEL);
1019 if (!vk)
1020 return -ENOMEM;
1021
1022 kref_init(&vk->kref);
1023 if (nr_ib_sgl_blk > BCM_VK_IB_SGL_BLK_MAX) {
1024 dev_warn(dev, "Inband SGL blk %d limited to max %d\n",
1025 nr_ib_sgl_blk, BCM_VK_IB_SGL_BLK_MAX);
1026 nr_ib_sgl_blk = BCM_VK_IB_SGL_BLK_MAX;
1027 }
1028 vk->ib_sgl_size = nr_ib_sgl_blk * VK_MSGQ_BLK_SIZE;
1029 vk->pdev = pdev;
1030 mutex_init(&vk->mutex);
1031
1032 err = pci_enable_device(pdev);
1033 if (err) {
1034 dev_err(dev, "Cannot enable PCI device\n");
1035 return err;
1036 }
1037
1038 err = pci_request_regions(pdev, DRV_MODULE_NAME);
1039 if (err) {
1040 dev_err(dev, "Cannot obtain PCI resources\n");
1041 goto err_disable_pdev;
1042 }
1043
1044 /* make sure DMA is good */
1045 err = dma_set_mask_and_coherent(&pdev->dev,
1046 DMA_BIT_MASK(BCM_VK_DMA_BITS));
1047 if (err) {
1048 dev_err(dev, "failed to set DMA mask\n");
1049 goto err_disable_pdev;
1050 }
1051
1052 /* The tdma is a scratch area for some DMA testings. */
1053 if (nr_scratch_pages) {
1054 vk->tdma_vaddr = dma_alloc_coherent
1055 (dev,
1056 nr_scratch_pages * PAGE_SIZE,
1057 &vk->tdma_addr, GFP_KERNEL);
1058 if (!vk->tdma_vaddr) {
1059 err = -ENOMEM;
1060 goto err_disable_pdev;
1061 }
1062 }
1063
1064 pci_set_master(pdev);
1065 pci_set_drvdata(pdev, vk);
1066
1067 irq = pci_alloc_irq_vectors(pdev,
1068 1,
1069 VK_MSIX_IRQ_MAX,
1070 PCI_IRQ_MSI | PCI_IRQ_MSIX);
1071
1072 if (irq < VK_MSIX_IRQ_MIN_REQ) {
1073 dev_err(dev, "failed to get min %d MSIX interrupts, irq(%d)\n",
1074 VK_MSIX_IRQ_MIN_REQ, irq);
1075 err = (irq >= 0) ? -EINVAL : irq;
1076 goto err_disable_pdev;
1077 }
1078
1079 dev_info(dev, "Number of IRQs %d allocated - requested(%d).\n",
1080 irq, VK_MSIX_IRQ_MAX);
1081
1082 for (i = 0; i < MAX_BAR; i++) {
1083 /* multiple by 2 for 64 bit BAR mapping */
1084 vk->bar[i] = pci_ioremap_bar(pdev, i * 2);
1085 if (!vk->bar[i]) {
1086 dev_err(dev, "failed to remap BAR%d\n", i);
1087 goto err_iounmap;
1088 }
1089 }
1090
1091 for (vk->num_irqs = 0;
1092 vk->num_irqs < VK_MSIX_MSGQ_MAX;
1093 vk->num_irqs++) {
1094 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs),
1095 bcm_vk_msgq_irqhandler,
1096 IRQF_SHARED, DRV_MODULE_NAME, vk);
1097 if (err) {
1098 dev_err(dev, "failed to request msgq IRQ %d for MSIX %d\n",
1099 pdev->irq + vk->num_irqs, vk->num_irqs + 1);
1100 goto err_irq;
1101 }
1102 }
1103 /* one irq for notification from VK */
1104 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs),
1105 bcm_vk_notf_irqhandler,
1106 IRQF_SHARED, DRV_MODULE_NAME, vk);
1107 if (err) {
1108 dev_err(dev, "failed to request notf IRQ %d for MSIX %d\n",
1109 pdev->irq + vk->num_irqs, vk->num_irqs + 1);
1110 goto err_irq;
1111 }
1112 vk->num_irqs++;
1113
1114 for (i = 0;
1115 (i < VK_MSIX_TTY_MAX) && (vk->num_irqs < irq);
1116 i++, vk->num_irqs++) {
1117 err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs),
1118 bcm_vk_tty_irqhandler,
1119 IRQF_SHARED, DRV_MODULE_NAME, vk);
1120 if (err) {
1121 dev_err(dev, "failed request tty IRQ %d for MSIX %d\n",
1122 pdev->irq + vk->num_irqs, vk->num_irqs + 1);
1123 goto err_irq;
1124 }
1125 vk->tty[i].irq_enabled = true;
1126 }
1127
1128 id = ida_simple_get(&bcm_vk_ida, 0, 0, GFP_KERNEL);
1129 if (id < 0) {
1130 err = id;
1131 dev_err(dev, "unable to get id\n");
1132 goto err_irq;
1133 }
1134
1135 vk->misc_devid = id;
1136 snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id);
1137 misc_device = &vk->miscdev;
1138 misc_device->minor = MISC_DYNAMIC_MINOR;
1139 misc_device->name = kstrdup(name, GFP_KERNEL);
1140 if (!misc_device->name) {
1141 err = -ENOMEM;
1142 goto err_ida_remove;
1143 }
1144 misc_device->fops = &bcm_vk_fops,
1145
1146 err = misc_register(misc_device);
1147 if (err) {
1148 dev_err(dev, "failed to register device\n");
1149 goto err_kfree_name;
1150 }
1151
1152 err = bcm_vk_msg_init(vk);
1153 if (err) {
1154 dev_err(dev, "failed to init msg queue info\n");
1155 goto err_misc_deregister;
1156 }
1157
1158 /* sync other info */
1159 bcm_vk_sync_card_info(vk);
1160
> 1161 err = bcm_vk_sysfs_init(pdev, misc_device);
1162 if (err)
1163 goto err_misc_deregister;
1164
1165 /* register for panic notifier */
1166 vk->panic_nb.notifier_call = bcm_vk_on_panic;
1167 atomic_notifier_chain_register(&panic_notifier_list,
1168 &vk->panic_nb);
1169
1170 snprintf(name, sizeof(name), KBUILD_MODNAME ".%d_ttyVK", id);
1171 err = bcm_vk_tty_init(vk, name);
1172 if (err)
1173 goto err_unregister_panic_notifier;
1174
1175 /*
1176 * lets trigger an auto download. We don't want to do it serially here
1177 * because at probing time, it is not supposed to block for a long time.
1178 */
1179 boot_status = vkread32(vk, BAR_0, BAR_BOOT_STATUS);
1180 if (auto_load) {
1181 if ((boot_status & BOOT_STATE_MASK) == BROM_RUNNING) {
1182 if (bcm_vk_trigger_autoload(vk))
1183 goto err_bcm_vk_tty_exit;
1184 } else {
1185 dev_info(dev,
1186 "Auto-load skipped - BROM not in proper state (0x%x)\n",
1187 boot_status);
1188 }
1189 }
1190
1191 /* enable hb */
1192 bcm_vk_hb_init(vk);
1193
1194 dev_info(dev, "BCM-VK:%u created, 0x%p\n", id, vk);
1195
1196 return 0;
1197
1198 err_bcm_vk_tty_exit:
1199 bcm_vk_tty_exit(vk);
1200
1201 err_unregister_panic_notifier:
1202 atomic_notifier_chain_unregister(&panic_notifier_list,
1203 &vk->panic_nb);
1204
1205 err_misc_deregister:
1206 misc_deregister(misc_device);
1207
1208 err_kfree_name:
1209 kfree(misc_device->name);
1210 misc_device->name = NULL;
1211
1212 err_ida_remove:
1213 ida_simple_remove(&bcm_vk_ida, id);
1214
1215 err_irq:
1216 for (i = 0; i < vk->num_irqs; i++)
1217 devm_free_irq(dev, pci_irq_vector(pdev, i), vk);
1218
1219 pci_disable_msix(pdev);
1220 pci_disable_msi(pdev);
1221
1222 err_iounmap:
1223 for (i = 0; i < MAX_BAR; i++) {
1224 if (vk->bar[i])
1225 pci_iounmap(pdev, vk->bar[i]);
1226 }
1227 pci_release_regions(pdev);
1228
1229 err_disable_pdev:
1230 pci_free_irq_vectors(pdev);
1231 pci_disable_device(pdev);
1232
1233 return err;
1234 }
1235
1236 void bcm_vk_release_data(struct kref *kref)
1237 {
1238 struct bcm_vk *vk = container_of(kref, struct bcm_vk, kref);
1239
1240 /* use raw print, as dev is gone */
1241 pr_info("BCM-VK:%d release data 0x%p\n", vk->misc_devid, vk);
1242 kfree(vk);
1243 }
1244
1245 static void bcm_vk_remove(struct pci_dev *pdev)
1246 {
1247 int i;
1248 struct bcm_vk *vk = pci_get_drvdata(pdev);
1249 struct miscdevice *misc_device = &vk->miscdev;
1250
1251 bcm_vk_hb_deinit(vk);
1252
1253 /*
1254 * Trigger a reset to card and wait enough time for UCODE to rerun,
1255 * which re-initialize the card into its default state.
1256 * This ensures when driver is re-enumerated it will start from
1257 * a completely clean state.
1258 */
1259 bcm_vk_trigger_reset(vk);
1260 usleep_range(BCM_VK_UCODE_BOOT_US, BCM_VK_UCODE_BOOT_MAX_US);
1261
1262 /* unregister panic notifier */
1263 atomic_notifier_chain_unregister(&panic_notifier_list,
1264 &vk->panic_nb);
1265
> 1266 bcm_vk_sysfs_exit(pdev, misc_device);
1267
1268 bcm_vk_msg_remove(vk);
1269 bcm_vk_tty_exit(vk);
1270
1271 if (vk->tdma_vaddr)
1272 dma_free_coherent(&pdev->dev, nr_scratch_pages * PAGE_SIZE,
1273 vk->tdma_vaddr, vk->tdma_addr);
1274
1275 /* remove if name is set which means misc dev registered */
1276 if (misc_device->name) {
1277 misc_deregister(misc_device);
1278 kfree(misc_device->name);
1279 ida_simple_remove(&bcm_vk_ida, vk->misc_devid);
1280 }
1281 for (i = 0; i < vk->num_irqs; i++)
1282 devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), vk);
1283
1284 pci_disable_msix(pdev);
1285 pci_disable_msi(pdev);
1286
1287 cancel_work_sync(&vk->wq_work);
1288 destroy_workqueue(vk->wq_thread);
1289 cancel_work_sync(&vk->tty_wq_work);
1290 destroy_workqueue(vk->tty_wq_thread);
1291
1292 for (i = 0; i < MAX_BAR; i++) {
1293 if (vk->bar[i])
1294 pci_iounmap(pdev, vk->bar[i]);
1295 }
1296
1297 dev_info(&pdev->dev, "BCM-VK:%d released\n", vk->misc_devid);
1298
1299 pci_release_regions(pdev);
1300 pci_free_irq_vectors(pdev);
1301 pci_disable_device(pdev);
1302
1303 kref_put(&vk->kref, bcm_vk_release_data);
1304 }
1305
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [RFC PATCH v4 02/12] security: add ipe lsm evaluation loop and audit system
by kernel test robot
Hi Deven,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on dm/for-next]
[also build test WARNING on pcmoore-selinux/next linus/master v5.8-rc5 next-20200717]
[cannot apply to security/next-testing]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Deven-Bowers/Integrity-Policy-En...
base: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/m68k/include/asm/io_mm.h:25,
from arch/m68k/include/asm/io.h:8,
from include/linux/scatterlist.h:9,
from include/linux/dma-mapping.h:11,
from include/linux/skbuff.h:31,
from include/linux/lsm_audit.h:24,
from security/ipe/ipe-property.h:9,
from security/ipe/ipe-engine.c:7:
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
arch/m68k/include/asm/raw_io.h:83:7: warning: variable '__w' set but not used [-Wunused-but-set-variable]
83 | ({u8 __w, __v = (b); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro 'rom_out_8'
430 | rom_out_8(port, *buf++);
| ^~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
arch/m68k/include/asm/raw_io.h:86:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
86 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro 'rom_out_be16'
448 | rom_out_be16(port, *buf++);
| ^~~~~~~~~~~~
arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
arch/m68k/include/asm/raw_io.h:90:8: warning: variable '__w' set but not used [-Wunused-but-set-variable]
90 | ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
| ^~~
arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 'rom_out_le16'
466 | rom_out_le16(port, *buf++);
| ^~~~~~~~~~~~
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from security/ipe/ipe.h:12,
from security/ipe/ipe-engine.c:6:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/wait.h:9,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from security/ipe/ipe.h:12,
from security/ipe/ipe-engine.c:6:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/asm-generic/bug.h:144:27: note: in definition of macro 'WARN_ON_ONCE'
144 | int __ret_warn_once = !!(condition); \
| ^~~~~~~~~
arch/m68k/include/asm/page_mm.h:170:25: note: in expansion of macro 'virt_addr_valid'
170 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
| ^~~~~~~~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
security/ipe/ipe-engine.c: In function 'get_audit_pathname':
>> security/ipe/ipe-engine.c:39:22: warning: variable 'sb' set but not used [-Wunused-but-set-variable]
39 | struct super_block *sb;
| ^~
vim +/sb +39 security/ipe/ipe-engine.c
21
22 /**
23 * get_audit_pathname: Return the absolute path of the file struct passed in
24 * @file: file to derive an absolute path from.
25 *
26 * This function walks past chroots and mount points.
27 *
28 * Return:
29 * !NULL - OK
30 * ERR_PTR(-ENOENT) - No File
31 * ERR_PTR(-ENOMEM) - No Memory
32 * ERR_PTR(-ENAMETOOLONG) - Path Exceeds PATH_MAX
33 */
34 static char *get_audit_pathname(const struct file *file)
35 {
36 int rc = 0;
37 char *pos = NULL;
38 char *pathbuf = NULL;
> 39 struct super_block *sb;
40 char *temp_path = NULL;
41
42 /* No File to get Path From */
43 if (!file)
44 return ERR_PTR(-ENOENT);
45
46 sb = file->f_path.dentry->d_sb;
47
48 pathbuf = __getname();
49 if (!pathbuf)
50 return ERR_PTR(-ENOMEM);
51
52 pos = d_absolute_path(&file->f_path, pathbuf, PATH_MAX);
53 if (IS_ERR(pos)) {
54 rc = PTR_ERR(pos);
55 goto err;
56 }
57
58 temp_path = __getname();
59 if (!temp_path) {
60 rc = -ENOMEM;
61 goto err;
62 }
63
64 strlcpy(temp_path, pos, PATH_MAX);
65
66 __putname(pathbuf);
67
68 return temp_path;
69
70 err:
71 __putname(pathbuf);
72 return ERR_PTR(rc);
73 }
74
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[lkundrak-linux-mmp:lr/gud2 7/7] drivers/gpu/drm/gud/gud_drm_gadget.c:330:8: error: implicit declaration of function 'drm_client_modeset_check'; did you mean
by kernel test robot
Hi Noralf,
First bad commit (maybe != root cause):
tree: git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git lr/gud2
head: 84d9081acc7185e369834b2b0808d197d7a79d2c
commit: 84d9081acc7185e369834b2b0808d197d7a79d2c [7/7] usb: gadget: function: Add Generic USB Display support
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-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
git checkout 84d9081acc7185e369834b2b0808d197d7a79d2c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_check':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:330:8: error: implicit declaration of function 'drm_client_modeset_check'; did you mean 'drm_client_modeset_set'? [-Werror=implicit-function-declaration]
330 | ret = drm_client_modeset_check(&gdg->client);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| drm_client_modeset_set
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/lockdep.h:43,
from include/linux/spinlock_types.h:18,
from arch/powerpc/include/asm/lppaca.h:45,
from arch/powerpc/include/asm/paca.h:17,
from arch/powerpc/include/asm/current.h:13,
from include/linux/sched.h:12,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/backlight.h:12,
from drivers/gpu/drm/gud/gud_drm_gadget.c:6:
drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_write_buffer':
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'u32' {aka 'unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:338:9: note: in expansion of macro 'KERN_ERR'
338 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
drivers/gpu/drm/gud/gud_drm_gadget.c:424:4: note: in expansion of macro 'pr_err'
424 | pr_err("%s: Buffer compressed len differs: %zu != %zu\n",
| ^~~~~~
drivers/gpu/drm/gud/gud_drm_gadget.c:424:56: note: format string is defined here
424 | pr_err("%s: Buffer compressed len differs: %zu != %zu\n",
| ~~^
| |
| long unsigned int
| %u
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from include/linux/list.h:9,
from include/linux/lockdep.h:43,
from include/linux/spinlock_types.h:18,
from arch/powerpc/include/asm/lppaca.h:45,
from arch/powerpc/include/asm/paca.h:17,
from arch/powerpc/include/asm/current.h:13,
from include/linux/sched.h:12,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/backlight.h:12,
from drivers/gpu/drm/gud/gud_drm_gadget.c:6:
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'u32' {aka 'unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:338:9: note: in expansion of macro 'KERN_ERR'
338 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
drivers/gpu/drm/gud/gud_drm_gadget.c:440:3: note: in expansion of macro 'pr_err'
440 | pr_err("%s: Buffer len differs: %zu != %zu\n",
| ^~~~~~
drivers/gpu/drm/gud/gud_drm_gadget.c:440:44: note: format string is defined here
440 | pr_err("%s: Buffer len differs: %zu != %zu\n",
| ~~^
| |
| long unsigned int
| %u
>> drivers/gpu/drm/gud/gud_drm_gadget.c:457:9: error: implicit declaration of function 'drm_client_framebuffer_flush'; did you mean 'drm_client_framebuffer_delete'? [-Werror=implicit-function-declaration]
457 | return drm_client_framebuffer_flush(buffer, rect);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| drm_client_framebuffer_delete
drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_client_unregister':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:1044:2: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
1044 | vfree(gdg->work_buf);
| ^~~~~
| kvfree
drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_init':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:1123:18: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
1123 | gdg->work_buf = vmalloc(gdg->max_buffer_size);
| ^~~~~~~
| kvmalloc
drivers/gpu/drm/gud/gud_drm_gadget.c:1123:16: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
1123 | gdg->work_buf = vmalloc(gdg->max_buffer_size);
| ^
cc1: some warnings being treated as errors
vim +330 drivers/gpu/drm/gud/gud_drm_gadget.c
9e2361b992206e Noralf Trønnes 2020-05-29 244
9e2361b992206e Noralf Trønnes 2020-05-29 245 static int gud_drm_gadget_check(struct gud_drm_gadget *gdg, struct gud_drm_req_set_state *req,
9e2361b992206e Noralf Trønnes 2020-05-29 246 size_t size)
9e2361b992206e Noralf Trønnes 2020-05-29 247 {
9e2361b992206e Noralf Trønnes 2020-05-29 248 struct drm_client_dev *client = &gdg->client;
9e2361b992206e Noralf Trønnes 2020-05-29 249 u32 format = le32_to_cpu(req->format);
9e2361b992206e Noralf Trønnes 2020-05-29 250 struct drm_client_buffer *buffer;
9e2361b992206e Noralf Trønnes 2020-05-29 251 struct drm_connector *connector;
9e2361b992206e Noralf Trønnes 2020-05-29 252 struct drm_display_mode mode;
9e2361b992206e Noralf Trønnes 2020-05-29 253 unsigned int i;
9e2361b992206e Noralf Trønnes 2020-05-29 254 void *vaddr;
9e2361b992206e Noralf Trønnes 2020-05-29 255 int ret;
9e2361b992206e Noralf Trønnes 2020-05-29 256
9e2361b992206e Noralf Trønnes 2020-05-29 257 if (size < sizeof(struct gud_drm_req_set_state))
9e2361b992206e Noralf Trønnes 2020-05-29 258 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 259
9e2361b992206e Noralf Trønnes 2020-05-29 260 if (size != struct_size(req, properties, req->num_properties))
9e2361b992206e Noralf Trønnes 2020-05-29 261 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 262
9e2361b992206e Noralf Trønnes 2020-05-29 263 memset(&mode, 0, sizeof(mode));
9e2361b992206e Noralf Trønnes 2020-05-29 264 gud_drm_to_display_mode(&mode, &req->mode);
9e2361b992206e Noralf Trønnes 2020-05-29 265
9e2361b992206e Noralf Trønnes 2020-05-29 266 gdg->check_ok = false;
9e2361b992206e Noralf Trønnes 2020-05-29 267
9e2361b992206e Noralf Trønnes 2020-05-29 268 if (!mode.hdisplay || !format)
9e2361b992206e Noralf Trønnes 2020-05-29 269 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 270
9e2361b992206e Noralf Trønnes 2020-05-29 271 if (req->connector >= gdg->connector_count)
9e2361b992206e Noralf Trønnes 2020-05-29 272 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 273
9e2361b992206e Noralf Trønnes 2020-05-29 274 connector = gdg->connectors[req->connector].connector;
9e2361b992206e Noralf Trønnes 2020-05-29 275
9e2361b992206e Noralf Trønnes 2020-05-29 276 if (gdg->buffer_check) {
9e2361b992206e Noralf Trønnes 2020-05-29 277 drm_client_framebuffer_delete(gdg->buffer_check);
9e2361b992206e Noralf Trønnes 2020-05-29 278 gdg->buffer_check = NULL;
9e2361b992206e Noralf Trønnes 2020-05-29 279 }
9e2361b992206e Noralf Trønnes 2020-05-29 280
9e2361b992206e Noralf Trønnes 2020-05-29 281 if (!gud_drm_gadget_check_buffer(gdg, gdg->buffer, &mode, format)) {
9e2361b992206e Noralf Trønnes 2020-05-29 282 buffer = drm_client_framebuffer_create(client, mode.hdisplay, mode.vdisplay,
9e2361b992206e Noralf Trønnes 2020-05-29 283 format);
9e2361b992206e Noralf Trønnes 2020-05-29 284 if (IS_ERR(buffer))
9e2361b992206e Noralf Trønnes 2020-05-29 285 return PTR_ERR(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29 286
9e2361b992206e Noralf Trønnes 2020-05-29 287 vaddr = drm_client_buffer_vmap(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29 288 if (IS_ERR(vaddr)) {
9e2361b992206e Noralf Trønnes 2020-05-29 289 drm_client_framebuffer_delete(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29 290 return PTR_ERR(vaddr);
9e2361b992206e Noralf Trønnes 2020-05-29 291 }
9e2361b992206e Noralf Trønnes 2020-05-29 292
9e2361b992206e Noralf Trønnes 2020-05-29 293 gdg->buffer_check = buffer;
9e2361b992206e Noralf Trønnes 2020-05-29 294 } else {
9e2361b992206e Noralf Trønnes 2020-05-29 295 buffer = gdg->buffer;
9e2361b992206e Noralf Trønnes 2020-05-29 296 }
9e2361b992206e Noralf Trønnes 2020-05-29 297
9e2361b992206e Noralf Trønnes 2020-05-29 298 ret = drm_client_modeset_set(client, connector, &mode, buffer->fb);
9e2361b992206e Noralf Trønnes 2020-05-29 299 if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29 300 return ret;
9e2361b992206e Noralf Trønnes 2020-05-29 301
9e2361b992206e Noralf Trønnes 2020-05-29 302 for (i = 0; i < req->num_properties; i++) {
9e2361b992206e Noralf Trønnes 2020-05-29 303 u16 prop = le16_to_cpu(req->properties[i].prop);
9e2361b992206e Noralf Trønnes 2020-05-29 304 u64 val = le64_to_cpu(req->properties[i].val);
9e2361b992206e Noralf Trønnes 2020-05-29 305
9e2361b992206e Noralf Trønnes 2020-05-29 306 if (gud_drm_gadget_set_connector_property(client, connector, prop, val, &ret)) {
9e2361b992206e Noralf Trønnes 2020-05-29 307 if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29 308 return ret;
9e2361b992206e Noralf Trønnes 2020-05-29 309 continue;
9e2361b992206e Noralf Trønnes 2020-05-29 310 }
9e2361b992206e Noralf Trønnes 2020-05-29 311
9e2361b992206e Noralf Trønnes 2020-05-29 312 switch (prop) {
9e2361b992206e Noralf Trønnes 2020-05-29 313 case GUD_DRM_PROPERTY_BACKLIGHT_BRIGHTNESS:
9e2361b992206e Noralf Trønnes 2020-05-29 314 if (val > 100)
9e2361b992206e Noralf Trønnes 2020-05-29 315 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 316 gdg->brightness = val;
9e2361b992206e Noralf Trønnes 2020-05-29 317 break;
9e2361b992206e Noralf Trønnes 2020-05-29 318 case GUD_DRM_PROPERTY_ROTATION:
9e2361b992206e Noralf Trønnes 2020-05-29 319 ret = drm_client_modeset_set_rotation(client, val);
9e2361b992206e Noralf Trønnes 2020-05-29 320 break;
9e2361b992206e Noralf Trønnes 2020-05-29 321 default:
9e2361b992206e Noralf Trønnes 2020-05-29 322 pr_err("%s: Unknown property: %u\n", __func__, prop);
9e2361b992206e Noralf Trønnes 2020-05-29 323 continue;
9e2361b992206e Noralf Trønnes 2020-05-29 324 }
9e2361b992206e Noralf Trønnes 2020-05-29 325
9e2361b992206e Noralf Trønnes 2020-05-29 326 if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29 327 return ret;
9e2361b992206e Noralf Trønnes 2020-05-29 328 }
9e2361b992206e Noralf Trønnes 2020-05-29 329
9e2361b992206e Noralf Trønnes 2020-05-29 @330 ret = drm_client_modeset_check(&gdg->client);
9e2361b992206e Noralf Trønnes 2020-05-29 331 if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29 332 return ret;
9e2361b992206e Noralf Trønnes 2020-05-29 333
9e2361b992206e Noralf Trønnes 2020-05-29 334 gdg->check_ok = true;
9e2361b992206e Noralf Trønnes 2020-05-29 335
9e2361b992206e Noralf Trønnes 2020-05-29 336 return 0;
9e2361b992206e Noralf Trønnes 2020-05-29 337 }
9e2361b992206e Noralf Trønnes 2020-05-29 338
9e2361b992206e Noralf Trønnes 2020-05-29 339 static int gud_drm_gadget_commit(struct gud_drm_gadget *gdg)
9e2361b992206e Noralf Trønnes 2020-05-29 340 {
9e2361b992206e Noralf Trønnes 2020-05-29 341 int ret;
9e2361b992206e Noralf Trønnes 2020-05-29 342
9e2361b992206e Noralf Trønnes 2020-05-29 343 if (!gdg->check_ok)
9e2361b992206e Noralf Trønnes 2020-05-29 344 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 345
9e2361b992206e Noralf Trønnes 2020-05-29 346 if (gdg->backlight) {
9e2361b992206e Noralf Trønnes 2020-05-29 347 int val, max_brightness = gdg->backlight->props.max_brightness;
9e2361b992206e Noralf Trønnes 2020-05-29 348
9e2361b992206e Noralf Trønnes 2020-05-29 349 val = DIV64_U64_ROUND_UP(gdg->brightness * max_brightness, 100);
9e2361b992206e Noralf Trønnes 2020-05-29 350 ret = backlight_device_set_brightness(gdg->backlight, val);
9e2361b992206e Noralf Trønnes 2020-05-29 351 if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29 352 return ret;
9e2361b992206e Noralf Trønnes 2020-05-29 353 }
9e2361b992206e Noralf Trønnes 2020-05-29 354
9e2361b992206e Noralf Trønnes 2020-05-29 355 ret = drm_client_modeset_commit(&gdg->client);
9e2361b992206e Noralf Trønnes 2020-05-29 356 if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29 357 return ret;
9e2361b992206e Noralf Trønnes 2020-05-29 358
9e2361b992206e Noralf Trønnes 2020-05-29 359 if (gdg->buffer_check) {
9e2361b992206e Noralf Trønnes 2020-05-29 360 drm_client_framebuffer_delete(gdg->buffer);
9e2361b992206e Noralf Trønnes 2020-05-29 361 gdg->buffer = gdg->buffer_check;
9e2361b992206e Noralf Trønnes 2020-05-29 362 gdg->buffer_check = NULL;
9e2361b992206e Noralf Trønnes 2020-05-29 363 }
9e2361b992206e Noralf Trønnes 2020-05-29 364
9e2361b992206e Noralf Trønnes 2020-05-29 365 return 0;
9e2361b992206e Noralf Trønnes 2020-05-29 366 }
9e2361b992206e Noralf Trønnes 2020-05-29 367
9e2361b992206e Noralf Trønnes 2020-05-29 368 static size_t gud_drm_gadget_write_buffer_memcpy(struct drm_client_buffer *buffer,
9e2361b992206e Noralf Trønnes 2020-05-29 369 const void *src, size_t len,
9e2361b992206e Noralf Trønnes 2020-05-29 370 struct drm_rect *rect)
9e2361b992206e Noralf Trønnes 2020-05-29 371 {
9e2361b992206e Noralf Trønnes 2020-05-29 372 unsigned int cpp = buffer->fb->format->cpp[0];
9e2361b992206e Noralf Trønnes 2020-05-29 373 size_t dst_pitch = buffer->fb->pitches[0];
9e2361b992206e Noralf Trønnes 2020-05-29 374 size_t src_pitch = drm_rect_width(rect) * cpp;
9e2361b992206e Noralf Trønnes 2020-05-29 375 unsigned int y;
9e2361b992206e Noralf Trønnes 2020-05-29 376 void *dst;
9e2361b992206e Noralf Trønnes 2020-05-29 377
9e2361b992206e Noralf Trønnes 2020-05-29 378 /* Get the address, it's already mapped */
9e2361b992206e Noralf Trønnes 2020-05-29 379 dst = drm_client_buffer_vmap(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29 380 dst += rect->y1 * dst_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29 381 dst += rect->x1 * cpp;
9e2361b992206e Noralf Trønnes 2020-05-29 382
9e2361b992206e Noralf Trønnes 2020-05-29 383 for (y = 0; y < drm_rect_height(rect) && len; y++) {
9e2361b992206e Noralf Trønnes 2020-05-29 384 src_pitch = min(src_pitch, len);
9e2361b992206e Noralf Trønnes 2020-05-29 385 memcpy(dst, src, src_pitch);
9e2361b992206e Noralf Trønnes 2020-05-29 386 src += src_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29 387 dst += dst_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29 388 len -= src_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29 389 }
9e2361b992206e Noralf Trønnes 2020-05-29 390
9e2361b992206e Noralf Trønnes 2020-05-29 391 return len;
9e2361b992206e Noralf Trønnes 2020-05-29 392 }
9e2361b992206e Noralf Trønnes 2020-05-29 393
9e2361b992206e Noralf Trønnes 2020-05-29 394 static bool gud_drm_gadget_check_rect(struct drm_client_buffer *buffer, struct drm_rect *rect)
9e2361b992206e Noralf Trønnes 2020-05-29 395 {
9e2361b992206e Noralf Trønnes 2020-05-29 396 return buffer->fb && rect->x1 < rect->x2 && rect->y1 < rect->y2 &&
9e2361b992206e Noralf Trønnes 2020-05-29 397 rect->x2 <= buffer->fb->width && rect->y2 <= buffer->fb->height;
9e2361b992206e Noralf Trønnes 2020-05-29 398 }
9e2361b992206e Noralf Trønnes 2020-05-29 399
9e2361b992206e Noralf Trønnes 2020-05-29 400 int gud_drm_gadget_write_buffer(struct gud_drm_gadget *gdg, const void *buf, size_t len)
9e2361b992206e Noralf Trønnes 2020-05-29 401 {
9e2361b992206e Noralf Trønnes 2020-05-29 402 struct drm_client_buffer *buffer = gdg->buffer ? gdg->buffer : gdg->buffer_check;
9e2361b992206e Noralf Trønnes 2020-05-29 403 struct drm_rect *rect = &gdg->set_buffer_rect;
9e2361b992206e Noralf Trønnes 2020-05-29 404 u8 compression = gdg->set_buffer_compression;
9e2361b992206e Noralf Trønnes 2020-05-29 405 struct drm_framebuffer *fb;
9e2361b992206e Noralf Trønnes 2020-05-29 406 size_t remain;
9e2361b992206e Noralf Trønnes 2020-05-29 407 int ret;
9e2361b992206e Noralf Trønnes 2020-05-29 408
9e2361b992206e Noralf Trønnes 2020-05-29 409 pr_debug("%s: len=%zu compression=0x%x\n", __func__, len, compression);
9e2361b992206e Noralf Trønnes 2020-05-29 410
9e2361b992206e Noralf Trønnes 2020-05-29 411 if (WARN_ON_ONCE(!buffer))
9e2361b992206e Noralf Trønnes 2020-05-29 412 return -ENOMEM;
9e2361b992206e Noralf Trønnes 2020-05-29 413
9e2361b992206e Noralf Trønnes 2020-05-29 414 if (!gud_drm_gadget_check_rect(buffer, rect)) {
9e2361b992206e Noralf Trønnes 2020-05-29 415 pr_err("%s: Rectangle doesn't fit: " DRM_RECT_FMT "\n",
9e2361b992206e Noralf Trønnes 2020-05-29 416 __func__, DRM_RECT_ARG(rect));
9e2361b992206e Noralf Trønnes 2020-05-29 417 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 418 }
9e2361b992206e Noralf Trønnes 2020-05-29 419
9e2361b992206e Noralf Trønnes 2020-05-29 420 fb = buffer->fb;
9e2361b992206e Noralf Trønnes 2020-05-29 421
9e2361b992206e Noralf Trønnes 2020-05-29 422 if (compression & GUD_DRM_COMPRESSION_LZ4) {
9e2361b992206e Noralf Trønnes 2020-05-29 423 if (len != gdg->set_buffer_compressed_length) {
9e2361b992206e Noralf Trønnes 2020-05-29 424 pr_err("%s: Buffer compressed len differs: %zu != %zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29 425 __func__, len, gdg->set_buffer_compressed_length);
9e2361b992206e Noralf Trønnes 2020-05-29 426 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 427 }
9e2361b992206e Noralf Trønnes 2020-05-29 428
9e2361b992206e Noralf Trønnes 2020-05-29 429 ret = LZ4_decompress_safe(buf, gdg->work_buf, len, gdg->max_buffer_size);
9e2361b992206e Noralf Trønnes 2020-05-29 430 if (ret < 0) {
9e2361b992206e Noralf Trønnes 2020-05-29 431 pr_err("%s: Failed to decompress buffer\n", __func__);
9e2361b992206e Noralf Trønnes 2020-05-29 432 return -EIO;
9e2361b992206e Noralf Trønnes 2020-05-29 433 }
9e2361b992206e Noralf Trønnes 2020-05-29 434
9e2361b992206e Noralf Trønnes 2020-05-29 435 buf = gdg->work_buf;
9e2361b992206e Noralf Trønnes 2020-05-29 436 len = ret;
9e2361b992206e Noralf Trønnes 2020-05-29 437 }
9e2361b992206e Noralf Trønnes 2020-05-29 438
9e2361b992206e Noralf Trønnes 2020-05-29 439 if (len != gdg->set_buffer_length) {
9e2361b992206e Noralf Trønnes 2020-05-29 440 pr_err("%s: Buffer len differs: %zu != %zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29 441 __func__, len, gdg->set_buffer_length);
9e2361b992206e Noralf Trønnes 2020-05-29 442 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 443 }
9e2361b992206e Noralf Trønnes 2020-05-29 444
9e2361b992206e Noralf Trønnes 2020-05-29 445 if (len > (drm_rect_width(rect) * drm_rect_height(rect) * fb->format->cpp[0])) {
9e2361b992206e Noralf Trønnes 2020-05-29 446 pr_err("%s: Buffer is too big for rectangle: " DRM_RECT_FMT " len=%zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29 447 __func__, DRM_RECT_ARG(rect), len);
9e2361b992206e Noralf Trønnes 2020-05-29 448 return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29 449 }
9e2361b992206e Noralf Trønnes 2020-05-29 450
9e2361b992206e Noralf Trønnes 2020-05-29 451 remain = gud_drm_gadget_write_buffer_memcpy(buffer, buf, len, rect);
9e2361b992206e Noralf Trønnes 2020-05-29 452 if (remain) {
9e2361b992206e Noralf Trønnes 2020-05-29 453 pr_err("%s: Failed to write buffer: remain=%zu\n", __func__, remain);
9e2361b992206e Noralf Trønnes 2020-05-29 454 return -EIO;
9e2361b992206e Noralf Trønnes 2020-05-29 455 }
9e2361b992206e Noralf Trønnes 2020-05-29 456
9e2361b992206e Noralf Trønnes 2020-05-29 @457 return drm_client_framebuffer_flush(buffer, rect);
9e2361b992206e Noralf Trønnes 2020-05-29 458 }
9e2361b992206e Noralf Trønnes 2020-05-29 459 EXPORT_SYMBOL(gud_drm_gadget_write_buffer);
9e2361b992206e Noralf Trønnes 2020-05-29 460
:::::: The code at line 330 was first introduced by commit
:::::: 9e2361b992206e76551d08195854205ba3a2b002 drm/gud: Add functionality for the USB gadget side
:::::: TO: Noralf Trønnes <noralf(a)tronnes.org>
:::::: CC: Lubomir Rintel <lkundrak(a)v3.sk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH v1 15/15] scsi: pmcraid: use generic power management
by kernel test robot
Hi Vaibhav,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on v5.8-rc5]
[cannot apply to scsi/for-next mkp-scsi/for-next next-20200717]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Vaibhav-Gupta/scsi-use-generic-p...
base: 11ba468877bb23f28956a35e896356252d63c983
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed6b578040a85977026c93bf4188f996148f3218)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/scsi/pmcraid.c:5274:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (sizeof(dma_addr_t) == 4 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/pmcraid.c:5278:6: note: uninitialized use occurs here
if (rc == 0)
^~
drivers/scsi/pmcraid.c:5274:2: note: remove the 'if' if its condition is always true
if (sizeof(dma_addr_t) == 4 ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/pmcraid.c:5270:8: note: initialize the variable 'rc' to silence this warning
int rc;
^
= 0
1 warning generated.
vim +5274 drivers/scsi/pmcraid.c
89a36810415077 Anil Ravindranath 2009-08-25 5258
89a36810415077 Anil Ravindranath 2009-08-25 5259 /**
89a36810415077 Anil Ravindranath 2009-08-25 5260 * pmcraid_resume - driver resume entry point PCI power management
7e38e77fcc9088 Vaibhav Gupta 2020-07-17 5261 * @dev: Device structure
89a36810415077 Anil Ravindranath 2009-08-25 5262 *
89a36810415077 Anil Ravindranath 2009-08-25 5263 * Return Value - 0 in case of success. Error code in case of any failure
89a36810415077 Anil Ravindranath 2009-08-25 5264 */
7e38e77fcc9088 Vaibhav Gupta 2020-07-17 5265 static int __maybe_unused pmcraid_resume(struct device *dev)
89a36810415077 Anil Ravindranath 2009-08-25 5266 {
7e38e77fcc9088 Vaibhav Gupta 2020-07-17 5267 struct pci_dev *pdev = to_pci_dev(dev);
89a36810415077 Anil Ravindranath 2009-08-25 5268 struct pmcraid_instance *pinstance = pci_get_drvdata(pdev);
89a36810415077 Anil Ravindranath 2009-08-25 5269 struct Scsi_Host *host = pinstance->host;
89a36810415077 Anil Ravindranath 2009-08-25 5270 int rc;
89a36810415077 Anil Ravindranath 2009-08-25 5271
7e38e77fcc9088 Vaibhav Gupta 2020-07-17 5272 device_wakeup_disable(dev);
89a36810415077 Anil Ravindranath 2009-08-25 5273
371a6c328ad423 Christoph Hellwig 2018-10-18 @5274 if (sizeof(dma_addr_t) == 4 ||
371a6c328ad423 Christoph Hellwig 2018-10-18 5275 dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)))
371a6c328ad423 Christoph Hellwig 2018-10-18 5276 rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
89a36810415077 Anil Ravindranath 2009-08-25 5277
89a36810415077 Anil Ravindranath 2009-08-25 5278 if (rc == 0)
371a6c328ad423 Christoph Hellwig 2018-10-18 5279 rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
89a36810415077 Anil Ravindranath 2009-08-25 5280
89a36810415077 Anil Ravindranath 2009-08-25 5281 if (rc != 0) {
348764024f1cd6 Anil Ravindranath 2009-09-09 5282 dev_err(&pdev->dev, "resume: Failed to set PCI DMA mask\n");
89a36810415077 Anil Ravindranath 2009-08-25 5283 goto disable_device;
89a36810415077 Anil Ravindranath 2009-08-25 5284 }
89a36810415077 Anil Ravindranath 2009-08-25 5285
c20c426732a5a5 Anil Ravindranath 2010-06-08 5286 pmcraid_disable_interrupts(pinstance, ~0);
89a36810415077 Anil Ravindranath 2009-08-25 5287 atomic_set(&pinstance->outstanding_cmds, 0);
89a36810415077 Anil Ravindranath 2009-08-25 5288 rc = pmcraid_register_interrupt_handler(pinstance);
89a36810415077 Anil Ravindranath 2009-08-25 5289
89a36810415077 Anil Ravindranath 2009-08-25 5290 if (rc) {
348764024f1cd6 Anil Ravindranath 2009-09-09 5291 dev_err(&pdev->dev,
348764024f1cd6 Anil Ravindranath 2009-09-09 5292 "resume: couldn't register interrupt handlers\n");
89a36810415077 Anil Ravindranath 2009-08-25 5293 rc = -ENODEV;
89a36810415077 Anil Ravindranath 2009-08-25 5294 goto release_host;
89a36810415077 Anil Ravindranath 2009-08-25 5295 }
89a36810415077 Anil Ravindranath 2009-08-25 5296
89a36810415077 Anil Ravindranath 2009-08-25 5297 pmcraid_init_tasklets(pinstance);
89a36810415077 Anil Ravindranath 2009-08-25 5298 pmcraid_enable_interrupts(pinstance, PMCRAID_PCI_INTERRUPTS);
89a36810415077 Anil Ravindranath 2009-08-25 5299
89a36810415077 Anil Ravindranath 2009-08-25 5300 /* Start with hard reset sequence which brings up IOA to operational
89a36810415077 Anil Ravindranath 2009-08-25 5301 * state as well as completes the reset sequence.
89a36810415077 Anil Ravindranath 2009-08-25 5302 */
89a36810415077 Anil Ravindranath 2009-08-25 5303 pinstance->ioa_hard_reset = 1;
89a36810415077 Anil Ravindranath 2009-08-25 5304
89a36810415077 Anil Ravindranath 2009-08-25 5305 /* Start IOA firmware initialization and bring card to Operational
89a36810415077 Anil Ravindranath 2009-08-25 5306 * state.
89a36810415077 Anil Ravindranath 2009-08-25 5307 */
89a36810415077 Anil Ravindranath 2009-08-25 5308 if (pmcraid_reset_bringup(pinstance)) {
348764024f1cd6 Anil Ravindranath 2009-09-09 5309 dev_err(&pdev->dev, "couldn't initialize IOA\n");
89a36810415077 Anil Ravindranath 2009-08-25 5310 rc = -ENODEV;
89a36810415077 Anil Ravindranath 2009-08-25 5311 goto release_tasklets;
89a36810415077 Anil Ravindranath 2009-08-25 5312 }
89a36810415077 Anil Ravindranath 2009-08-25 5313
89a36810415077 Anil Ravindranath 2009-08-25 5314 return 0;
89a36810415077 Anil Ravindranath 2009-08-25 5315
89a36810415077 Anil Ravindranath 2009-08-25 5316 release_tasklets:
c20c426732a5a5 Anil Ravindranath 2010-06-08 5317 pmcraid_disable_interrupts(pinstance, ~0);
89a36810415077 Anil Ravindranath 2009-08-25 5318 pmcraid_kill_tasklets(pinstance);
89a36810415077 Anil Ravindranath 2009-08-25 5319 pmcraid_unregister_interrupt_handler(pinstance);
89a36810415077 Anil Ravindranath 2009-08-25 5320
89a36810415077 Anil Ravindranath 2009-08-25 5321 release_host:
89a36810415077 Anil Ravindranath 2009-08-25 5322 scsi_host_put(host);
89a36810415077 Anil Ravindranath 2009-08-25 5323
89a36810415077 Anil Ravindranath 2009-08-25 5324 disable_device:
89a36810415077 Anil Ravindranath 2009-08-25 5325
89a36810415077 Anil Ravindranath 2009-08-25 5326 return rc;
89a36810415077 Anil Ravindranath 2009-08-25 5327 }
89a36810415077 Anil Ravindranath 2009-08-25 5328
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH v3] x86/ioperm: Fix io bitmap invalidation on Xen PV
by kernel test robot
Hi Andy,
I love your patch! Perhaps something to improve:
[auto build test WARNING on tip/auto-latest]
[also build test WARNING on xen-tip/linux-next v5.8-rc5 next-20200717]
[cannot apply to tip/x86/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Andy-Lutomirski/x86-ioperm-Fix-i...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8b68f1cda59dc238dc67989c8ac3fa95873f89ed
config: x86_64-randconfig-s021-20200717 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> arch/x86/xen/enlighten_pv.c:876:27: sparse: sparse: Using plain integer as NULL pointer
vim +876 arch/x86/xen/enlighten_pv.c
871
872 #ifdef CONFIG_X86_IOPL_IOPERM
873 static void xen_invalidate_io_bitmap(void)
874 {
875 struct physdev_set_iobitmap iobitmap = {
> 876 .bitmap = 0,
877 .nr_ports = 0,
878 };
879
880 native_tss_invalidate_io_bitmap();
881 HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobitmap);
882 }
883
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[hch-misc:sockopt-cleanups 17/22] net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces)
by kernel test robot
tree: git://git.infradead.org/users/hch/misc.git sockopt-cleanups
head: c7b33f366ac60f1213a4ff71675dc62c56f171d3
commit: 5a4c63f8320f6acd2dd457dd96c84e1ffeef580a [17/22] net/ipv4: remove compat_ip_{get,set}sockopt
config: openrisc-randconfig-s031-20200717 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout 5a4c63f8320f6acd2dd457dd96c84e1ffeef580a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=openrisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
net/ipv4/ip_sockglue.c:908:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user * @@
net/ipv4/ip_sockglue.c:908:29: sparse: expected int const *__gu_addr
net/ipv4/ip_sockglue.c:908:29: sparse: got int [noderef] __user *
net/ipv4/ip_sockglue.c:913:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned char const *__gu_addr @@ got unsigned char [noderef] __user * @@
net/ipv4/ip_sockglue.c:913:29: sparse: expected unsigned char const *__gu_addr
net/ipv4/ip_sockglue.c:913:29: sparse: got unsigned char [noderef] __user *
net/ipv4/ip_sockglue.c:1456:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1456:13: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1456:13: sparse: got int [noderef] __user *optlen
net/ipv4/ip_sockglue.c:1488:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1488:13: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1488:13: sparse: got int [noderef] __user *optlen
>> net/ipv4/ip_sockglue.c:1489:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
>> net/ipv4/ip_sockglue.c:1489:13: sparse: expected unsigned int *__pu_addr
net/ipv4/ip_sockglue.c:1489:13: sparse: got unsigned int [noderef] __user *
net/ipv4/ip_sockglue.c:1490:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int *__pu_addr @@ got unsigned int [noderef] __user * @@
net/ipv4/ip_sockglue.c:1490:13: sparse: expected unsigned int *__pu_addr
net/ipv4/ip_sockglue.c:1490:13: sparse: got unsigned int [noderef] __user *
net/ipv4/ip_sockglue.c:1509:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const *__gu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1509:13: sparse: expected int const *__gu_addr
net/ipv4/ip_sockglue.c:1509:13: sparse: got int [noderef] __user *optlen
net/ipv4/ip_sockglue.c:1535:32: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1535:32: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1535:32: sparse: got int [noderef] __user *optlen
net/ipv4/ip_sockglue.c:1540:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1540:21: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1540:21: sparse: got int [noderef] __user *optlen
net/ipv4/ip_sockglue.c:1630:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1630:21: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1630:21: sparse: got int [noderef] __user *optlen
net/ipv4/ip_sockglue.c:1693:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1693:24: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1693:24: sparse: got int [noderef] __user *optlen
net/ipv4/ip_sockglue.c:1713:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1713:21: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1713:21: sparse: got int [noderef] __user *optlen
net/ipv4/ip_sockglue.c:1719:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int *__pu_addr @@ got int [noderef] __user *optlen @@
net/ipv4/ip_sockglue.c:1719:21: sparse: expected int *__pu_addr
net/ipv4/ip_sockglue.c:1719:21: sparse: got int [noderef] __user *optlen
arch/openrisc/include/asm/cmpxchg.h:101:29: sparse: sparse: shift too big (32) for type int
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
include/linux/uaccess.h:131:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *to @@ got void [noderef] __user *to @@
include/linux/uaccess.h:131:38: sparse: expected void *to
include/linux/uaccess.h:131:38: sparse: got void [noderef] __user *to
include/linux/uaccess.h:131:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got void const *from @@
include/linux/uaccess.h:131:42: sparse: expected void const [noderef] __user *from
include/linux/uaccess.h:131:42: sparse: got void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void const [noderef] __user *from @@
arch/openrisc/include/asm/uaccess.h:246:55: sparse: expected void const *from
arch/openrisc/include/asm/uaccess.h:246:55: sparse: got void const [noderef] __user *from
vim +1489 net/ipv4/ip_sockglue.c
4aa551d47237465 Christoph Hellwig 2020-07-15 1461
4aa551d47237465 Christoph Hellwig 2020-07-15 1462 static int compat_ip_get_mcast_msfilter(struct sock *sk, void __user *optval,
5a4c63f8320f6ac Christoph Hellwig 2020-07-16 1463 int __user *optlen, int len)
4aa551d47237465 Christoph Hellwig 2020-07-15 1464 {
4aa551d47237465 Christoph Hellwig 2020-07-15 1465 const int size0 = offsetof(struct compat_group_filter, gf_slist);
4aa551d47237465 Christoph Hellwig 2020-07-15 1466 struct compat_group_filter __user *p = optval;
4aa551d47237465 Christoph Hellwig 2020-07-15 1467 struct compat_group_filter gf32;
4aa551d47237465 Christoph Hellwig 2020-07-15 1468 struct group_filter gf;
4aa551d47237465 Christoph Hellwig 2020-07-15 1469 int num;
5a4c63f8320f6ac Christoph Hellwig 2020-07-16 1470 int err;
4aa551d47237465 Christoph Hellwig 2020-07-15 1471
4aa551d47237465 Christoph Hellwig 2020-07-15 1472 if (len < size0)
4aa551d47237465 Christoph Hellwig 2020-07-15 1473 return -EINVAL;
4aa551d47237465 Christoph Hellwig 2020-07-15 1474 if (copy_from_user(&gf32, p, size0))
4aa551d47237465 Christoph Hellwig 2020-07-15 1475 return -EFAULT;
4aa551d47237465 Christoph Hellwig 2020-07-15 1476
4aa551d47237465 Christoph Hellwig 2020-07-15 1477 gf.gf_interface = gf32.gf_interface;
4aa551d47237465 Christoph Hellwig 2020-07-15 1478 gf.gf_fmode = gf32.gf_fmode;
4aa551d47237465 Christoph Hellwig 2020-07-15 1479 num = gf.gf_numsrc = gf32.gf_numsrc;
4aa551d47237465 Christoph Hellwig 2020-07-15 1480 gf.gf_group = gf32.gf_group;
4aa551d47237465 Christoph Hellwig 2020-07-15 1481
4aa551d47237465 Christoph Hellwig 2020-07-15 1482 err = ip_mc_gsfget(sk, &gf, p->gf_slist);
4aa551d47237465 Christoph Hellwig 2020-07-15 1483 if (err)
4aa551d47237465 Christoph Hellwig 2020-07-15 1484 return err;
4aa551d47237465 Christoph Hellwig 2020-07-15 1485 if (gf.gf_numsrc < num)
4aa551d47237465 Christoph Hellwig 2020-07-15 1486 num = gf.gf_numsrc;
4aa551d47237465 Christoph Hellwig 2020-07-15 1487 len = GROUP_FILTER_SIZE(num) - (sizeof(gf) - sizeof(gf32));
4aa551d47237465 Christoph Hellwig 2020-07-15 1488 if (put_user(len, optlen) ||
4aa551d47237465 Christoph Hellwig 2020-07-15 @1489 put_user(gf.gf_fmode, &p->gf_fmode) ||
4aa551d47237465 Christoph Hellwig 2020-07-15 1490 put_user(gf.gf_numsrc, &p->gf_numsrc))
4aa551d47237465 Christoph Hellwig 2020-07-15 1491 return -EFAULT;
4aa551d47237465 Christoph Hellwig 2020-07-15 1492 return 0;
4aa551d47237465 Christoph Hellwig 2020-07-15 1493 }
4aa551d47237465 Christoph Hellwig 2020-07-15 1494
:::::: The code at line 1489 was first introduced by commit
:::::: 4aa551d4723746507de5fb607831811a9e458837 net/ipv4: factor out MCAST_MSFILTER getsockopt helpers
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Christoph Hellwig <hch(a)lst.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months