public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jie Deng <dengjie03@kylinos.cn>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jie Deng <dengjie03@kylinos.cn>
Subject: Re: [PATCH] usb: core: new quirk to handle devices with zero configurations
Date: Thu, 26 Feb 2026 20:21:14 +0800	[thread overview]
Message-ID: <202602262055.asAbiuP0-lkp@intel.com> (raw)
In-Reply-To: <20260226094737.1306471-1-dengjie03@kylinos.cn>

Hi Jie,

kernel test robot noticed the following build errors:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on usb/usb-next usb/usb-linus westeri-thunderbolt/next linus/master v7.0-rc1 next-20260225]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jie-Deng/usb-core-new-quirk-to-handle-devices-with-zero-configurations/20260226-180039
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link:    https://lore.kernel.org/r/20260226094737.1306471-1-dengjie03%40kylinos.cn
patch subject: [PATCH] usb: core: new quirk to handle devices with zero configurations
config: parisc-randconfig-r072-20260226 (https://download.01.org/0day-ci/archive/20260226/202602262055.asAbiuP0-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 9.5.0
smatch version: v0.5.0-8994-gd50c5a4c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260226/202602262055.asAbiuP0-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602262055.asAbiuP0-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/usb/core/config.c: In function 'usb_get_configuration':
>> drivers/usb/core/config.c:931:18: warning: missing terminating " character
     931 |   dev_info(ddev, "Device claims zero configurations,
         |                  ^
   drivers/usb/core/config.c:932:19: warning: missing terminating " character
     932 |     forcing to 1\n");
         |                   ^
>> drivers/usb/core/config.c:1156: error: unterminated argument list invoking macro "dev_info"
    1156 | }
         | 
>> drivers/usb/core/config.c:931:3: error: 'dev_info' undeclared (first use in this function); did you mean '_dev_info'?
     931 |   dev_info(ddev, "Device claims zero configurations,
         |   ^~~~~~~~
         |   _dev_info
   drivers/usb/core/config.c:931:3: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/usb/core/config.c:931:11: error: expected ';' at end of input
     931 |   dev_info(ddev, "Device claims zero configurations,
         |           ^
         |           ;
   ......
    1156 | }
         |            
>> drivers/usb/core/config.c:931:3: error: expected declaration or statement at end of input
     931 |   dev_info(ddev, "Device claims zero configurations,
         |   ^~~~~~~~
>> drivers/usb/core/config.c:931:3: error: expected declaration or statement at end of input
>> drivers/usb/core/config.c:922:6: warning: unused variable 'result' [-Wunused-variable]
     922 |  int result;
         |      ^~~~~~
>> drivers/usb/core/config.c:921:32: warning: unused variable 'desc' [-Wunused-variable]
     921 |  struct usb_config_descriptor *desc;
         |                                ^~~~
>> drivers/usb/core/config.c:920:17: warning: unused variable 'bigbuffer' [-Wunused-variable]
     920 |  unsigned char *bigbuffer;
         |                 ^~~~~~~~~
>> drivers/usb/core/config.c:919:22: warning: unused variable 'length' [-Wunused-variable]
     919 |  unsigned int cfgno, length;
         |                      ^~~~~~
>> drivers/usb/core/config.c:919:15: warning: unused variable 'cfgno' [-Wunused-variable]
     919 |  unsigned int cfgno, length;
         |               ^~~~~
>> drivers/usb/core/config.c:1156: warning: control reaches end of non-void function [-Wreturn-type]
    1156 | }
         | 
   At top level:
>> drivers/usb/core/config.c:659:12: warning: 'usb_parse_configuration' defined but not used [-Wunused-function]
     659 | static int usb_parse_configuration(struct usb_device *dev, int cfgidx,
         |            ^~~~~~~~~~~~~~~~~~~~~~~


vim +/dev_info +1156 drivers/usb/core/config.c

81cf4a45360f70 Masakazu Mokuno  2017-11-10  1035  
3148bf041d169a Andiry Xu        2011-09-23  1036  /* Get BOS descriptor set */
3148bf041d169a Andiry Xu        2011-09-23  1037  int usb_get_bos_descriptor(struct usb_device *dev)
3148bf041d169a Andiry Xu        2011-09-23  1038  {
3148bf041d169a Andiry Xu        2011-09-23  1039  	struct device *ddev = &dev->dev;
3148bf041d169a Andiry Xu        2011-09-23  1040  	struct usb_bos_descriptor *bos;
3148bf041d169a Andiry Xu        2011-09-23  1041  	struct usb_dev_cap_header *cap;
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1042  	struct usb_ssp_cap_descriptor *ssp_cap;
3dd550a2d36596 Alan Stern       2019-09-04  1043  	unsigned char *buffer, *buffer0;
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1044  	int length, total_len, num, i, ssac;
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1045  	__u8 cap_type;
3148bf041d169a Andiry Xu        2011-09-23  1046  	int ret;
3148bf041d169a Andiry Xu        2011-09-23  1047  
2740ac33c87b3d Johannes Brüderl 2025-12-07  1048  	if (dev->quirks & USB_QUIRK_NO_BOS) {
2740ac33c87b3d Johannes Brüderl 2025-12-07  1049  		dev_dbg(ddev, "skipping BOS descriptor\n");
2740ac33c87b3d Johannes Brüderl 2025-12-07  1050  		return -ENOMSG;
2740ac33c87b3d Johannes Brüderl 2025-12-07  1051  	}
2740ac33c87b3d Johannes Brüderl 2025-12-07  1052  
bf4afc53b77aea Linus Torvalds   2026-02-21  1053  	bos = kzalloc_obj(*bos);
3148bf041d169a Andiry Xu        2011-09-23  1054  	if (!bos)
3148bf041d169a Andiry Xu        2011-09-23  1055  		return -ENOMEM;
3148bf041d169a Andiry Xu        2011-09-23  1056  
3148bf041d169a Andiry Xu        2011-09-23  1057  	/* Get BOS descriptor */
3148bf041d169a Andiry Xu        2011-09-23  1058  	ret = usb_get_descriptor(dev, USB_DT_BOS, 0, bos, USB_DT_BOS_SIZE);
a03ff54460817c Alan Stern       2019-05-13  1059  	if (ret < USB_DT_BOS_SIZE || bos->bLength < USB_DT_BOS_SIZE) {
7a09c1269702db Alan Stern       2022-11-02  1060  		dev_notice(ddev, "unable to get BOS descriptor or descriptor too short\n");
3148bf041d169a Andiry Xu        2011-09-23  1061  		if (ret >= 0)
3148bf041d169a Andiry Xu        2011-09-23  1062  			ret = -ENOMSG;
3148bf041d169a Andiry Xu        2011-09-23  1063  		kfree(bos);
3148bf041d169a Andiry Xu        2011-09-23  1064  		return ret;
3148bf041d169a Andiry Xu        2011-09-23  1065  	}
3148bf041d169a Andiry Xu        2011-09-23  1066  
3148bf041d169a Andiry Xu        2011-09-23  1067  	length = bos->bLength;
3148bf041d169a Andiry Xu        2011-09-23  1068  	total_len = le16_to_cpu(bos->wTotalLength);
3148bf041d169a Andiry Xu        2011-09-23  1069  	num = bos->bNumDeviceCaps;
3148bf041d169a Andiry Xu        2011-09-23  1070  	kfree(bos);
3148bf041d169a Andiry Xu        2011-09-23  1071  	if (total_len < length)
3148bf041d169a Andiry Xu        2011-09-23  1072  		return -EINVAL;
3148bf041d169a Andiry Xu        2011-09-23  1073  
bf4afc53b77aea Linus Torvalds   2026-02-21  1074  	dev->bos = kzalloc_obj(*dev->bos);
3148bf041d169a Andiry Xu        2011-09-23  1075  	if (!dev->bos)
3148bf041d169a Andiry Xu        2011-09-23  1076  		return -ENOMEM;
3148bf041d169a Andiry Xu        2011-09-23  1077  
3148bf041d169a Andiry Xu        2011-09-23  1078  	/* Now let's get the whole BOS descriptor set */
3148bf041d169a Andiry Xu        2011-09-23  1079  	buffer = kzalloc(total_len, GFP_KERNEL);
3148bf041d169a Andiry Xu        2011-09-23  1080  	if (!buffer) {
3148bf041d169a Andiry Xu        2011-09-23  1081  		ret = -ENOMEM;
3148bf041d169a Andiry Xu        2011-09-23  1082  		goto err;
3148bf041d169a Andiry Xu        2011-09-23  1083  	}
3148bf041d169a Andiry Xu        2011-09-23  1084  	dev->bos->desc = (struct usb_bos_descriptor *)buffer;
3148bf041d169a Andiry Xu        2011-09-23  1085  
3148bf041d169a Andiry Xu        2011-09-23  1086  	ret = usb_get_descriptor(dev, USB_DT_BOS, 0, buffer, total_len);
3148bf041d169a Andiry Xu        2011-09-23  1087  	if (ret < total_len) {
7a09c1269702db Alan Stern       2022-11-02  1088  		dev_notice(ddev, "unable to get BOS descriptor set\n");
3148bf041d169a Andiry Xu        2011-09-23  1089  		if (ret >= 0)
3148bf041d169a Andiry Xu        2011-09-23  1090  			ret = -ENOMSG;
3148bf041d169a Andiry Xu        2011-09-23  1091  		goto err;
3148bf041d169a Andiry Xu        2011-09-23  1092  	}
3dd550a2d36596 Alan Stern       2019-09-04  1093  
3dd550a2d36596 Alan Stern       2019-09-04  1094  	buffer0 = buffer;
3148bf041d169a Andiry Xu        2011-09-23  1095  	total_len -= length;
3dd550a2d36596 Alan Stern       2019-09-04  1096  	buffer += length;
3148bf041d169a Andiry Xu        2011-09-23  1097  
3148bf041d169a Andiry Xu        2011-09-23  1098  	for (i = 0; i < num; i++) {
3148bf041d169a Andiry Xu        2011-09-23  1099  		cap = (struct usb_dev_cap_header *)buffer;
3148bf041d169a Andiry Xu        2011-09-23  1100  
1c0edc3633b560 Alan Stern       2017-10-18  1101  		if (total_len < sizeof(*cap) || total_len < cap->bLength) {
1c0edc3633b560 Alan Stern       2017-10-18  1102  			dev->bos->desc->bNumDeviceCaps = i;
3148bf041d169a Andiry Xu        2011-09-23  1103  			break;
1c0edc3633b560 Alan Stern       2017-10-18  1104  		}
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1105  		cap_type = cap->bDevCapabilityType;
1c0edc3633b560 Alan Stern       2017-10-18  1106  		length = cap->bLength;
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1107  		if (bos_desc_len[cap_type] && length < bos_desc_len[cap_type]) {
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1108  			dev->bos->desc->bNumDeviceCaps = i;
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1109  			break;
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1110  		}
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1111  
3148bf041d169a Andiry Xu        2011-09-23  1112  		if (cap->bDescriptorType != USB_DT_DEVICE_CAPABILITY) {
7a09c1269702db Alan Stern       2022-11-02  1113  			dev_notice(ddev, "descriptor type invalid, skip\n");
974bba5c118f4c Niklas Neronin   2023-11-15  1114  			goto skip_to_next_descriptor;
3148bf041d169a Andiry Xu        2011-09-23  1115  		}
3148bf041d169a Andiry Xu        2011-09-23  1116  
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1117  		switch (cap_type) {
3148bf041d169a Andiry Xu        2011-09-23  1118  		case USB_CAP_TYPE_EXT:
3148bf041d169a Andiry Xu        2011-09-23  1119  			dev->bos->ext_cap =
3148bf041d169a Andiry Xu        2011-09-23  1120  				(struct usb_ext_cap_descriptor *)buffer;
3148bf041d169a Andiry Xu        2011-09-23  1121  			break;
3148bf041d169a Andiry Xu        2011-09-23  1122  		case USB_SS_CAP_TYPE:
3148bf041d169a Andiry Xu        2011-09-23  1123  			dev->bos->ss_cap =
3148bf041d169a Andiry Xu        2011-09-23  1124  				(struct usb_ss_cap_descriptor *)buffer;
3148bf041d169a Andiry Xu        2011-09-23  1125  			break;
3220befddc0da1 Mathias Nyman    2015-10-01  1126  		case USB_SSP_CAP_TYPE:
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1127  			ssp_cap = (struct usb_ssp_cap_descriptor *)buffer;
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1128  			ssac = (le32_to_cpu(ssp_cap->bmAttributes) &
07b9f12864d16c Mathias Nyman    2017-12-19  1129  				USB_SSP_SUBLINK_SPEED_ATTRIBS);
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1130  			if (length >= USB_DT_USB_SSP_CAP_SIZE(ssac))
81cf4a45360f70 Masakazu Mokuno  2017-11-10  1131  				dev->bos->ssp_cap = ssp_cap;
3220befddc0da1 Mathias Nyman    2015-10-01  1132  			break;
3148bf041d169a Andiry Xu        2011-09-23  1133  		case CONTAINER_ID_TYPE:
3148bf041d169a Andiry Xu        2011-09-23  1134  			dev->bos->ss_id =
3148bf041d169a Andiry Xu        2011-09-23  1135  				(struct usb_ss_container_id_descriptor *)buffer;
3148bf041d169a Andiry Xu        2011-09-23  1136  			break;
faee822c5a7ab9 Mathias Nyman    2016-02-12  1137  		case USB_PTM_CAP_TYPE:
faee822c5a7ab9 Mathias Nyman    2016-02-12  1138  			dev->bos->ptm_cap =
faee822c5a7ab9 Mathias Nyman    2016-02-12  1139  				(struct usb_ptm_cap_descriptor *)buffer;
1d6903a617a221 Nick Desaulniers 2020-11-10  1140  			break;
3148bf041d169a Andiry Xu        2011-09-23  1141  		default:
3148bf041d169a Andiry Xu        2011-09-23  1142  			break;
3148bf041d169a Andiry Xu        2011-09-23  1143  		}
3dd550a2d36596 Alan Stern       2019-09-04  1144  
974bba5c118f4c Niklas Neronin   2023-11-15  1145  skip_to_next_descriptor:
3dd550a2d36596 Alan Stern       2019-09-04  1146  		total_len -= length;
3dd550a2d36596 Alan Stern       2019-09-04  1147  		buffer += length;
3148bf041d169a Andiry Xu        2011-09-23  1148  	}
3dd550a2d36596 Alan Stern       2019-09-04  1149  	dev->bos->desc->wTotalLength = cpu_to_le16(buffer - buffer0);
3148bf041d169a Andiry Xu        2011-09-23  1150  
3148bf041d169a Andiry Xu        2011-09-23  1151  	return 0;
3148bf041d169a Andiry Xu        2011-09-23  1152  
3148bf041d169a Andiry Xu        2011-09-23  1153  err:
3148bf041d169a Andiry Xu        2011-09-23  1154  	usb_release_bos_descriptor(dev);
3148bf041d169a Andiry Xu        2011-09-23  1155  	return ret;
3148bf041d169a Andiry Xu        2011-09-23 @1156  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  reply	other threads:[~2026-02-26 12:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26  9:47 [PATCH] usb: core: new quirk to handle devices with zero configurations Jie Deng
2026-02-26 12:21 ` kernel test robot [this message]
2026-02-26 14:28 ` Greg Kroah-Hartman
2026-02-27  3:00   ` Jie Deng
2026-02-26 15:30 ` Alan Stern
2026-02-27  1:47   ` Jie Deng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202602262055.asAbiuP0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dengjie03@kylinos.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox