[arm-platforms:irq/generic_handle_domain_irq-core 9/28] drivers/staging/octeon-usb/octeon-hcd.c:3601:9: error: implicit declaration of function 'irq_create_mapping'
kernel test robot
lkp at intel.com
Sun Jun 6 09:29:43 PDT 2021
tree: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/generic_handle_domain_irq-core
head: dcb10b426d70fa739927103bec8ae544180fc073
commit: 86e8aea3d7a70068fad33aa5b7d7e3084240b23a [9/28] MIPS: Do not include linux/irqdomain.h from asm/irq.h
config: mips-cavium_octeon_defconfig (attached as .config)
compiler: mips64-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
# https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?id=86e8aea3d7a70068fad33aa5b7d7e3084240b23a
git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
git fetch --no-tags arm-platforms irq/generic_handle_domain_irq-core
git checkout 86e8aea3d7a70068fad33aa5b7d7e3084240b23a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All errors (new ones prefixed by >>):
drivers/staging/octeon-usb/octeon-hcd.c: In function 'octeon_usb_probe':
>> drivers/staging/octeon-usb/octeon-hcd.c:3601:9: error: implicit declaration of function 'irq_create_mapping' [-Werror=implicit-function-declaration]
3601 | irq = irq_create_mapping(NULL, hwirq);
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/irq_create_mapping +3601 drivers/staging/octeon-usb/octeon-hcd.c
96b06c0a16f737 Chris Packham 2020-02-05 3528
96b06c0a16f737 Chris Packham 2020-02-05 3529 static int octeon_usb_probe(struct platform_device *pdev)
96b06c0a16f737 Chris Packham 2020-02-05 3530 {
96b06c0a16f737 Chris Packham 2020-02-05 3531 int status;
96b06c0a16f737 Chris Packham 2020-02-05 3532 int initialize_flags;
96b06c0a16f737 Chris Packham 2020-02-05 3533 int usb_num;
96b06c0a16f737 Chris Packham 2020-02-05 3534 struct resource *res_mem;
96b06c0a16f737 Chris Packham 2020-02-05 3535 struct device_node *usbn_node;
96b06c0a16f737 Chris Packham 2020-02-05 3536 int irq = platform_get_irq(pdev, 0);
96b06c0a16f737 Chris Packham 2020-02-05 3537 struct device *dev = &pdev->dev;
96b06c0a16f737 Chris Packham 2020-02-05 3538 struct octeon_hcd *usb;
96b06c0a16f737 Chris Packham 2020-02-05 3539 struct usb_hcd *hcd;
96b06c0a16f737 Chris Packham 2020-02-05 3540 u32 clock_rate = 48000000;
96b06c0a16f737 Chris Packham 2020-02-05 3541 bool is_crystal_clock = false;
96b06c0a16f737 Chris Packham 2020-02-05 3542 const char *clock_type;
96b06c0a16f737 Chris Packham 2020-02-05 3543 int i;
96b06c0a16f737 Chris Packham 2020-02-05 3544
96b06c0a16f737 Chris Packham 2020-02-05 3545 if (!dev->of_node) {
96b06c0a16f737 Chris Packham 2020-02-05 3546 dev_err(dev, "Error: empty of_node\n");
96b06c0a16f737 Chris Packham 2020-02-05 3547 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3548 }
96b06c0a16f737 Chris Packham 2020-02-05 3549 usbn_node = dev->of_node->parent;
96b06c0a16f737 Chris Packham 2020-02-05 3550
96b06c0a16f737 Chris Packham 2020-02-05 3551 i = of_property_read_u32(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3552 "clock-frequency", &clock_rate);
96b06c0a16f737 Chris Packham 2020-02-05 3553 if (i)
96b06c0a16f737 Chris Packham 2020-02-05 3554 i = of_property_read_u32(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3555 "refclk-frequency", &clock_rate);
96b06c0a16f737 Chris Packham 2020-02-05 3556 if (i) {
96b06c0a16f737 Chris Packham 2020-02-05 3557 dev_err(dev, "No USBN \"clock-frequency\"\n");
96b06c0a16f737 Chris Packham 2020-02-05 3558 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3559 }
96b06c0a16f737 Chris Packham 2020-02-05 3560 switch (clock_rate) {
96b06c0a16f737 Chris Packham 2020-02-05 3561 case 12000000:
96b06c0a16f737 Chris Packham 2020-02-05 3562 initialize_flags = CVMX_USB_INITIALIZE_FLAGS_CLOCK_12MHZ;
96b06c0a16f737 Chris Packham 2020-02-05 3563 break;
96b06c0a16f737 Chris Packham 2020-02-05 3564 case 24000000:
96b06c0a16f737 Chris Packham 2020-02-05 3565 initialize_flags = CVMX_USB_INITIALIZE_FLAGS_CLOCK_24MHZ;
96b06c0a16f737 Chris Packham 2020-02-05 3566 break;
96b06c0a16f737 Chris Packham 2020-02-05 3567 case 48000000:
96b06c0a16f737 Chris Packham 2020-02-05 3568 initialize_flags = CVMX_USB_INITIALIZE_FLAGS_CLOCK_48MHZ;
96b06c0a16f737 Chris Packham 2020-02-05 3569 break;
96b06c0a16f737 Chris Packham 2020-02-05 3570 default:
96b06c0a16f737 Chris Packham 2020-02-05 3571 dev_err(dev, "Illegal USBN \"clock-frequency\" %u\n",
96b06c0a16f737 Chris Packham 2020-02-05 3572 clock_rate);
96b06c0a16f737 Chris Packham 2020-02-05 3573 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3574 }
96b06c0a16f737 Chris Packham 2020-02-05 3575
96b06c0a16f737 Chris Packham 2020-02-05 3576 i = of_property_read_string(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3577 "cavium,refclk-type", &clock_type);
96b06c0a16f737 Chris Packham 2020-02-05 3578 if (i)
96b06c0a16f737 Chris Packham 2020-02-05 3579 i = of_property_read_string(usbn_node,
96b06c0a16f737 Chris Packham 2020-02-05 3580 "refclk-type", &clock_type);
96b06c0a16f737 Chris Packham 2020-02-05 3581
96b06c0a16f737 Chris Packham 2020-02-05 3582 if (!i && strcmp("crystal", clock_type) == 0)
96b06c0a16f737 Chris Packham 2020-02-05 3583 is_crystal_clock = true;
96b06c0a16f737 Chris Packham 2020-02-05 3584
96b06c0a16f737 Chris Packham 2020-02-05 3585 if (is_crystal_clock)
96b06c0a16f737 Chris Packham 2020-02-05 3586 initialize_flags |= CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_XI;
96b06c0a16f737 Chris Packham 2020-02-05 3587 else
96b06c0a16f737 Chris Packham 2020-02-05 3588 initialize_flags |= CVMX_USB_INITIALIZE_FLAGS_CLOCK_XO_GND;
96b06c0a16f737 Chris Packham 2020-02-05 3589
96b06c0a16f737 Chris Packham 2020-02-05 3590 res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
96b06c0a16f737 Chris Packham 2020-02-05 3591 if (!res_mem) {
96b06c0a16f737 Chris Packham 2020-02-05 3592 dev_err(dev, "found no memory resource\n");
96b06c0a16f737 Chris Packham 2020-02-05 3593 return -ENXIO;
96b06c0a16f737 Chris Packham 2020-02-05 3594 }
96b06c0a16f737 Chris Packham 2020-02-05 3595 usb_num = (res_mem->start >> 44) & 1;
96b06c0a16f737 Chris Packham 2020-02-05 3596
96b06c0a16f737 Chris Packham 2020-02-05 3597 if (irq < 0) {
96b06c0a16f737 Chris Packham 2020-02-05 3598 /* Defective device tree, but we know how to fix it. */
96b06c0a16f737 Chris Packham 2020-02-05 3599 irq_hw_number_t hwirq = usb_num ? (1 << 6) + 17 : 56;
96b06c0a16f737 Chris Packham 2020-02-05 3600
96b06c0a16f737 Chris Packham 2020-02-05 @3601 irq = irq_create_mapping(NULL, hwirq);
96b06c0a16f737 Chris Packham 2020-02-05 3602 }
96b06c0a16f737 Chris Packham 2020-02-05 3603
96b06c0a16f737 Chris Packham 2020-02-05 3604 /*
96b06c0a16f737 Chris Packham 2020-02-05 3605 * Set the DMA mask to 64bits so we get buffers already translated for
96b06c0a16f737 Chris Packham 2020-02-05 3606 * DMA.
96b06c0a16f737 Chris Packham 2020-02-05 3607 */
96b06c0a16f737 Chris Packham 2020-02-05 3608 i = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(64));
96b06c0a16f737 Chris Packham 2020-02-05 3609 if (i)
96b06c0a16f737 Chris Packham 2020-02-05 3610 return i;
96b06c0a16f737 Chris Packham 2020-02-05 3611
96b06c0a16f737 Chris Packham 2020-02-05 3612 /*
96b06c0a16f737 Chris Packham 2020-02-05 3613 * Only cn52XX and cn56XX have DWC_OTG USB hardware and the
96b06c0a16f737 Chris Packham 2020-02-05 3614 * IOB priority registers. Under heavy network load USB
96b06c0a16f737 Chris Packham 2020-02-05 3615 * hardware can be starved by the IOB causing a crash. Give
96b06c0a16f737 Chris Packham 2020-02-05 3616 * it a priority boost if it has been waiting more than 400
96b06c0a16f737 Chris Packham 2020-02-05 3617 * cycles to avoid this situation.
96b06c0a16f737 Chris Packham 2020-02-05 3618 *
96b06c0a16f737 Chris Packham 2020-02-05 3619 * Testing indicates that a cnt_val of 8192 is not sufficient,
96b06c0a16f737 Chris Packham 2020-02-05 3620 * but no failures are seen with 4096. We choose a value of
96b06c0a16f737 Chris Packham 2020-02-05 3621 * 400 to give a safety factor of 10.
96b06c0a16f737 Chris Packham 2020-02-05 3622 */
96b06c0a16f737 Chris Packham 2020-02-05 3623 if (OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN56XX)) {
96b06c0a16f737 Chris Packham 2020-02-05 3624 union cvmx_iob_n2c_l2c_pri_cnt pri_cnt;
96b06c0a16f737 Chris Packham 2020-02-05 3625
96b06c0a16f737 Chris Packham 2020-02-05 3626 pri_cnt.u64 = 0;
96b06c0a16f737 Chris Packham 2020-02-05 3627 pri_cnt.s.cnt_enb = 1;
96b06c0a16f737 Chris Packham 2020-02-05 3628 pri_cnt.s.cnt_val = 400;
96b06c0a16f737 Chris Packham 2020-02-05 3629 cvmx_write_csr(CVMX_IOB_N2C_L2C_PRI_CNT, pri_cnt.u64);
96b06c0a16f737 Chris Packham 2020-02-05 3630 }
96b06c0a16f737 Chris Packham 2020-02-05 3631
96b06c0a16f737 Chris Packham 2020-02-05 3632 hcd = usb_create_hcd(&octeon_hc_driver, dev, dev_name(dev));
96b06c0a16f737 Chris Packham 2020-02-05 3633 if (!hcd) {
96b06c0a16f737 Chris Packham 2020-02-05 3634 dev_dbg(dev, "Failed to allocate memory for HCD\n");
96b06c0a16f737 Chris Packham 2020-02-05 3635 return -1;
96b06c0a16f737 Chris Packham 2020-02-05 3636 }
96b06c0a16f737 Chris Packham 2020-02-05 3637 hcd->uses_new_polling = 1;
96b06c0a16f737 Chris Packham 2020-02-05 3638 usb = (struct octeon_hcd *)hcd->hcd_priv;
96b06c0a16f737 Chris Packham 2020-02-05 3639
96b06c0a16f737 Chris Packham 2020-02-05 3640 spin_lock_init(&usb->lock);
96b06c0a16f737 Chris Packham 2020-02-05 3641
96b06c0a16f737 Chris Packham 2020-02-05 3642 usb->init_flags = initialize_flags;
96b06c0a16f737 Chris Packham 2020-02-05 3643
96b06c0a16f737 Chris Packham 2020-02-05 3644 /* Initialize the USB state structure */
96b06c0a16f737 Chris Packham 2020-02-05 3645 usb->index = usb_num;
96b06c0a16f737 Chris Packham 2020-02-05 3646 INIT_LIST_HEAD(&usb->idle_pipes);
96b06c0a16f737 Chris Packham 2020-02-05 3647 for (i = 0; i < ARRAY_SIZE(usb->active_pipes); i++)
96b06c0a16f737 Chris Packham 2020-02-05 3648 INIT_LIST_HEAD(&usb->active_pipes[i]);
96b06c0a16f737 Chris Packham 2020-02-05 3649
96b06c0a16f737 Chris Packham 2020-02-05 3650 /* Due to an errata, CN31XX doesn't support DMA */
96b06c0a16f737 Chris Packham 2020-02-05 3651 if (OCTEON_IS_MODEL(OCTEON_CN31XX)) {
96b06c0a16f737 Chris Packham 2020-02-05 3652 usb->init_flags |= CVMX_USB_INITIALIZE_FLAGS_NO_DMA;
96b06c0a16f737 Chris Packham 2020-02-05 3653 /* Only use one channel with non DMA */
96b06c0a16f737 Chris Packham 2020-02-05 3654 usb->idle_hardware_channels = 0x1;
96b06c0a16f737 Chris Packham 2020-02-05 3655 } else if (OCTEON_IS_MODEL(OCTEON_CN5XXX)) {
96b06c0a16f737 Chris Packham 2020-02-05 3656 /* CN5XXX have an errata with channel 3 */
96b06c0a16f737 Chris Packham 2020-02-05 3657 usb->idle_hardware_channels = 0xf7;
96b06c0a16f737 Chris Packham 2020-02-05 3658 } else {
96b06c0a16f737 Chris Packham 2020-02-05 3659 usb->idle_hardware_channels = 0xff;
96b06c0a16f737 Chris Packham 2020-02-05 3660 }
96b06c0a16f737 Chris Packham 2020-02-05 3661
96b06c0a16f737 Chris Packham 2020-02-05 3662 status = cvmx_usb_initialize(dev, usb);
96b06c0a16f737 Chris Packham 2020-02-05 3663 if (status) {
96b06c0a16f737 Chris Packham 2020-02-05 3664 dev_dbg(dev, "USB initialization failed with %d\n", status);
96b06c0a16f737 Chris Packham 2020-02-05 3665 usb_put_hcd(hcd);
96b06c0a16f737 Chris Packham 2020-02-05 3666 return -1;
96b06c0a16f737 Chris Packham 2020-02-05 3667 }
96b06c0a16f737 Chris Packham 2020-02-05 3668
96b06c0a16f737 Chris Packham 2020-02-05 3669 status = usb_add_hcd(hcd, irq, 0);
96b06c0a16f737 Chris Packham 2020-02-05 3670 if (status) {
96b06c0a16f737 Chris Packham 2020-02-05 3671 dev_dbg(dev, "USB add HCD failed with %d\n", status);
96b06c0a16f737 Chris Packham 2020-02-05 3672 usb_put_hcd(hcd);
96b06c0a16f737 Chris Packham 2020-02-05 3673 return -1;
96b06c0a16f737 Chris Packham 2020-02-05 3674 }
96b06c0a16f737 Chris Packham 2020-02-05 3675 device_wakeup_enable(hcd->self.controller);
96b06c0a16f737 Chris Packham 2020-02-05 3676
96b06c0a16f737 Chris Packham 2020-02-05 3677 dev_info(dev, "Registered HCD for port %d on irq %d\n", usb_num, irq);
96b06c0a16f737 Chris Packham 2020-02-05 3678
96b06c0a16f737 Chris Packham 2020-02-05 3679 return 0;
96b06c0a16f737 Chris Packham 2020-02-05 3680 }
96b06c0a16f737 Chris Packham 2020-02-05 3681
:::::: The code at line 3601 was first introduced by commit
:::::: 96b06c0a16f737e9ea7dff1e23dd5f6d847e6731 Revert "staging: octeon-usb: delete the octeon usb host controller driver"
:::::: TO: Chris Packham <chris.packham at alliedtelesis.co.nz>
:::::: CC: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 18967 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210607/936e7574/attachment-0001.gz>
More information about the linux-arm-kernel
mailing list