Re: [usb:usb-linus 14/14] drivers/usb/dwc2/drd.c:133:28: error: 'struct dwc2_hsotg' has no member named 'enabled'; did you mean 'hcd_enabled'?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 12, 2022 at 01:58:06AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus
> head:   269cbcf7b72de6f0016806d4a0cec1d689b55a87
> commit: 269cbcf7b72de6f0016806d4a0cec1d689b55a87 [14/14] usb: dwc2: drd: fix soft connect when gadget is unconfigured
> config: microblaze-randconfig-r021-20220211 (https://download.01.org/0day-ci/archive/20220211/202202112236.AwoOTtHO-lkp@xxxxxxxxx/config)
> compiler: microblaze-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/gregkh/usb.git/commit/?id=269cbcf7b72de6f0016806d4a0cec1d689b55a87
>         git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
>         git fetch --no-tags usb usb-linus
>         git checkout 269cbcf7b72de6f0016806d4a0cec1d689b55a87
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/usb/
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/err.h:5,
>                     from include/linux/clk.h:12,
>                     from drivers/usb/dwc2/drd.c:10:
>    drivers/usb/dwc2/drd.c: In function 'dwc2_drd_role_sw_set':
> >> drivers/usb/dwc2/drd.c:133:28: error: 'struct dwc2_hsotg' has no member named 'enabled'; did you mean 'hcd_enabled'?
>      133 |                 if (hsotg->enabled) {
>          |                            ^~~~~~~
>    include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
>       58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
>          |                                                    ^~~~
>    drivers/usb/dwc2/drd.c:133:17: note: in expansion of macro 'if'
>      133 |                 if (hsotg->enabled) {
>          |                 ^~
> >> drivers/usb/dwc2/drd.c:133:28: error: 'struct dwc2_hsotg' has no member named 'enabled'; did you mean 'hcd_enabled'?
>      133 |                 if (hsotg->enabled) {
>          |                            ^~~~~~~
>    include/linux/compiler.h:58:61: note: in definition of macro '__trace_if_var'
>       58 | #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
>          |                                                             ^~~~
>    drivers/usb/dwc2/drd.c:133:17: note: in expansion of macro 'if'
>      133 |                 if (hsotg->enabled) {
>          |                 ^~
> >> drivers/usb/dwc2/drd.c:133:28: error: 'struct dwc2_hsotg' has no member named 'enabled'; did you mean 'hcd_enabled'?
>      133 |                 if (hsotg->enabled) {
>          |                            ^~~~~~~
>    include/linux/compiler.h:69:10: note: in definition of macro '__trace_if_value'
>       69 |         (cond) ?                                        \
>          |          ^~~~
>    include/linux/compiler.h:56:28: note: in expansion of macro '__trace_if_var'
>       56 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
>          |                            ^~~~~~~~~~~~~~
>    drivers/usb/dwc2/drd.c:133:17: note: in expansion of macro 'if'
>      133 |                 if (hsotg->enabled) {
>          |                 ^~
> 
> 
> vim +133 drivers/usb/dwc2/drd.c
> 
>    104	
>    105		/*
>    106		 * In case of USB_DR_MODE_PERIPHERAL, clock is disabled at the end of
>    107		 * the probe and enabled on udc_start.
>    108		 * If role-switch set is called before the udc_start, we need to enable
>    109		 * the clock to read/write GOTGCTL and GUSBCFG registers to override
>    110		 * mode and sessions. It is the case if cable is plugged at boot.
>    111		 */
>    112		if (!hsotg->ll_hw_enabled && hsotg->clk) {
>    113			int ret = clk_prepare_enable(hsotg->clk);
>    114	
>    115			if (ret)
>    116				return ret;
>    117		}
>    118	
>    119		spin_lock_irqsave(&hsotg->lock, flags);
>    120	
>    121		if (role == USB_ROLE_NONE) {
>    122			/* default operation mode when usb role is USB_ROLE_NONE */
>    123			if (hsotg->role_sw_default_mode == USB_DR_MODE_HOST)
>    124				role = USB_ROLE_HOST;
>    125			else if (hsotg->role_sw_default_mode == USB_DR_MODE_PERIPHERAL)
>    126				role = USB_ROLE_DEVICE;
>    127		}
>    128	
>    129		if (role == USB_ROLE_HOST) {
>    130			already = dwc2_ovr_avalid(hsotg, true);
>    131		} else if (role == USB_ROLE_DEVICE) {
>    132			already = dwc2_ovr_bvalid(hsotg, true);
>  > 133			if (hsotg->enabled) {
>    134				/* This clear DCTL.SFTDISCON bit */
>    135				dwc2_hsotg_core_connect(hsotg);
>    136			}
>    137		} else {
>    138			if (dwc2_is_device_mode(hsotg)) {
>    139				if (!dwc2_ovr_bvalid(hsotg, false))
>    140					/* This set DCTL.SFTDISCON bit */
>    141					dwc2_hsotg_core_disconnect(hsotg);
>    142			} else {
>    143				dwc2_ovr_avalid(hsotg, false);
>    144			}
>    145		}
>    146	
>    147		spin_unlock_irqrestore(&hsotg->lock, flags);
>    148	
>    149		if (!already && hsotg->dr_mode == USB_DR_MODE_OTG)
>    150			/* This will raise a Connector ID Status Change Interrupt */
>    151			dwc2_force_mode(hsotg, role == USB_ROLE_HOST);
>    152	
>    153		if (!hsotg->ll_hw_enabled && hsotg->clk)
>    154			clk_disable_unprepare(hsotg->clk);
>    155	
>    156		dev_dbg(hsotg->dev, "%s-session valid\n",
>    157			role == USB_ROLE_NONE ? "No" :
>    158			role == USB_ROLE_HOST ? "A" : "B");
>    159	
>    160		return 0;
>    161	}
>    162	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

I will go revert this change.

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux