Re: [PATCH linux-next] arm: dma fix returnvar.cocci warnings
by kernel test robot
Hi jing,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20210819]
url: https://github.com/0day-ci/linux/commits/jing-yangyang/arm-dma-fix-return...
base: 33e65b1f975cd2814fc0ea9617250fc4c1d7a553
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-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/0day-ci/linux/commit/a5037ed7d3a617c82c996788afb1a7031...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review jing-yangyang/arm-dma-fix-returnvar-cocci-warnings/20210820-101604
git checkout a5037ed7d3a617c82c996788afb1a703170eb192
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash
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 >>):
In file included from arch/arm/mach-omap2/dma.c:30:
arch/arm/mach-omap2/dma.c: In function 'configure_dma_errata':
>> include/linux/omap-dma.h:105:42: error: 'errata' undeclared (first use in this function)
105 | #define SET_DMA_ERRATA(id) (errata |= (id))
| ^~~~~~
arch/arm/mach-omap2/dma.c:112:17: note: in expansion of macro 'SET_DMA_ERRATA'
112 | SET_DMA_ERRATA(DMA_ERRATA_IFRAME_BUFFERING);
| ^~~~~~~~~~~~~~
include/linux/omap-dma.h:105:42: note: each undeclared identifier is reported only once for each function it appears in
105 | #define SET_DMA_ERRATA(id) (errata |= (id))
| ^~~~~~
arch/arm/mach-omap2/dma.c:112:17: note: in expansion of macro 'SET_DMA_ERRATA'
112 | SET_DMA_ERRATA(DMA_ERRATA_IFRAME_BUFFERING);
| ^~~~~~~~~~~~~~
vim +/errata +105 include/linux/omap-dma.h
45c3eb7d3a07eb Tony Lindgren 2012-11-30 102
45c3eb7d3a07eb Tony Lindgren 2012-11-30 103 /* Errata handling */
45c3eb7d3a07eb Tony Lindgren 2012-11-30 104 #define IS_DMA_ERRATA(id) (errata & (id))
45c3eb7d3a07eb Tony Lindgren 2012-11-30 @105 #define SET_DMA_ERRATA(id) (errata |= (id))
45c3eb7d3a07eb Tony Lindgren 2012-11-30 106
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[agd5f:amd-staging-drm-next 541/556] drivers/spi/spi-amd.c:405:36: warning: unused variable 'spi_acpi_match'
by kernel test robot
tree: https://gitlab.freedesktop.org/agd5f/linux.git amd-staging-drm-next
head: c631af5a62e497a3d1d8ace5add26ae43040c48b
commit: 76e192c35ad70a1242a65971345a5056650f35e9 [541/556] Add support for AMD SPI controller-1
config: hexagon-randconfig-r041-20210822 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a83d99c55ebb14532c414066a5aa3bdb65389965)
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 remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f amd-staging-drm-next
git checkout 76e192c35ad70a1242a65971345a5056650f35e9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=hexagon
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/spi/spi-amd.c:405:36: warning: unused variable 'spi_acpi_match' [-Wunused-const-variable]
static const struct acpi_device_id spi_acpi_match[] = {
^
1 warning generated.
vim +/spi_acpi_match +405 drivers/spi/spi-amd.c
bbb336f39efcb1 Sanjay R Mehta 2020-04-25 404
bbb336f39efcb1 Sanjay R Mehta 2020-04-25 @405 static const struct acpi_device_id spi_acpi_match[] = {
bbb336f39efcb1 Sanjay R Mehta 2020-04-25 406 { "AMDI0061", 0 },
76e192c35ad70a kunliu13 2021-08-20 407 { "AMDI0062", 0 },
bbb336f39efcb1 Sanjay R Mehta 2020-04-25 408 {},
bbb336f39efcb1 Sanjay R Mehta 2020-04-25 409 };
bbb336f39efcb1 Sanjay R Mehta 2020-04-25 410 MODULE_DEVICE_TABLE(acpi, spi_acpi_match);
76e192c35ad70a kunliu13 2021-08-20 411
:::::: The code at line 405 was first introduced by commit
:::::: bbb336f39efcb1b5498f65f59f9af5773ad6dc2b spi: spi-amd: Add AMD SPI controller driver support
:::::: TO: Sanjay R Mehta <sanju.mehta(a)amd.com>
:::::: CC: Mark Brown <broonie(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [for-rc] RDMA/qedr: qedr crash while running rdma-tool.
by kernel test robot
Hi Alok,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on rdma/for-next]
[also build test WARNING on v5.14-rc6 next-20210820]
[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/Alok-Prasad/RDMA-qedr-qedr-crash...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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/0day-ci/linux/commit/f9b6462f18a87caead9b362d4cdd04950...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alok-Prasad/RDMA-qedr-qedr-crash-while-running-rdma-tool/20210821-154459
git checkout f9b6462f18a87caead9b362d4cdd049504ac3c62
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.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 warnings (new ones prefixed by >>):
drivers/infiniband/hw/qedr/verbs.c: In function 'qedr_query_qp':
>> drivers/infiniband/hw/qedr/verbs.c:2754:35: warning: implicit conversion from 'enum qed_roce_qp_state' to 'enum ib_qp_state' [-Wenum-conversion]
2754 | qp_attr->qp_state = QED_ROCE_QP_STATE_RTS;
| ^
vim +2754 drivers/infiniband/hw/qedr/verbs.c
2735
2736 int qedr_query_qp(struct ib_qp *ibqp,
2737 struct ib_qp_attr *qp_attr,
2738 int attr_mask, struct ib_qp_init_attr *qp_init_attr)
2739 {
2740 struct qed_rdma_query_qp_out_params params;
2741 struct qedr_qp *qp = get_qedr_qp(ibqp);
2742 struct qedr_dev *dev = qp->dev;
2743 int rc = 0;
2744
2745 memset(¶ms, 0, sizeof(params));
2746 memset(qp_attr, 0, sizeof(*qp_attr));
2747 memset(qp_init_attr, 0, sizeof(*qp_init_attr));
2748
2749 if (qp->qed_qp)
2750 rc = dev->ops->rdma_query_qp(dev->rdma_ctx,
2751 qp->qed_qp, ¶ms);
2752
2753 if (qp->qp_type == IB_QPT_GSI)
> 2754 qp_attr->qp_state = QED_ROCE_QP_STATE_RTS;
2755 else
2756 qp_attr->qp_state = qedr_get_ibqp_state(params.state);
2757
2758 qp_attr->cur_qp_state = qedr_get_ibqp_state(params.state);
2759 qp_attr->path_mtu = ib_mtu_int_to_enum(params.mtu);
2760 qp_attr->path_mig_state = IB_MIG_MIGRATED;
2761 qp_attr->rq_psn = params.rq_psn;
2762 qp_attr->sq_psn = params.sq_psn;
2763 qp_attr->dest_qp_num = params.dest_qp;
2764
2765 qp_attr->qp_access_flags = qedr_to_ib_qp_acc_flags(¶ms);
2766
2767 qp_attr->cap.max_send_wr = qp->sq.max_wr;
2768 qp_attr->cap.max_recv_wr = qp->rq.max_wr;
2769 qp_attr->cap.max_send_sge = qp->sq.max_sges;
2770 qp_attr->cap.max_recv_sge = qp->rq.max_sges;
2771 qp_attr->cap.max_inline_data = dev->attr.max_inline;
2772 qp_init_attr->cap = qp_attr->cap;
2773
2774 qp_attr->ah_attr.type = RDMA_AH_ATTR_TYPE_ROCE;
2775 rdma_ah_set_grh(&qp_attr->ah_attr, NULL,
2776 params.flow_label, qp->sgid_idx,
2777 params.hop_limit_ttl, params.traffic_class_tos);
2778 rdma_ah_set_dgid_raw(&qp_attr->ah_attr, ¶ms.dgid.bytes[0]);
2779 rdma_ah_set_port_num(&qp_attr->ah_attr, 1);
2780 rdma_ah_set_sl(&qp_attr->ah_attr, 0);
2781 qp_attr->timeout = params.timeout;
2782 qp_attr->rnr_retry = params.rnr_retry;
2783 qp_attr->retry_cnt = params.retry_cnt;
2784 qp_attr->min_rnr_timer = params.min_rnr_nak_timer;
2785 qp_attr->pkey_index = params.pkey_index;
2786 qp_attr->port_num = 1;
2787 rdma_ah_set_path_bits(&qp_attr->ah_attr, 0);
2788 rdma_ah_set_static_rate(&qp_attr->ah_attr, 0);
2789 qp_attr->alt_pkey_index = 0;
2790 qp_attr->alt_port_num = 0;
2791 qp_attr->alt_timeout = 0;
2792 memset(&qp_attr->alt_ah_attr, 0, sizeof(qp_attr->alt_ah_attr));
2793
2794 qp_attr->sq_draining = (params.state == QED_ROCE_QP_STATE_SQD) ? 1 : 0;
2795 qp_attr->max_dest_rd_atomic = params.max_dest_rd_atomic;
2796 qp_attr->max_rd_atomic = params.max_rd_atomic;
2797 qp_attr->en_sqd_async_notify = (params.sqd_async) ? 1 : 0;
2798
2799 DP_DEBUG(dev, QEDR_MSG_QP, "QEDR_QUERY_QP: max_inline_data=%d\n",
2800 qp_attr->cap.max_inline_data);
2801 return rc;
2802 }
2803
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [PATCH 15/27] drm/i915/guc: Implement multi-lrc submission
by kernel test robot
Hi Matthew,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip drm-exynos/exynos-drm-next next-20210820]
[cannot apply to tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.14-rc6]
[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/Matthew-Brost/Parallel-submissio...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-a011-20210821 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/55917f6ee7575ffb033e6b19a9eb38c32...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Brost/Parallel-submission-aka-multi-bb-execbuf/20210821-065348
git checkout 55917f6ee7575ffb033e6b19a9eb38c3210e14db
# save the attached .config to linux build tree
make W=1 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/gpu/drm/i915/gt/uc/intel_guc_submission.c:1467:6: warning: no previous prototype for 'need_tasklet' [-Wmissing-prototypes]
1467 | bool need_tasklet(struct intel_guc *guc, struct i915_request *rq)
| ^~~~~~~~~~~~
vim +/need_tasklet +1467 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
1466
> 1467 bool need_tasklet(struct intel_guc *guc, struct i915_request *rq)
1468 {
1469 struct i915_sched_engine *sched_engine = rq->engine->sched_engine;
1470 struct intel_context *ce = request_to_scheduling_context(rq);
1471
1472 return submission_disabled(guc) || guc->stalled_request ||
1473 !i915_sched_engine_is_empty(sched_engine) ||
1474 !lrc_desc_registered(guc, ce->guc_id.id);
1475 }
1476
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
drivers/uio/uio_aec.c:50:49: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef
commit: 8f28ca6bd8211214faf717677bbffe375c2a6072 iomap: constify ioreadX() iomem argument (as in generic implementation)
date: 1 year ago
config: alpha-randconfig-s031-20210813 (attached as .config)
compiler: alpha-linux-gcc (GCC) 10.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.3-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8f28ca6bd8211214faf717677bbffe375c2a6072
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha
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/uio/uio_aec.c:44:49: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void [noderef] __iomem *int_flag @@ got void * @@
drivers/uio/uio_aec.c:44:49: sparse: expected void [noderef] __iomem *int_flag
drivers/uio/uio_aec.c:44:49: sparse: got void *
>> drivers/uio/uio_aec.c:50:49: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:50:49: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:50:49: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:59:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:59:9: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:59:9: sparse: got void *
drivers/uio/uio_aec.c:88:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *priv @@ got void [noderef] __iomem * @@
drivers/uio/uio_aec.c:88:20: sparse: expected void *priv
drivers/uio/uio_aec.c:88:20: sparse: got void [noderef] __iomem *
drivers/uio/uio_aec.c:104:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:104:42: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:104:42: sparse: got void *
drivers/uio/uio_aec.c:105:43: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:105:43: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:105:43: sparse: got void *
drivers/uio/uio_aec.c:106:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:106:34: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:106:34: sparse: got void *
drivers/uio/uio_aec.c:115:31: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem * @@ got void *priv @@
drivers/uio/uio_aec.c:115:31: sparse: expected void [noderef] __iomem *
drivers/uio/uio_aec.c:115:31: sparse: got void *priv
drivers/uio/uio_aec.c:130:42: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:130:42: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:130:42: sparse: got void *
drivers/uio/uio_aec.c:131:43: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:131:43: sparse: expected void [noderef] __iomem *addr
drivers/uio/uio_aec.c:131:43: sparse: got void *
drivers/uio/uio_aec.c:133:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __iomem *addr @@ got void * @@
drivers/uio/uio_aec.c:133:28: sparse: expected void const [noderef] __iomem *addr
drivers/uio/uio_aec.c:133:28: sparse: got void *
drivers/uio/uio_aec.c:138:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *priv @@
drivers/uio/uio_aec.c:138:21: sparse: expected void volatile [noderef] __iomem *addr
drivers/uio/uio_aec.c:138:21: sparse: got void *priv
vim +50 drivers/uio/uio_aec.c
1bafeb378e915f Brandon Philips 2009-01-27 41
1bafeb378e915f Brandon Philips 2009-01-27 42 static irqreturn_t aectc_irq(int irq, struct uio_info *dev_info)
1bafeb378e915f Brandon Philips 2009-01-27 43 {
1bafeb378e915f Brandon Philips 2009-01-27 44 void __iomem *int_flag = dev_info->priv + INTA_DRVR_ADDR;
1bafeb378e915f Brandon Philips 2009-01-27 45 unsigned char status = ioread8(int_flag);
1bafeb378e915f Brandon Philips 2009-01-27 46
1bafeb378e915f Brandon Philips 2009-01-27 47
1bafeb378e915f Brandon Philips 2009-01-27 48 if ((status & INTA_ENABLED_FLAG) && (status & INTA_FLAG)) {
1bafeb378e915f Brandon Philips 2009-01-27 49 /* application writes 0x00 to 0x2F to get next interrupt */
1bafeb378e915f Brandon Philips 2009-01-27 @50 status = ioread8(dev_info->priv + MAILBOX);
1bafeb378e915f Brandon Philips 2009-01-27 51 return IRQ_HANDLED;
1bafeb378e915f Brandon Philips 2009-01-27 52 }
1bafeb378e915f Brandon Philips 2009-01-27 53
1bafeb378e915f Brandon Philips 2009-01-27 54 return IRQ_NONE;
1bafeb378e915f Brandon Philips 2009-01-27 55 }
1bafeb378e915f Brandon Philips 2009-01-27 56
:::::: The code at line 50 was first introduced by commit
:::::: 1bafeb378e915f39b1bf44ee0871823d6f402ea5 uio: add the uio_aec driver
:::::: TO: Brandon Philips <brandon(a)ifup.org>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[mcgrof:20210816-add-disk-error-handling 28/64] drivers/block/swim.c:780:33: error: 'swd' undeclared
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git 20210816-add-disk-error-handling
head: e1e79332ea1bba0e751529b114ef9d301bf962a5
commit: 2d5d6d569c2bf06dc7b75a3557ec315435f3d78e [28/64] block/swim: add a helper to remove disks
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?...
git remote add mcgrof https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git
git fetch --no-tags mcgrof 20210816-add-disk-error-handling
git checkout 2d5d6d569c2bf06dc7b75a3557ec315435f3d78e
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/block/
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/block/swim.c: In function 'swim_del_disks':
>> drivers/block/swim.c:780:33: error: 'swd' undeclared (first use in this function)
780 | for (drive = 0; drive < swd->floppy_count; drive++) {
| ^~~
drivers/block/swim.c:780:33: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/block/swim.c:783:29: error: 'fw' undeclared (first use in this function); did you mean 'fs'?
783 | if (fw->registered)
| ^~
| fs
>> drivers/block/swim.c:787:21: error: used struct type value where scalar is required
787 | if (fs->tag_set)
| ^~
drivers/block/swim.c: In function 'swim_floppy_init':
drivers/block/swim.c:851:33: warning: statement with no effect [-Wunused-value]
851 | swd->unit[drive].registered true;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~
>> drivers/block/swim.c:851:44: error: expected ';' before 'true'
851 | swd->unit[drive].registered true;
| ^ ~~~~
| ;
vim +/swd +780 drivers/block/swim.c
774
775 static void swim_del_disks(void)
776 {
777 int drive;
778 struct floppy_state *fs;
779
> 780 for (drive = 0; drive < swd->floppy_count; drive++) {
781 fs = swd->unit[drive];
782 if (fs->disk) {
> 783 if (fw->registered)
784 del_gendisk(fs->disk);
785 blk_cleanup_disk(fs->disk);
786 }
> 787 if (fs->tag_set)
788 blk_mq_free_tag_set(&fs->tag_set);
789 }
790
791 unregister_blkdev(FLOPPY_MAJOR, "fd");
792 }
793
794 static int swim_floppy_init(struct swim_priv *swd)
795 {
796 int err;
797 int drive;
798 struct swim __iomem *base = swd->base;
799
800 /* scan floppy drives */
801
802 swim_drive(base, INTERNAL_DRIVE);
803 if (swim_readbit(base, DRIVE_PRESENT) &&
804 !swim_readbit(base, ONEMEG_DRIVE))
805 swim_add_floppy(swd, INTERNAL_DRIVE);
806 swim_drive(base, EXTERNAL_DRIVE);
807 if (swim_readbit(base, DRIVE_PRESENT) &&
808 !swim_readbit(base, ONEMEG_DRIVE))
809 swim_add_floppy(swd, EXTERNAL_DRIVE);
810
811 /* register floppy drives */
812
813 err = register_blkdev(FLOPPY_MAJOR, "fd");
814 if (err) {
815 printk(KERN_ERR "Unable to get major %d for SWIM floppy\n",
816 FLOPPY_MAJOR);
817 return -EBUSY;
818 }
819
820 spin_lock_init(&swd->lock);
821
822 for (drive = 0; drive < swd->floppy_count; drive++) {
823 err = blk_mq_alloc_sq_tag_set(&swd->unit[drive].tag_set,
824 &swim_mq_ops, 2, BLK_MQ_F_SHOULD_MERGE);
825 if (err)
826 goto exit_put_disks;
827
828 swd->unit[drive].disk =
829 blk_mq_alloc_disk(&swd->unit[drive].tag_set,
830 &swd->unit[drive]);
831 if (IS_ERR(swd->unit[drive].disk)) {
832 blk_mq_free_tag_set(&swd->unit[drive].tag_set);
833 err = PTR_ERR(swd->unit[drive].disk);
834 goto exit_put_disks;
835 }
836
837 swd->unit[drive].swd = swd;
838 }
839
840 for (drive = 0; drive < swd->floppy_count; drive++) {
841 swd->unit[drive].disk->flags = GENHD_FL_REMOVABLE;
842 swd->unit[drive].disk->major = FLOPPY_MAJOR;
843 swd->unit[drive].disk->first_minor = drive;
844 swd->unit[drive].disk->minors = 1;
845 sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive);
846 swd->unit[drive].disk->fops = &floppy_fops;
847 swd->unit[drive].disk->events = DISK_EVENT_MEDIA_CHANGE;
848 swd->unit[drive].disk->private_data = &swd->unit[drive];
849 set_capacity(swd->unit[drive].disk, 2880);
850 add_disk(swd->unit[drive].disk);
> 851 swd->unit[drive].registered true;
852 }
853
854 return 0;
855
856 exit_put_disks:
857 unregister_blkdev(FLOPPY_MAJOR, "fd");
858 do {
859 struct gendisk *disk = swd->unit[drive].disk;
860
861 if (!disk)
862 continue;
863 blk_cleanup_disk(disk);
864 blk_mq_free_tag_set(&swd->unit[drive].tag_set);
865 } while (drive--);
866 return err;
867 }
868
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [PATCH linux-next] tools: fix warning comparing pointer to 0
by kernel test robot
Hi CGEL,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20210819]
url: https://github.com/0day-ci/linux/commits/CGEL/tools-fix-warning-comparing...
base: 33e65b1f975cd2814fc0ea9617250fc4c1d7a553
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://github.com/0day-ci/linux/commit/b8c00506ae6f75c8d0dcc46b55962bb93...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review CGEL/tools-fix-warning-comparing-pointer-to-0/20210820-113325
git checkout b8c00506ae6f75c8d0dcc46b55962bb93b6bbeb5
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash -C tools/testing/selftests/bpf install
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 >>):
In file included from progs/profiler1.c:6:
>> progs/profiler.inc.h:364:7: error: use of undeclared identifier 'kill_dat'; did you mean 'kill_data'?
if (!kill_dat)
^~~~~~~~
kill_data
progs/profiler.inc.h:362:26: note: 'kill_data' declared here
struct var_kill_data_t* kill_data = bpf_map_lookup_elem(&data_heap, &zero);
^
>> progs/profiler.inc.h:544:7: error: use of undeclared identifier 'allowed_fil'; did you mean 'allowed_file'?
if (!allowed_fil)
^~~~~~~~~~~
allowed_file
progs/profiler.inc.h:542:8: note: 'allowed_file' declared here
bool* allowed_file = bpf_map_lookup_elem(&allowed_file_inodes, &ino);
^
2 errors generated.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[wireless-drivers-next:master 19/40] drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:892:6: warning: variable 'place' is used uninitialized whenever 'if' condition is false
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-ne... master
head: 0dc62413c882d765db7a3ff4d507e8c0a804ba68
commit: 369956ae5720ba1b415b37ba23cea5ede2942398 [19/40] rtlwifi: rtl8192de: Remove redundant variable initializations
config: i386-randconfig-a015-20210822 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9e9d70591e72fc6762b4b9a226b68ed1307419bf)
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/kvalo/wireless-drivers-ne...
git remote add wireless-drivers-next https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-ne...
git fetch --no-tags wireless-drivers-next master
git checkout 369956ae5720ba1b415b37ba23cea5ede2942398
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386
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/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:892:6: warning: variable 'place' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (chnl > 14) {
^~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:900:9: note: uninitialized use occurs here
return place;
^~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:892:2: note: remove the 'if' if its condition is always true
if (chnl > 14) {
^~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:890:10: note: initialize the variable 'place' to silence this warning
u8 place;
^
= '\0'
1 warning generated.
vim +892 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 887
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 888 static u8 _rtl92c_phy_get_rightchnlplace(u8 chnl)
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 889 {
369956ae5720ba drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c Colin Ian King 2021-08-03 890 u8 place;
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 891
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 @892 if (chnl > 14) {
bb6fa826ba308e drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c Larry Finger 2016-02-11 893 for (place = 14; place < sizeof(channel5g); place++) {
bb6fa826ba308e drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c Larry Finger 2016-02-11 894 if (channel5g[place] == chnl) {
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 895 place++;
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 896 break;
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 897 }
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 898 }
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 899 }
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 900 return place;
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 901 }
7274a8c229805d drivers/net/wireless/rtlwifi/rtl8192de/phy.c Chaoming Li 2011-06-10 902
:::::: The code at line 892 was first introduced by commit
:::::: 7274a8c229805d5ab1228a2d7d8ed304fcfa2bc6 rtlwifi: rtl8192de: Merge phy routines
:::::: TO: Chaoming Li <chaoming_li(a)realsil.com.cn>
:::::: CC: John W. Linville <linville(a)tuxdriver.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [RFC PATCH net-next 04/20] net: switchdev: move SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE to the blocking notifier chain
by kernel test robot
Hi Vladimir,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Vladimir-Oltean/DSA-FDB-isolatio...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git ab44035d308227723b490487ff0feba521e87029
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/c3f584a3a5fcbaf747a1c754720afa897...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vladimir-Oltean/DSA-FDB-isolation/20210818-200630
git checkout c3f584a3a5fcbaf747a1c754720afa897885c9a7
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
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/net/ethernet/rocker/rocker_main.c: In function 'rocker_switchdev_fdb_event':
>> drivers/net/ethernet/rocker/rocker_main.c:2804:38: error: 'fdb_info' redeclared as different kind of symbol
2804 | struct switchdev_notifier_fdb_info *fdb_info = ptr;
| ^~~~~~~~
drivers/net/ethernet/rocker/rocker_main.c:2801:43: note: previous definition of 'fdb_info' was here
2801 | struct switchdev_notifier_fdb_info *fdb_info)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
>> drivers/net/ethernet/rocker/rocker_main.c:2804:49: error: 'ptr' undeclared (first use in this function)
2804 | struct switchdev_notifier_fdb_info *fdb_info = ptr;
| ^~~
drivers/net/ethernet/rocker/rocker_main.c:2804:49: note: each undeclared identifier is reported only once for each function it appears in
vim +/fdb_info +2804 drivers/net/ethernet/rocker/rocker_main.c
2798
2799 static int
2800 rocker_switchdev_fdb_event(unsigned long event, struct net_device *dev,
2801 struct switchdev_notifier_fdb_info *fdb_info)
2802 {
2803 struct rocker_switchdev_event_work *switchdev_work;
> 2804 struct switchdev_notifier_fdb_info *fdb_info = ptr;
2805 struct rocker_port *rocker_port;
2806
2807 rocker_port = netdev_priv(dev);
2808 switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
2809 if (WARN_ON(!switchdev_work))
2810 return NOTIFY_BAD;
2811
2812 INIT_WORK(&switchdev_work->work, rocker_switchdev_event_work);
2813 switchdev_work->rocker_port = rocker_port;
2814 switchdev_work->event = event;
2815
2816 memcpy(&switchdev_work->fdb_info, ptr,
2817 sizeof(switchdev_work->fdb_info));
2818 switchdev_work->fdb_info.addr = kzalloc(ETH_ALEN, GFP_ATOMIC);
2819 if (unlikely(!switchdev_work->fdb_info.addr)) {
2820 kfree(switchdev_work);
2821 return NOTIFY_BAD;
2822 }
2823
2824 ether_addr_copy((u8 *)switchdev_work->fdb_info.addr,
2825 fdb_info->addr);
2826 /* Take a reference on the rocker device */
2827 dev_hold(dev);
2828
2829 queue_work(rocker_port->rocker->rocker_owq,
2830 &switchdev_work->work);
2831
2832 return NOTIFY_DONE;
2833 }
2834
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[sashal-linux-stable:pending-4.4 25/25] drivers/net/phy/mdio-mux.c:172:5: error: label 'err_loop' used but not defined
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-4.4
head: 6c69917afdae1284331f6ff2508ee96417c16aed
commit: 6c69917afdae1284331f6ff2508ee96417c16aed [25/25] net: mdio-mux: Handle -EPROBE_DEFER correctly
config: alpha-buildonly-randconfig-r002-20210822 (attached as .config)
compiler: alpha-linux-gcc (GCC) 7.5.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/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable pending-4.4
git checkout 6c69917afdae1284331f6ff2508ee96417c16aed
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/gpu/drm/ drivers/net/phy/
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 >>):
In file included from include/linux/list.h:8:0,
from include/linux/agp_backend.h:33,
from include/drm/drmP.h:35,
from drivers/gpu/drm/drm_fops.c:37:
drivers/gpu/drm/drm_fops.c: In function 'drm_open_helper':
>> drivers/gpu/drm/drm_fops.c:272:35: error: 'pci_root_buses' undeclared (first use in this function); did you mean 'pci_is_root_bus'?
struct pci_bus *b = list_entry(pci_root_buses.next,
^
include/linux/kernel.h:815:49: note: in definition of macro 'container_of'
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
^~~
drivers/gpu/drm/drm_fops.c:272:24: note: in expansion of macro 'list_entry'
struct pci_bus *b = list_entry(pci_root_buses.next,
^~~~~~~~~~
drivers/gpu/drm/drm_fops.c:272:35: note: each undeclared identifier is reported only once for each function it appears in
struct pci_bus *b = list_entry(pci_root_buses.next,
^
include/linux/kernel.h:815:49: note: in definition of macro 'container_of'
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
^~~
drivers/gpu/drm/drm_fops.c:272:24: note: in expansion of macro 'list_entry'
struct pci_bus *b = list_entry(pci_root_buses.next,
^~~~~~~~~~
drivers/gpu/drm/drm_fops.c: In function 'drm_read':
drivers/gpu/drm/drm_fops.c:544:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (e->event->length + ret > count)
^
In file included from arch/alpha/include/asm/io.h:218:0,
from include/linux/scatterlist.h:8,
from include/linux/dma-mapping.h:10,
from include/drm/drmP.h:37,
from drivers/gpu/drm/drm_fops.c:37:
drivers/gpu/drm/drm_fops.c: At top level:
arch/alpha/include/asm/jensen.h:166:3: warning: 'jensen_bus_outb' is static but used in inline function 'jensen_outb' which is not static
jensen_bus_outb(b, addr);
^~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:164:3: warning: 'jensen_local_outb' is static but used in inline function 'jensen_outb' which is not static
jensen_local_outb(b, addr);
^~~~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:158:10: warning: 'jensen_bus_inb' is static but used in inline function 'jensen_inb' which is not static
return jensen_bus_inb(addr);
^~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:156:10: warning: 'jensen_local_inb' is static but used in inline function 'jensen_inb' which is not static
return jensen_local_inb(addr);
^~~~~~~~~~~~~~~~
--
In file included from include/linux/if_ether.h:23:0,
from include/uapi/linux/ethtool.h:17,
from include/linux/ethtool.h:16,
from include/linux/phy.h:20,
from include/linux/of_mdio.h:12,
from drivers/net/phy/mdio-mux.c:11:
include/linux/skbuff.h: In function 'skb_add_data':
include/linux/skbuff.h:2687:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
&csum, from) == copy) {
^~
include/linux/skbuff.h:2691:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
} else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
^~
include/linux/skbuff.h: In function 'skb_can_coalesce':
include/linux/skbuff.h:2705:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
off == frag->page_offset + skb_frag_size(frag);
^~
include/linux/skbuff.h: In function 'memcpy_from_msg':
include/linux/skbuff.h:2933:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return copy_from_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
^~
include/linux/skbuff.h: In function 'memcpy_to_msg':
include/linux/skbuff.h:2938:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return copy_to_iter(data, len, &msg->msg_iter) == len ? 0 : -EFAULT;
^~
drivers/net/phy/mdio-mux.c: In function 'mdio_mux_init':
>> drivers/net/phy/mdio-mux.c:172:5: error: label 'err_loop' used but not defined
goto err_loop;
^~~~
In file included from arch/alpha/include/asm/io.h:218:0,
from include/linux/scatterlist.h:8,
from include/linux/dma-mapping.h:10,
from include/linux/skbuff.h:34,
from include/linux/if_ether.h:23,
from include/uapi/linux/ethtool.h:17,
from include/linux/ethtool.h:16,
from include/linux/phy.h:20,
from include/linux/of_mdio.h:12,
from drivers/net/phy/mdio-mux.c:11:
drivers/net/phy/mdio-mux.c: At top level:
arch/alpha/include/asm/jensen.h:166:3: warning: 'jensen_bus_outb' is static but used in inline function 'jensen_outb' which is not static
jensen_bus_outb(b, addr);
^~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:164:3: warning: 'jensen_local_outb' is static but used in inline function 'jensen_outb' which is not static
jensen_local_outb(b, addr);
^~~~~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:158:10: warning: 'jensen_bus_inb' is static but used in inline function 'jensen_inb' which is not static
return jensen_bus_inb(addr);
^~~~~~~~~~~~~~
arch/alpha/include/asm/jensen.h:156:10: warning: 'jensen_local_inb' is static but used in inline function 'jensen_inb' which is not static
return jensen_local_inb(addr);
^~~~~~~~~~~~~~~~
vim +/err_loop +172 drivers/net/phy/mdio-mux.c
95
96 int mdio_mux_init(struct device *dev,
97 int (*switch_fn)(int cur, int desired, void *data),
98 void **mux_handle,
99 void *data)
100 {
101 struct device_node *parent_bus_node;
102 struct device_node *child_bus_node;
103 int r, ret_val;
104 struct mii_bus *parent_bus;
105 struct mdio_mux_parent_bus *pb;
106 struct mdio_mux_child_bus *cb;
107
108 if (!dev->of_node)
109 return -ENODEV;
110
111 parent_bus_node = of_parse_phandle(dev->of_node, "mdio-parent-bus", 0);
112
113 if (!parent_bus_node)
114 return -ENODEV;
115
116 pb = devm_kzalloc(dev, sizeof(*pb), GFP_KERNEL);
117 if (pb == NULL) {
118 ret_val = -ENOMEM;
119 goto err_parent_bus;
120 }
121
122 parent_bus = of_mdio_find_bus(parent_bus_node);
123 if (parent_bus == NULL) {
124 ret_val = -EPROBE_DEFER;
125 goto err_parent_bus;
126 }
127
128 pb->switch_data = data;
129 pb->switch_fn = switch_fn;
130 pb->current_child = -1;
131 pb->parent_id = parent_count++;
132 pb->mii_bus = parent_bus;
133
134 ret_val = -ENODEV;
135 for_each_available_child_of_node(dev->of_node, child_bus_node) {
136 u32 v;
137
138 r = of_property_read_u32(child_bus_node, "reg", &v);
139 if (r)
140 continue;
141
142 cb = devm_kzalloc(dev, sizeof(*cb), GFP_KERNEL);
143 if (cb == NULL) {
144 dev_err(dev,
145 "Error: Failed to allocate memory for child\n");
146 ret_val = -ENOMEM;
147 of_node_put(child_bus_node);
148 break;
149 }
150 cb->bus_number = v;
151 cb->parent = pb;
152
153 cb->mii_bus = mdiobus_alloc();
154 if (!cb->mii_bus) {
155 ret_val = -ENOMEM;
156 of_node_put(child_bus_node);
157 break;
158 }
159 cb->mii_bus->priv = cb;
160 cb->mii_bus->irq = cb->phy_irq;
161 cb->mii_bus->name = "mdio_mux";
162 snprintf(cb->mii_bus->id, MII_BUS_ID_SIZE, "%x.%x",
163 pb->parent_id, v);
164 cb->mii_bus->parent = dev;
165 cb->mii_bus->read = mdio_mux_read;
166 cb->mii_bus->write = mdio_mux_write;
167 r = of_mdiobus_register(cb->mii_bus, child_bus_node);
168 if (r) {
169 mdiobus_free(cb->mii_bus);
170 if (r == -EPROBE_DEFER) {
171 ret_val = r;
> 172 goto err_loop;
173 }
174 devm_kfree(dev, cb);
175 dev_err(dev,
176 "Error: Failed to register MDIO bus for child %pOF\n",
177 child_bus_node);
178 } else {
179 of_node_get(child_bus_node);
180 cb->next = pb->children;
181 pb->children = cb;
182 }
183 }
184 if (pb->children) {
185 *mux_handle = pb;
186 dev_info(dev, "Version " DRV_VERSION "\n");
187 return 0;
188 }
189
190 /* balance the reference of_mdio_find_bus() took */
191 put_device(&pb->mii_bus->dev);
192
193 err_parent_bus:
194 of_node_put(parent_bus_node);
195 return ret_val;
196 }
197 EXPORT_SYMBOL_GPL(mdio_mux_init);
198
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year