Hi Kishon, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on usb/usb-testing] [also build test WARNING on v5.14-rc7 next-20210824] [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/Kishon-Vijay-Abraham-I/Fix-cold-plugged-USB-device-on-certain-PCIe-USB-cards/20210824-185502 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing config: powerpc-akebono_defconfig (attached as .config) compiler: powerpc-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/fe4b8457078ee059441628dfa331b8e3e145e335 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Kishon-Vijay-Abraham-I/Fix-cold-plugged-USB-device-on-certain-PCIe-USB-cards/20210824-185502 git checkout fe4b8457078ee059441628dfa331b8e3e145e335 # 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=powerpc SHELL=/bin/bash drivers/usb/core/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/usb/core/hcd.c:2799: warning: expecting prototype for usb_add_hcd(). Prototype was for __usb_add_hcd() instead vim +2799 drivers/usb/core/hcd.c c8195df4a79699 Kishon Vijay Abraham I 2021-08-24 2785 ^1da177e4c3f41 Linus Torvalds 2005-04-16 2786 /** ^1da177e4c3f41 Linus Torvalds 2005-04-16 2787 * usb_add_hcd - finish generic HCD structure initialization and register ^1da177e4c3f41 Linus Torvalds 2005-04-16 2788 * @hcd: the usb_hcd structure to initialize ^1da177e4c3f41 Linus Torvalds 2005-04-16 2789 * @irqnum: Interrupt line to allocate ^1da177e4c3f41 Linus Torvalds 2005-04-16 2790 * @irqflags: Interrupt type flags fe4b8457078ee0 Kishon Vijay Abraham I 2021-08-24 2791 * @register_hub: Flag to indicate if roothub has to be registered. ^1da177e4c3f41 Linus Torvalds 2005-04-16 2792 * ^1da177e4c3f41 Linus Torvalds 2005-04-16 2793 * Finish the remaining parts of generic HCD initialization: allocate the ^1da177e4c3f41 Linus Torvalds 2005-04-16 2794 * buffers of consistent memory, register the bus, request the IRQ line, ^1da177e4c3f41 Linus Torvalds 2005-04-16 2795 * and call the driver's reset() and start() routines. ^1da177e4c3f41 Linus Torvalds 2005-04-16 2796 */ fe4b8457078ee0 Kishon Vijay Abraham I 2021-08-24 2797 int __usb_add_hcd(struct usb_hcd *hcd, unsigned int irqnum, unsigned long irqflags, fe4b8457078ee0 Kishon Vijay Abraham I 2021-08-24 2798 bool register_hub) ^1da177e4c3f41 Linus Torvalds 2005-04-16 @2799 { ^1da177e4c3f41 Linus Torvalds 2005-04-16 2800 int retval; 8ec8d20b21f00a Alan Stern 2005-04-25 2801 struct usb_device *rhdev; ^1da177e4c3f41 Linus Torvalds 2005-04-16 2802 29bca25e1bc474 Chunfeng Yun 2018-03-22 2803 if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { 63cb03f5c11eef Martin Blumenstingl 2018-04-18 2804 hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev); bc40f53417410b Johan Hovold 2018-04-18 2805 if (IS_ERR(hcd->phy_roothub)) bc40f53417410b Johan Hovold 2018-04-18 2806 return PTR_ERR(hcd->phy_roothub); 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2807 63cb03f5c11eef Martin Blumenstingl 2018-04-18 2808 retval = usb_phy_roothub_init(hcd->phy_roothub); 63cb03f5c11eef Martin Blumenstingl 2018-04-18 2809 if (retval) 890fa45d01eb89 Greg Kroah-Hartman 2018-04-30 2810 return retval; 63cb03f5c11eef Martin Blumenstingl 2018-04-18 2811 b97a31348379f7 Miquel Raynal 2019-01-29 2812 retval = usb_phy_roothub_set_mode(hcd->phy_roothub, b97a31348379f7 Miquel Raynal 2019-01-29 2813 PHY_MODE_USB_HOST_SS); e671765e521c57 Chen-Yu Tsai 2019-03-22 2814 if (retval) e671765e521c57 Chen-Yu Tsai 2019-03-22 2815 retval = usb_phy_roothub_set_mode(hcd->phy_roothub, e671765e521c57 Chen-Yu Tsai 2019-03-22 2816 PHY_MODE_USB_HOST); b97a31348379f7 Miquel Raynal 2019-01-29 2817 if (retval) b97a31348379f7 Miquel Raynal 2019-01-29 2818 goto err_usb_phy_roothub_power_on; b97a31348379f7 Miquel Raynal 2019-01-29 2819 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2820 retval = usb_phy_roothub_power_on(hcd->phy_roothub); 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2821 if (retval) 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2822 goto err_usb_phy_roothub_power_on; 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2823 } 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2824 ^1da177e4c3f41 Linus Torvalds 2005-04-16 2825 dev_info(hcd->self.controller, "%s\n", hcd->product_desc); ^1da177e4c3f41 Linus Torvalds 2005-04-16 2826 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2827 switch (authorized_default) { 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2828 case USB_AUTHORIZE_NONE: 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2829 hcd->dev_policy = USB_DEVICE_AUTHORIZE_NONE; 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2830 break; 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2831 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2832 case USB_AUTHORIZE_ALL: 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2833 hcd->dev_policy = USB_DEVICE_AUTHORIZE_ALL; 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2834 break; 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2835 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2836 case USB_AUTHORIZE_INTERNAL: 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2837 hcd->dev_policy = USB_DEVICE_AUTHORIZE_INTERNAL; 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2838 break; 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2839 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2840 case USB_AUTHORIZE_WIRED: 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2841 default: 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2842 hcd->dev_policy = hcd->wireless ? 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2843 USB_DEVICE_AUTHORIZE_NONE : USB_DEVICE_AUTHORIZE_ALL; 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2844 break; ff8e2c560eca32 Stefan Koch 2015-08-25 2845 } 7bae0432a64aa7 Dmitry Torokhov 2019-02-16 2846 8de98402652c01 Benjamin Herrenschmidt 2005-11-25 2847 set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 8de98402652c01 Benjamin Herrenschmidt 2005-11-25 2848 6b2bd3c8c69c48 Stefan Koch 2015-08-25 2849 /* per default all interfaces are authorized */ 6b2bd3c8c69c48 Stefan Koch 2015-08-25 2850 set_bit(HCD_FLAG_INTF_AUTHORIZED, &hcd->flags); 6b2bd3c8c69c48 Stefan Koch 2015-08-25 2851 b1e8f0a6a8805c David Brownell 2006-01-23 2852 /* HC is in reset state, but accessible. Now do the one-time init, 37ebb54915dc42 Petr Mladek 2014-09-19 2853 * bottom up so that hcds can customize the root hubs before hub_wq b1e8f0a6a8805c David Brownell 2006-01-23 2854 * starts talking to them. (Note, bus id is assigned early too.) b1e8f0a6a8805c David Brownell 2006-01-23 2855 */ 0faaad461547e2 Kris Borer 2015-07-14 2856 retval = hcd_buffer_create(hcd); 0faaad461547e2 Kris Borer 2015-07-14 2857 if (retval != 0) { a8c06e407ef969 Arnd Bergmann 2017-03-13 2858 dev_dbg(hcd->self.sysdev, "pool alloc failed\n"); 00433254952221 Sergei Shtylyov 2014-09-24 2859 goto err_create_buf; ^1da177e4c3f41 Linus Torvalds 2005-04-16 2860 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 2861 0faaad461547e2 Kris Borer 2015-07-14 2862 retval = usb_register_bus(&hcd->self); 0faaad461547e2 Kris Borer 2015-07-14 2863 if (retval < 0) 8ec8d20b21f00a Alan Stern 2005-04-25 2864 goto err_register_bus; ^1da177e4c3f41 Linus Torvalds 2005-04-16 2865 c688d6211f57e1 Greg Kroah-Hartman 2015-04-30 2866 rhdev = usb_alloc_dev(NULL, &hcd->self, 0); c688d6211f57e1 Greg Kroah-Hartman 2015-04-30 2867 if (rhdev == NULL) { a8c06e407ef969 Arnd Bergmann 2017-03-13 2868 dev_err(hcd->self.sysdev, "unable to allocate root hub\n"); b1e8f0a6a8805c David Brownell 2006-01-23 2869 retval = -ENOMEM; b1e8f0a6a8805c David Brownell 2006-01-23 2870 goto err_allocate_root_hub; b1e8f0a6a8805c David Brownell 2006-01-23 2871 } d8521afe35862f Dan Williams 2014-05-20 2872 mutex_lock(&usb_port_peer_mutex); 6d88e679257449 Alan Stern 2010-06-09 2873 hcd->self.root_hub = rhdev; d8521afe35862f Dan Williams 2014-05-20 2874 mutex_unlock(&usb_port_peer_mutex); 6b403b020c1f42 Sarah Sharp 2009-04-27 2875 a2d49572e11ef5 Mathias Nyman 2018-04-19 2876 rhdev->rx_lanes = 1; a2d49572e11ef5 Mathias Nyman 2018-04-19 2877 rhdev->tx_lanes = 1; 0299809be41556 Thinh Nguyen 2021-03-10 2878 rhdev->ssp_rate = USB_SSP_GEN_UNKNOWN; a2d49572e11ef5 Mathias Nyman 2018-04-19 2879 83de4b2b90887b Sarah Sharp 2010-12-02 2880 switch (hcd->speed) { 6b403b020c1f42 Sarah Sharp 2009-04-27 2881 case HCD_USB11: 6b403b020c1f42 Sarah Sharp 2009-04-27 2882 rhdev->speed = USB_SPEED_FULL; 6b403b020c1f42 Sarah Sharp 2009-04-27 2883 break; 6b403b020c1f42 Sarah Sharp 2009-04-27 2884 case HCD_USB2: 6b403b020c1f42 Sarah Sharp 2009-04-27 2885 rhdev->speed = USB_SPEED_HIGH; 6b403b020c1f42 Sarah Sharp 2009-04-27 2886 break; 1a81f8814cbc79 Thomas Pugliese 2013-05-31 2887 case HCD_USB25: 1a81f8814cbc79 Thomas Pugliese 2013-05-31 2888 rhdev->speed = USB_SPEED_WIRELESS; 1a81f8814cbc79 Thomas Pugliese 2013-05-31 2889 break; 6b403b020c1f42 Sarah Sharp 2009-04-27 2890 case HCD_USB3: 6b403b020c1f42 Sarah Sharp 2009-04-27 2891 rhdev->speed = USB_SPEED_SUPER; 6b403b020c1f42 Sarah Sharp 2009-04-27 2892 break; ffe95371d2a84f Mathias Nyman 2018-04-19 2893 case HCD_USB32: a2d49572e11ef5 Mathias Nyman 2018-04-19 2894 rhdev->rx_lanes = 2; a2d49572e11ef5 Mathias Nyman 2018-04-19 2895 rhdev->tx_lanes = 2; 0299809be41556 Thinh Nguyen 2021-03-10 2896 rhdev->ssp_rate = USB_SSP_GEN_2x2; 0299809be41556 Thinh Nguyen 2021-03-10 2897 rhdev->speed = USB_SPEED_SUPER_PLUS; 0299809be41556 Thinh Nguyen 2021-03-10 2898 break; 5f9c3a668b3f75 Mathias Nyman 2015-12-10 2899 case HCD_USB31: 0299809be41556 Thinh Nguyen 2021-03-10 2900 rhdev->ssp_rate = USB_SSP_GEN_2x1; 5f9c3a668b3f75 Mathias Nyman 2015-12-10 2901 rhdev->speed = USB_SPEED_SUPER_PLUS; 5f9c3a668b3f75 Mathias Nyman 2015-12-10 2902 break; 6b403b020c1f42 Sarah Sharp 2009-04-27 2903 default: 1d15ee4cd7c9dd Sebastian Andrzej Siewior 2011-04-14 2904 retval = -EINVAL; 96e077ae347912 Alan Stern 2010-06-09 2905 goto err_set_rh_speed; 6b403b020c1f42 Sarah Sharp 2009-04-27 2906 } b1e8f0a6a8805c David Brownell 2006-01-23 2907 db4cefaaea4c6d David Brownell 2006-05-01 2908 /* wakeup flag init defaults to "everything works" for root hubs, db4cefaaea4c6d David Brownell 2006-05-01 2909 * but drivers can override it in reset() if needed, along with db4cefaaea4c6d David Brownell 2006-05-01 2910 * recording the overall controller's system wakeup capability. db4cefaaea4c6d David Brownell 2006-05-01 2911 */ a6eeeb9f45b5a4 Alan Stern 2011-09-26 2912 device_set_wakeup_capable(&rhdev->dev, 1); db4cefaaea4c6d David Brownell 2006-05-01 2913 9b37596a2e8604 Alan Stern 2011-03-07 2914 /* HCD_FLAG_RH_RUNNING doesn't matter until the root hub is 9b37596a2e8604 Alan Stern 2011-03-07 2915 * registered. But since the controller can die at any time, 9b37596a2e8604 Alan Stern 2011-03-07 2916 * let's initialize the flag before touching the hardware. 9b37596a2e8604 Alan Stern 2011-03-07 2917 */ 9b37596a2e8604 Alan Stern 2011-03-07 2918 set_bit(HCD_FLAG_RH_RUNNING, &hcd->flags); 9b37596a2e8604 Alan Stern 2011-03-07 2919 b1e8f0a6a8805c David Brownell 2006-01-23 2920 /* "reset" is misnamed; its role is now one-time init. the controller b1e8f0a6a8805c David Brownell 2006-01-23 2921 * should already have been reset (and boot firmware kicked off etc). b1e8f0a6a8805c David Brownell 2006-01-23 2922 */ 0faaad461547e2 Kris Borer 2015-07-14 2923 if (hcd->driver->reset) { 0faaad461547e2 Kris Borer 2015-07-14 2924 retval = hcd->driver->reset(hcd); 0faaad461547e2 Kris Borer 2015-07-14 2925 if (retval < 0) { 0faaad461547e2 Kris Borer 2015-07-14 2926 dev_err(hcd->self.controller, "can't setup: %d\n", 0faaad461547e2 Kris Borer 2015-07-14 2927 retval); b1e8f0a6a8805c David Brownell 2006-01-23 2928 goto err_hcd_driver_setup; b1e8f0a6a8805c David Brownell 2006-01-23 2929 } 0faaad461547e2 Kris Borer 2015-07-14 2930 } 6d88e679257449 Alan Stern 2010-06-09 2931 hcd->rh_pollable = 1; b1e8f0a6a8805c David Brownell 2006-01-23 2932 34c7ed72f4f04e Marek Szyprowski 2019-08-29 2933 retval = usb_phy_roothub_calibrate(hcd->phy_roothub); 34c7ed72f4f04e Marek Szyprowski 2019-08-29 2934 if (retval) 34c7ed72f4f04e Marek Szyprowski 2019-08-29 2935 goto err_hcd_driver_setup; 34c7ed72f4f04e Marek Szyprowski 2019-08-29 2936 fb669cc01ed778 David Brownell 2006-01-24 2937 /* NOTE: root hub and controller capabilities may not be the same */ fb669cc01ed778 David Brownell 2006-01-24 2938 if (device_can_wakeup(hcd->self.controller) fb669cc01ed778 David Brownell 2006-01-24 2939 && device_can_wakeup(&hcd->self.root_hub->dev)) b1e8f0a6a8805c David Brownell 2006-01-23 2940 dev_dbg(hcd->self.controller, "supports USB remote wakeup\n"); b1e8f0a6a8805c David Brownell 2006-01-23 2941 94dfd7edfd5c9b Ming Lei 2013-07-03 2942 /* initialize tasklets */ 94dfd7edfd5c9b Ming Lei 2013-07-03 2943 init_giveback_urb_bh(&hcd->high_prio_bh); 94dfd7edfd5c9b Ming Lei 2013-07-03 2944 init_giveback_urb_bh(&hcd->low_prio_bh); 94dfd7edfd5c9b Ming Lei 2013-07-03 2945 68d07f64b8a11a Sarah Sharp 2012-02-13 2946 /* enable irqs just before we start the controller, 68d07f64b8a11a Sarah Sharp 2012-02-13 2947 * if the BIOS provides legacy PCI irqs. 68d07f64b8a11a Sarah Sharp 2012-02-13 2948 */ 68d07f64b8a11a Sarah Sharp 2012-02-13 2949 if (usb_hcd_is_primary_hcd(hcd) && irqnum) { 23e0d1066f429a Sarah Sharp 2010-10-21 2950 retval = usb_hcd_request_irqs(hcd, irqnum, irqflags); 23e0d1066f429a Sarah Sharp 2010-10-21 2951 if (retval) 8ec8d20b21f00a Alan Stern 2005-04-25 2952 goto err_request_irq; c56354378426e5 Sarah Sharp 2010-10-28 2953 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 2954 4814030ce11f08 Sarah Sharp 2011-03-11 2955 hcd->state = HC_STATE_RUNNING; abc4f9b099e9e7 Sarah Sharp 2010-12-01 2956 retval = hcd->driver->start(hcd); abc4f9b099e9e7 Sarah Sharp 2010-12-01 2957 if (retval < 0) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 2958 dev_err(hcd->self.controller, "startup error %d\n", retval); 8ec8d20b21f00a Alan Stern 2005-04-25 2959 goto err_hcd_driver_start; ^1da177e4c3f41 Linus Torvalds 2005-04-16 2960 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 2961 b1e8f0a6a8805c David Brownell 2006-01-23 2962 /* starting here, usbcore will pay attention to this root hub */ fe4b8457078ee0 Kishon Vijay Abraham I 2021-08-24 2963 if (register_hub) { 0faaad461547e2 Kris Borer 2015-07-14 2964 retval = register_root_hub(hcd); 0faaad461547e2 Kris Borer 2015-07-14 2965 if (retval != 0) 8ec8d20b21f00a Alan Stern 2005-04-25 2966 goto err_register_root_hub; 541c7d432f7677 Alan Stern 2010-06-22 2967 if (hcd->uses_new_polling && HCD_POLL_RH(hcd)) d5926ae7a827bd Alan Stern 2005-04-21 2968 usb_hcd_poll_rh_status(hcd); fe4b8457078ee0 Kishon Vijay Abraham I 2021-08-24 2969 } a6eeeb9f45b5a4 Alan Stern 2011-09-26 2970 ^1da177e4c3f41 Linus Torvalds 2005-04-16 2971 return retval; ^1da177e4c3f41 Linus Torvalds 2005-04-16 2972 8ec8d20b21f00a Alan Stern 2005-04-25 2973 err_register_root_hub: c8195df4a79699 Kishon Vijay Abraham I 2021-08-24 2974 usb_stop_hcd(hcd); 8ec8d20b21f00a Alan Stern 2005-04-25 2975 err_hcd_driver_start: cd70469d084fde Felipe Balbi 2012-02-29 2976 if (usb_hcd_is_primary_hcd(hcd) && hcd->irq > 0) ^1da177e4c3f41 Linus Torvalds 2005-04-16 2977 free_irq(irqnum, hcd); 8ec8d20b21f00a Alan Stern 2005-04-25 2978 err_request_irq: b1e8f0a6a8805c David Brownell 2006-01-23 2979 err_hcd_driver_setup: 96e077ae347912 Alan Stern 2010-06-09 2980 err_set_rh_speed: d8521afe35862f Dan Williams 2014-05-20 2981 usb_put_invalidate_rhdev(hcd); b1e8f0a6a8805c David Brownell 2006-01-23 2982 err_allocate_root_hub: ^1da177e4c3f41 Linus Torvalds 2005-04-16 2983 usb_deregister_bus(&hcd->self); 8ec8d20b21f00a Alan Stern 2005-04-25 2984 err_register_bus: ^1da177e4c3f41 Linus Torvalds 2005-04-16 2985 hcd_buffer_destroy(hcd); 00433254952221 Sergei Shtylyov 2014-09-24 2986 err_create_buf: 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2987 usb_phy_roothub_power_off(hcd->phy_roothub); 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2988 err_usb_phy_roothub_power_on: 178a0bce05cbc1 Martin Blumenstingl 2018-03-03 2989 usb_phy_roothub_exit(hcd->phy_roothub); bc40f53417410b Johan Hovold 2018-04-18 2990 ^1da177e4c3f41 Linus Torvalds 2005-04-16 2991 return retval; ^1da177e4c3f41 Linus Torvalds 2005-04-16 2992 } fe4b8457078ee0 Kishon Vijay Abraham I 2021-08-24 2993 EXPORT_SYMBOL_GPL(__usb_add_hcd); ^1da177e4c3f41 Linus Torvalds 2005-04-16 2994 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org