Pull USB / Thunderbolt fixes from Greg KH: "Here are some small USB and Thunderbolt driver fixes for 7.2-rc7 that resolve some reported issues. Included in here are: - new quirk for some broken USB devices - thunderbolt device fixes for reported issues - usb gadget driver fix - usb atm driver fix - xhci driver fixes. - other minor USB driver fixes All of these have been in linux-next this week with no reported issues" * tag 'usb-7.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: xhci: use BIT_ULL for CRCR bits to fix incorrect 64bit mask usb: quirks: Add ShanWan gamepad to quirk list usb: hub: Split announce_device() to log device identity before enumeration usb: core: Add quirk for 255-bytes initial config read usb: atm: cxacru: properly kill rcv_urb on error in cxacru_cm() usb: misc: usbio: check ibuf_len against rxbuf_len in bulk msg usb: gadget: f_ncm: Use unsigned int for ndp_index usb: cdnsp: fix incorrect endian conversions for APB timeout register thunderbolt: Initialize ->domain_released completion before it is being used thunderbolt: icm: Preserve USB4 proxy data-valid bit thunderbolt: Bound the DROM dual link port number before indexing sw->ports thunderbolt: Fix bandwidth group reservation indexing thunderbolt: stream: Unmap buffers with mapped size
Unified · Split
| @@ -8169,6 +8169,11 @@ Kernel parameters · 8168 unmodified lines | |||
| 8169 | q = USB_QUIRK_FORCE_ONE_CONFIG (Device | 8169 | q = USB_QUIRK_FORCE_ONE_CONFIG (Device |
| 8170 | claims zero configurations, | 8170 | claims zero configurations, |
| 8171 | forcing to 1); | 8171 | forcing to 1); |
| 8172 | r = USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE (Device | ||
| 8173 | fails during initialization when asked for | ||
| 8174 | 9-bytes configuration descriptor request. | ||
| 8175 | Ask for 255-bytes request instead to mirror | ||
| 8176 | Windows' behavior); | ||
| 8172 | Example: quirks=0781:5580:bk,0a5c:5834:gij | 8177 | Example: quirks=0781:5580:bk,0a5c:5834:gij |
| 8173 | 8178 | ||
| 8174 | usbhid.mousepoll= | 8179 | usbhid.mousepoll= |
| @@ -394,9 +394,16 @@ static int tb_drom_parse_entry_port(struct tb_switch *sw, · 393 unmodified lines | |||
| 394 | return -EIO; | 394 | return -EIO; |
| 395 | } | 395 | } |
| 396 | port->link_nr = entry->link_nr; | 396 | port->link_nr = entry->link_nr; |
| 397 | if (entry->has_dual_link_port) | 397 | if (entry->has_dual_link_port) { |
| 398 | if (entry->dual_link_port_nr > sw->config.max_port_number) { | ||
| 399 | tb_sw_warn(sw, | ||
| 400 | "port entry has invalid dual link port number %u\n", | ||
| 401 | entry->dual_link_port_nr); | ||
| 402 | return -EIO; | ||
| 403 | } | ||
| 398 | port->dual_link_port = | 404 | port->dual_link_port = |
| 399 | &port->sw->ports[entry->dual_link_port_nr]; | 405 | &port->sw->ports[entry->dual_link_port_nr]; |
| 406 | } | ||
| 400 | } | 407 | } |
| 401 | return 0; | 408 | return 0; |
| 402 | } | 409 | } |
| @@ -2341,7 +2341,7 @@ static int icm_usb4_switch_op(struct tb_switch *sw, u16 opcode, u32 *metadata, · 2340 unmodified lines | |||
| 2341 | if (tx_data_len) { | 2341 | if (tx_data_len) { |
| 2342 | request.data_len_valid |= ICM_USB4_SWITCH_DATA_VALID; | 2342 | request.data_len_valid |= ICM_USB4_SWITCH_DATA_VALID; |
| 2343 | if (tx_data_len < ARRAY_SIZE(request.data)) | 2343 | if (tx_data_len < ARRAY_SIZE(request.data)) |
| 2344 | request.data_len_valid = | 2344 | request.data_len_valid |= |
| 2345 | tx_data_len & ICM_USB4_SWITCH_DATA_LEN_MASK; | 2345 | tx_data_len & ICM_USB4_SWITCH_DATA_LEN_MASK; |
| 2346 | memcpy(request.data, tx_data, tx_data_len * sizeof(u32)); | 2346 | memcpy(request.data, tx_data, tx_data_len * sizeof(u32)); |
| 2347 | } | 2347 | } |
| @@ -1226,6 +1226,8 @@ int nhi_probe(struct tb_nhi *nhi) · 1225 unmodified lines | |||
| 1226 | return dev_err_probe(dev, res, "NHI specific init failed\n"); | 1226 | return dev_err_probe(dev, res, "NHI specific init failed\n"); |
| 1227 | } | 1227 | } |
| 1228 | 1228 | ||
| 1229 | init_completion(&nhi->domain_released); | ||
| 1230 | |||
| 1229 | tb = nhi_select_cm(nhi); | 1231 | tb = nhi_select_cm(nhi); |
| 1230 | if (!tb) | 1232 | if (!tb) |
| 1231 | return dev_err_probe(dev, -ENODEV, | 1233 | return dev_err_probe(dev, -ENODEV, |
| @@ -1233,8 +1235,6 @@ int nhi_probe(struct tb_nhi *nhi) · 1 unmodified line | |||
| 1233 | 1235 | ||
| 1234 | dev_dbg(dev, "NHI initialized, starting thunderbolt\n"); | 1236 | dev_dbg(dev, "NHI initialized, starting thunderbolt\n"); |
| 1235 | 1237 | ||
| 1236 | init_completion(&nhi->domain_released); | ||
| 1237 | |||
| 1238 | res = tb_domain_add(tb, host_reset); | 1238 | res = tb_domain_add(tb, host_reset); |
| 1239 | if (res) { | 1239 | if (res) { |
| 1240 | /* | 1240 | /* |
| @@ -257,7 +257,7 @@ static void tbstream_ring_free(struct tbstream_ring *ring) · 256 unmodified lines | |||
| 257 | 257 | ||
| 258 | if (sf->frame.buffer_phy) | 258 | if (sf->frame.buffer_phy) |
| 259 | dma_unmap_page(dma_dev, sf->frame.buffer_phy, | 259 | dma_unmap_page(dma_dev, sf->frame.buffer_phy, |
| 260 | tb_ring_frame_size(&sf->frame), dir); | 260 | TB_MAX_FRAME_SIZE, dir); |
| 261 | sf->frame.buffer_phy = 0; | 261 | sf->frame.buffer_phy = 0; |
| 262 | if (sf->page) | 262 | if (sf->page) |
| 263 | __free_page(sf->page); | 263 | __free_page(sf->page); |
| @@ -609,7 +609,7 @@ static int tb_consumed_dp_bandwidth(struct tb *tb, · 608 unmodified lines | |||
| 609 | int *consumed_up, | 609 | int *consumed_up, |
| 610 | int *consumed_down) | 610 | int *consumed_down) |
| 611 | { | 611 | { |
| 612 | int group_reserved[MAX_GROUPS] = {}; | 612 | int group_reserved[MAX_GROUPS + 1] = {}; |
| 613 | struct tb_cm *tcm = tb_priv(tb); | 613 | struct tb_cm *tcm = tb_priv(tb); |
| 614 | struct tb_tunnel *tunnel; | 614 | struct tb_tunnel *tunnel; |
| 615 | bool downstream; | 615 | bool downstream; |
| @@ -700,6 +700,8 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm, · 699 unmodified lines | |||
| 700 | ret = offd; | 700 | ret = offd; |
| 701 | usb_dbg(instance->usbatm, "cm %#x\n", cm); | 701 | usb_dbg(instance->usbatm, "cm %#x\n", cm); |
| 702 | fail: | 702 | fail: |
| 703 | if (ret < 0) | ||
| 704 | usb_kill_urb(instance->rcv_urb); | ||
| 703 | mutex_unlock(&instance->cm_serialize); | 705 | mutex_unlock(&instance->cm_serialize); |
| 704 | err: | 706 | err: |
| 705 | return ret; | 707 | return ret; |
| @@ -163,9 +163,9 @@ static void cdnsp_set_apb_timeout_value(struct cdnsp_device *pdev) · 162 unmodified lines | |||
| 163 | offset = cdnsp_find_next_ext_cap(base, offset, D_XEC_PRE_REGS_CAP); | 163 | offset = cdnsp_find_next_ext_cap(base, offset, D_XEC_PRE_REGS_CAP); |
| 164 | reg = base + offset + REG_CHICKEN_BITS_3_OFFSET; | 164 | reg = base + offset + REG_CHICKEN_BITS_3_OFFSET; |
| 165 | 165 | ||
| 166 | val = le32_to_cpu(readl(reg)); | 166 | val = readl(reg); |
| 167 | val = CHICKEN_APB_TIMEOUT_SET(val, cdns->override_apb_timeout); | 167 | val = CHICKEN_APB_TIMEOUT_SET(val, cdns->override_apb_timeout); |
| 168 | writel(cpu_to_le32(val), reg); | 168 | writel(val, reg); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | static void cdnsp_set_chicken_bits_2(struct cdnsp_device *pdev, u32 bit) | 171 | static void cdnsp_set_chicken_bits_2(struct cdnsp_device *pdev, u32 bit) |
| @@ -912,6 +912,18 @@ int usb_get_configuration(struct usb_device *dev) · 911 unmodified lines | |||
| 912 | unsigned char *bigbuffer; | 912 | unsigned char *bigbuffer; |
| 913 | struct usb_config_descriptor *desc; | 913 | struct usb_config_descriptor *desc; |
| 914 | int result; | 914 | int result; |
| 915 | size_t usb_config_req_size; | ||
| 916 | |||
| 917 | /* | ||
| 918 | * We usually start by grabbing the first 9-bytes descriptor so we know | ||
| 919 | * how long the whole configuration is. Some devices with quirky | ||
| 920 | * firmware will fail enumeration, so if the quirk is set, use 255 instead, | ||
| 921 | * mirroring the behavior of Windows. | ||
| 922 | */ | ||
| 923 | if (dev->quirks & USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE) | ||
| 924 | usb_config_req_size = 255; | ||
| 925 | else | ||
| 926 | usb_config_req_size = USB_DT_CONFIG_SIZE; | ||
| 915 | 927 | ||
| 916 | if (ncfg > USB_MAXCONFIG) { | 928 | if (ncfg > USB_MAXCONFIG) { |
| 917 | dev_notice(ddev, "too many configurations: %d, " | 929 | dev_notice(ddev, "too many configurations: %d, " |
| @@ -938,15 +950,13 @@ int usb_get_configuration(struct usb_device *dev) · 20 unmodified lines | |||
| 938 | if (!dev->rawdescriptors) | 950 | if (!dev->rawdescriptors) |
| 939 | return -ENOMEM; | 951 | return -ENOMEM; |
| 940 | 952 | ||
| 941 | desc = kmalloc(USB_DT_CONFIG_SIZE, GFP_KERNEL); | 953 | desc = kmalloc(usb_config_req_size, GFP_KERNEL); |
| 942 | if (!desc) | 954 | if (!desc) |
| 943 | return -ENOMEM; | 955 | return -ENOMEM; |
| 944 | 956 | ||
| 945 | for (cfgno = 0; cfgno < ncfg; cfgno++) { | 957 | for (cfgno = 0; cfgno < ncfg; cfgno++) { |
| 946 | /* We grab just the first descriptor so we know how long | ||
| 947 | * the whole configuration is */ | ||
| 948 | result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, | 958 | result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, |
| 949 | desc, USB_DT_CONFIG_SIZE); | 959 | desc, usb_config_req_size); |
| 950 | if (result < 0) { | 960 | if (result < 0) { |
| 951 | dev_err(ddev, "unable to read config index %d " | 961 | dev_err(ddev, "unable to read config index %d " |
| 952 | "descriptor/%s: %d\n", cfgno, "start", result); | 962 | "descriptor/%s: %d\n", cfgno, "start", result); |
| @@ -956,16 +966,14 @@ int usb_get_configuration(struct usb_device *dev) · 3 unmodified lines | |||
| 956 | dev->descriptor.bNumConfigurations = cfgno; | 966 | dev->descriptor.bNumConfigurations = cfgno; |
| 957 | break; | 967 | break; |
| 958 | } else if (result < 4) { | 968 | } else if (result < 4) { |
| 959 | dev_err(ddev, "config index %d descriptor too short " | 969 | dev_err(ddev, "config index %d descriptor too short (asked for %zu, got %i)\n", |
| 960 | "(expected %i, got %i)\n", cfgno, | 970 | cfgno, usb_config_req_size, result); |
| 961 | USB_DT_CONFIG_SIZE, result); | ||
| 962 | result = -EINVAL; | 971 | result = -EINVAL; |
| 963 | goto err; | 972 | goto err; |
| 964 | } | 973 | } |
| 965 | length = max_t(int, le16_to_cpu(desc->wTotalLength), | 974 | length = max_t(int, le16_to_cpu(desc->wTotalLength), |
| 966 | USB_DT_CONFIG_SIZE); | 975 | USB_DT_CONFIG_SIZE); |
| 967 | 976 | ||
| 968 | /* Now that we know the length, get the whole thing */ | ||
| 969 | bigbuffer = kmalloc(length, GFP_KERNEL); | 977 | bigbuffer = kmalloc(length, GFP_KERNEL); |
| 970 | if (!bigbuffer) { | 978 | if (!bigbuffer) { |
| 971 | result = -ENOMEM; | 979 | result = -ENOMEM; |
| @@ -975,6 +983,13 @@ int usb_get_configuration(struct usb_device *dev) · 3 unmodified lines | |||
| 975 | if (dev->quirks & USB_QUIRK_DELAY_INIT) | 983 | if (dev->quirks & USB_QUIRK_DELAY_INIT) |
| 976 | msleep(200); | 984 | msleep(200); |
| 977 | 985 | ||
| 986 | /* Skip the second read if we already got everything */ | ||
| 987 | if (result >= length) { | ||
| 988 | memcpy(bigbuffer, desc, length); | ||
| 989 | goto store_and_parse; | ||
| 990 | } | ||
| 991 | |||
| 992 | /* Get the whole thing */ | ||
| 978 | result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, | 993 | result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, |
| 979 | bigbuffer, length); | 994 | bigbuffer, length); |
| 980 | if (result < 0) { | 995 | if (result < 0) { |
| @@ -989,6 +1004,7 @@ int usb_get_configuration(struct usb_device *dev) · 8 unmodified lines | |||
| 989 | length = result; | 1004 | length = result; |
| 990 | } | 1005 | } |
| 991 | 1006 | ||
| 1007 | store_and_parse: | ||
| 992 | dev->rawdescriptors[cfgno] = bigbuffer; | 1008 | dev->rawdescriptors[cfgno] = bigbuffer; |
| 993 | 1009 | ||
| 994 | result = usb_parse_configuration(dev, cfgno, | 1010 | result = usb_parse_configuration(dev, cfgno, |
| @@ -2401,7 +2401,7 @@ static void show_string(struct usb_device *udev, char *id, char *string) · 2400 unmodified lines | |||
| 2401 | dev_info(&udev->dev, "%s: %s\n", id, string); | 2401 | dev_info(&udev->dev, "%s: %s\n", id, string); |
| 2402 | } | 2402 | } |
| 2403 | 2403 | ||
| 2404 | static void announce_device(struct usb_device *udev) | 2404 | static void announce_device_ids(struct usb_device *udev) |
| 2405 | { | 2405 | { |
| 2406 | u16 bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice); | 2406 | u16 bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice); |
| 2407 | 2407 | ||
| @@ -2410,6 +2410,10 @@ static void announce_device(struct usb_device *udev) · 2 unmodified lines | |||
| 2410 | le16_to_cpu(udev->descriptor.idVendor), | 2410 | le16_to_cpu(udev->descriptor.idVendor), |
| 2411 | le16_to_cpu(udev->descriptor.idProduct), | 2411 | le16_to_cpu(udev->descriptor.idProduct), |
| 2412 | bcdDevice >> 8, bcdDevice & 0xff); | 2412 | bcdDevice >> 8, bcdDevice & 0xff); |
| 2413 | } | ||
| 2414 | |||
| 2415 | static void announce_device_strings(struct usb_device *udev) | ||
| 2416 | { | ||
| 2413 | dev_info(&udev->dev, | 2417 | dev_info(&udev->dev, |
| 2414 | "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", | 2418 | "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n", |
| 2415 | udev->descriptor.iManufacturer, | 2419 | udev->descriptor.iManufacturer, |
| @@ -2420,7 +2424,8 @@ static void announce_device(struct usb_device *udev) · 4 unmodified lines | |||
| 2420 | show_string(udev, "SerialNumber", udev->serial); | 2424 | show_string(udev, "SerialNumber", udev->serial); |
| 2421 | } | 2425 | } |
| 2422 | #else | 2426 | #else |
| 2423 | static inline void announce_device(struct usb_device *udev) { } | 2427 | static inline void announce_device_ids(struct usb_device *udev) { } |
| 2428 | static inline void announce_device_strings(struct usb_device *udev) { } | ||
| 2424 | #endif | 2429 | #endif |
| 2425 | 2430 | ||
| 2426 | 2431 | ||
| @@ -2651,6 +2656,9 @@ int usb_new_device(struct usb_device *udev) · 224 unmodified lines | |||
| 2651 | device_init_wakeup(&udev->dev, 0); | 2656 | device_init_wakeup(&udev->dev, 0); |
| 2652 | } | 2657 | } |
| 2653 | 2658 | ||
| 2659 | /* Announce the device identity */ | ||
| 2660 | announce_device_ids(udev); | ||
| 2661 | |||
| 2654 | /* Tell the runtime-PM framework the device is active */ | 2662 | /* Tell the runtime-PM framework the device is active */ |
| 2655 | pm_runtime_set_active(&udev->dev); | 2663 | pm_runtime_set_active(&udev->dev); |
| 2656 | pm_runtime_get_noresume(&udev->dev); | 2664 | pm_runtime_get_noresume(&udev->dev); |
| @@ -2672,8 +2680,8 @@ int usb_new_device(struct usb_device *udev) · 15 unmodified lines | |||
| 2672 | udev->dev.devt = MKDEV(USB_DEVICE_MAJOR, | 2680 | udev->dev.devt = MKDEV(USB_DEVICE_MAJOR, |
| 2673 | (((udev->bus->busnum-1) * 128) + (udev->devnum-1))); | 2681 | (((udev->bus->busnum-1) * 128) + (udev->devnum-1))); |
| 2674 | 2682 | ||
| 2675 | /* Tell the world! */ | 2683 | /* Announce the device's product, manufacturer and serial number */ |
| 2676 | announce_device(udev); | 2684 | announce_device_strings(udev); |
| 2677 | 2685 | ||
| 2678 | if (udev->serial) | 2686 | if (udev->serial) |
| 2679 | add_device_randomness(udev->serial, strlen(udev->serial)); | 2687 | add_device_randomness(udev->serial, strlen(udev->serial)); |
| @@ -142,6 +142,10 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp) · 141 unmodified lines | |||
| 142 | break; | 142 | break; |
| 143 | case 'q': | 143 | case 'q': |
| 144 | flags |= USB_QUIRK_FORCE_ONE_CONFIG; | 144 | flags |= USB_QUIRK_FORCE_ONE_CONFIG; |
| 145 | break; | ||
| 146 | case 'r': | ||
| 147 | flags |= USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE; | ||
| 148 | break; | ||
| 145 | /* Ignore unrecognized flag characters */ | 149 | /* Ignore unrecognized flag characters */ |
| 146 | } | 150 | } |
| 147 | } | 151 | } |
| @@ -589,6 +593,9 @@ static const struct usb_device_id usb_quirk_list[] = { · 441 unmodified lines | |||
| 589 | 593 | ||
| 590 | { USB_DEVICE(0x2386, 0x350e), .driver_info = USB_QUIRK_NO_LPM }, | 594 | { USB_DEVICE(0x2386, 0x350e), .driver_info = USB_QUIRK_NO_LPM }, |
| 591 | 595 | ||
| 596 | /* ShanWan Wireless Gamepad */ | ||
| 597 | { USB_DEVICE(0x2563, 0x0575), .driver_info = USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE }, | ||
| 598 | |||
| 592 | /* UGREEN 35871 - BOS descriptor fetch hangs at SuperSpeed Plus */ | 599 | /* UGREEN 35871 - BOS descriptor fetch hangs at SuperSpeed Plus */ |
| 593 | { USB_DEVICE(0x2b89, 0x5871), .driver_info = USB_QUIRK_NO_BOS }, | 600 | { USB_DEVICE(0x2b89, 0x5871), .driver_info = USB_QUIRK_NO_BOS }, |
| 594 | 601 | ||
| @@ -1171,7 +1171,7 @@ static int ncm_unwrap_ntb(struct gether *port, · 1170 unmodified lines | |||
| 1171 | unsigned char *ntb_ptr = skb->data; | 1171 | unsigned char *ntb_ptr = skb->data; |
| 1172 | __le16 *tmp; | 1172 | __le16 *tmp; |
| 1173 | unsigned index, index2; | 1173 | unsigned index, index2; |
| 1174 | int ndp_index; | 1174 | unsigned int ndp_index; |
| 1175 | unsigned dg_len, dg_len2; | 1175 | unsigned dg_len, dg_len2; |
| 1176 | unsigned ndp_len; | 1176 | unsigned ndp_len; |
| 1177 | unsigned block_len; | 1177 | unsigned block_len; |
| @@ -190,13 +190,13 @@ struct xhci_op_regs { · 189 unmodified lines | |||
| 190 | 190 | ||
| 191 | /* CRCR - Command Ring Control Register - cmd_ring bitmasks */ | 191 | /* CRCR - Command Ring Control Register - cmd_ring bitmasks */ |
| 192 | /* bit 0 - Cycle bit indicates the ownership of the command ring */ | 192 | /* bit 0 - Cycle bit indicates the ownership of the command ring */ |
| 193 | #define CMD_RING_CYCLE BIT(0) | 193 | #define CMD_RING_CYCLE BIT_ULL(0) |
| 194 | /* stop ring operation after completion of the currently executing command */ | 194 | /* stop ring operation after completion of the currently executing command */ |
| 195 | #define CMD_RING_PAUSE BIT(1) | 195 | #define CMD_RING_PAUSE BIT_ULL(1) |
| 196 | /* stop ring immediately - abort the currently executing command */ | 196 | /* stop ring immediately - abort the currently executing command */ |
| 197 | #define CMD_RING_ABORT BIT(2) | 197 | #define CMD_RING_ABORT BIT_ULL(2) |
| 198 | /* true: command ring is running */ | 198 | /* true: command ring is running */ |
| 199 | #define CMD_RING_RUNNING BIT(3) | 199 | #define CMD_RING_RUNNING BIT_ULL(3) |
| 200 | /* bits 63:6 - Command Ring pointer */ | 200 | /* bits 63:6 - Command Ring pointer */ |
| 201 | #define CMD_RING_PTR_MASK GENMASK_ULL(63, 6) | 201 | #define CMD_RING_PTR_MASK GENMASK_ULL(63, 6) |
| 202 | 202 | ||
| @@ -271,7 +271,7 @@ struct xhci_intr_reg { · 68 unmodified lines | |||
| 271 | * bit 3 - Event Handler Busy (EHB), whether the event ring is scheduled to be serviced by | 271 | * bit 3 - Event Handler Busy (EHB), whether the event ring is scheduled to be serviced by |
| 272 | * a work queue (or delayed service routine)? | 272 | * a work queue (or delayed service routine)? |
| 273 | */ | 273 | */ |
| 274 | #define ERST_EHB BIT(3) | 274 | #define ERST_EHB BIT_ULL(3) |
| 275 | /* bits 63:4 - Event Ring Dequeue Pointer */ | 275 | /* bits 63:4 - Event Ring Dequeue Pointer */ |
| 276 | #define ERST_PTR_MASK GENMASK_ULL(63, 4) | 276 | #define ERST_PTR_MASK GENMASK_ULL(63, 4) |
| 277 | 277 | ||
| @@ -502,7 +502,7 @@ struct xhci_ep_ctx { · 224 unmodified lines | |||
| 502 | #define CTX_TO_MAX_ESIT_PAYLOAD(p) (((p) >> 16) & 0xffff) | 502 | #define CTX_TO_MAX_ESIT_PAYLOAD(p) (((p) >> 16) & 0xffff) |
| 503 | 503 | ||
| 504 | /* deq bitmasks */ | 504 | /* deq bitmasks */ |
| 505 | #define EP_CTX_CYCLE_MASK BIT(0) | 505 | #define EP_CTX_CYCLE_MASK BIT_ULL(0) |
| 506 | /* bits 63:4 - TR Dequeue Pointer */ | 506 | /* bits 63:4 - TR Dequeue Pointer */ |
| 507 | #define TR_DEQ_PTR_MASK GENMASK_ULL(63, 4) | 507 | #define TR_DEQ_PTR_MASK GENMASK_ULL(63, 4) |
| 508 | 508 | ||
| @@ -265,7 +265,7 @@ int usbio_bulk_msg(struct auxiliary_device *adev, u8 type, u8 cmd, bool last, · 264 unmodified lines | |||
| 265 | lockdep_assert_held(&usbio->bulk_mutex); | 265 | lockdep_assert_held(&usbio->bulk_mutex); |
| 266 | 266 | ||
| 267 | if ((obuf_len > (usbio->txbuf_len - sizeof(*bpkt))) || | 267 | if ((obuf_len > (usbio->txbuf_len - sizeof(*bpkt))) || |
| 268 | (ibuf_len > (usbio->txbuf_len - sizeof(*bpkt)))) | 268 | (ibuf_len > (usbio->rxbuf_len - sizeof(*bpkt)))) |
| 269 | return -EMSGSIZE; | 269 | return -EMSGSIZE; |
| 270 | 270 | ||
| 271 | if (ibuf_len) | 271 | if (ibuf_len) |
| @@ -81,4 +81,7 @@ · 80 unmodified lines | |||
| 81 | /* Device claims zero configurations, forcing to 1 */ | 81 | /* Device claims zero configurations, forcing to 1 */ |
| 82 | #define USB_QUIRK_FORCE_ONE_CONFIG BIT(18) | 82 | #define USB_QUIRK_FORCE_ONE_CONFIG BIT(18) |
| 83 | 83 | ||
| 84 | /* Use a 255 bytes config descriptor request mirroring windows behavior */ | ||
| 85 | #define USB_QUIRK_WINDOWS_CONFIG_REQ_SIZE BIT(19) | ||
| 86 | |||
| 84 | #endif /* __LINUX_USB_QUIRKS_H */ | 87 | #endif /* __LINUX_USB_QUIRKS_H */ |