Re: [PATCH] bluetooth: add quirk using packet size 60

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

 



Hi Hilda,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth/master]
[also build test WARNING on bluetooth-next/master linus/master v6.12-rc5 next-20241031]
[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/Hilda-Wu/bluetooth-add-quirk-using-packet-size-60/20241030-181008
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
patch link:    https://lore.kernel.org/r/20241030100804.2743115-1-hildawu%40realtek.com
patch subject: [PATCH] bluetooth: add quirk using packet size 60
config: x86_64-randconfig-123-20241031 (https://download.01.org/0day-ci/archive/20241031/202410312046.r3WbTClD-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241031/202410312046.r3WbTClD-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410312046.r3WbTClD-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/bluetooth/btusb.c:2156:65: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] wMaxPacketSize @@     got int @@
   drivers/bluetooth/btusb.c:2156:65: sparse:     expected restricted __le16 [usertype] wMaxPacketSize
   drivers/bluetooth/btusb.c:2156:65: sparse:     got int
   drivers/bluetooth/btusb.c:2188:65: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] wMaxPacketSize @@     got int @@
   drivers/bluetooth/btusb.c:2188:65: sparse:     expected restricted __le16 [usertype] wMaxPacketSize
   drivers/bluetooth/btusb.c:2188:65: sparse:     got int
>> drivers/bluetooth/btusb.c:2156:65: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] wMaxPacketSize @@     got int @@
   drivers/bluetooth/btusb.c:2156:65: sparse:     expected restricted __le16 [usertype] wMaxPacketSize
   drivers/bluetooth/btusb.c:2156:65: sparse:     got int
   drivers/bluetooth/btusb.c:2188:65: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] wMaxPacketSize @@     got int @@
   drivers/bluetooth/btusb.c:2188:65: sparse:     expected restricted __le16 [usertype] wMaxPacketSize
   drivers/bluetooth/btusb.c:2188:65: sparse:     got int

vim +2156 drivers/bluetooth/btusb.c

  2126	
  2127	static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting)
  2128	{
  2129		struct btusb_data *data = hci_get_drvdata(hdev);
  2130		struct usb_interface *intf = data->isoc;
  2131		struct usb_endpoint_descriptor *ep_desc;
  2132		struct usb_host_interface *alt;
  2133		int i, err;
  2134	
  2135		if (!data->isoc)
  2136			return -ENODEV;
  2137	
  2138		/* For some Realtek chips, they actually have the altsetting 6, but its
  2139		 * altsetting descriptor is not exposed. We can activate altsetting 6 by
  2140		 * replacing the altsetting 5.
  2141		 */
  2142		if (altsetting == 6 && !btusb_find_altsetting(data, 6) &&
  2143		    btrealtek_test_flag(hdev, REALTEK_ALT6_FORCE)) {
  2144			alt = NULL;
  2145			for (i = 0; i < intf->num_altsetting; i++) {
  2146				if (intf->altsetting[i].desc.bAlternateSetting == 5) {
  2147					alt = &intf->altsetting[i];
  2148					break;
  2149				}
  2150			}
  2151			if (alt) {
  2152				for (i = 0; i < alt->desc.bNumEndpoints; i++) {
  2153					ep_desc = &alt->endpoint[i].desc;
  2154					if (usb_endpoint_is_isoc_out(ep_desc) ||
  2155					    usb_endpoint_is_isoc_in(ep_desc))
> 2156						ep_desc->wMaxPacketSize = 63;
  2157				}
  2158				alt->desc.bAlternateSetting = 6;
  2159				set_bit(BTUSB_ALT_CHANGED, &data->flags);
  2160			}
  2161		}
  2162	
  2163		err = usb_set_interface(data->udev, data->isoc_ifnum, altsetting);
  2164		if (err < 0) {
  2165			bt_dev_err(hdev, "setting interface failed (%d)", -err);
  2166			return err;
  2167		}
  2168	
  2169		data->isoc_altsetting = altsetting;
  2170	
  2171		data->isoc_tx_ep = NULL;
  2172		data->isoc_rx_ep = NULL;
  2173	
  2174		/* Recover alt 5 desc if alt 0 is set. */
  2175		if (!altsetting && test_bit(BTUSB_ALT_CHANGED, &data->flags)) {
  2176			alt = NULL;
  2177			for (i = 0; i < intf->num_altsetting; i++) {
  2178				if (intf->altsetting[i].desc.bAlternateSetting == 6) {
  2179					alt = &intf->altsetting[i];
  2180					break;
  2181				}
  2182			}
  2183			if (alt) {
  2184				for (i = 0; i < alt->desc.bNumEndpoints; i++) {
  2185					ep_desc = &alt->endpoint[i].desc;
  2186					if (usb_endpoint_is_isoc_out(ep_desc) ||
  2187					    usb_endpoint_is_isoc_in(ep_desc))
  2188						ep_desc->wMaxPacketSize = 49;
  2189				}
  2190				alt->desc.bAlternateSetting = 5;
  2191				clear_bit(BTUSB_ALT_CHANGED, &data->flags);
  2192			}
  2193		}
  2194	
  2195		for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) {
  2196			ep_desc = &intf->cur_altsetting->endpoint[i].desc;
  2197	
  2198			if (!data->isoc_tx_ep && usb_endpoint_is_isoc_out(ep_desc)) {
  2199				data->isoc_tx_ep = ep_desc;
  2200				continue;
  2201			}
  2202	
  2203			if (!data->isoc_rx_ep && usb_endpoint_is_isoc_in(ep_desc)) {
  2204				data->isoc_rx_ep = ep_desc;
  2205				continue;
  2206			}
  2207		}
  2208	
  2209		if (!data->isoc_tx_ep || !data->isoc_rx_ep) {
  2210			bt_dev_err(hdev, "invalid SCO descriptors");
  2211			return -ENODEV;
  2212		}
  2213	
  2214		return 0;
  2215	}
  2216	

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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux