Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB/Thunderbolt fixes from Greg KH:
"Here are some small USB and one Thunderbolt driver fixes.

Nothing major at all, just some fixes for reported issues, and a quirk
addition:

- typec fixes

- UAS disconnect fix

- usblp race fix

- ehci-hcd modversions build fix

- ignore wakeup quirk table addition

- thunderbolt DROM read fix

All of these have been in linux-next with no reported issues"

* tag 'usb-5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
usblp: fix race between disconnect() and read()
ehci-hcd: Move include to keep CRC stable
usb: typec: intel_pmc_mux: Handle SCU IPC error conditions
USB: quirks: Add USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk for BYD zhaoxin notebook
USB: UAS: fix disconnect by unplugging a hub
usb: typec: ucsi: Prevent mode overrun
usb: typec: ucsi: acpi: Increase command completion timeout value
thunderbolt: Retry DROM read once if parsing fails

+64 -17
+16 -4
drivers/thunderbolt/eeprom.c
··· 7 7 */ 8 8 9 9 #include <linux/crc32.h> 10 + #include <linux/delay.h> 10 11 #include <linux/property.h> 11 12 #include <linux/slab.h> 12 13 #include "tb.h" ··· 390 389 struct tb_drom_entry_header *entry = (void *) (sw->drom + pos); 391 390 if (pos + 1 == drom_size || pos + entry->len > drom_size 392 391 || !entry->len) { 393 - tb_sw_warn(sw, "drom buffer overrun, aborting\n"); 394 - return -EIO; 392 + tb_sw_warn(sw, "DROM buffer overrun\n"); 393 + return -EILSEQ; 395 394 } 396 395 397 396 switch (entry->type) { ··· 527 526 u16 size; 528 527 u32 crc; 529 528 struct tb_drom_header *header; 530 - int res; 529 + int res, retries = 1; 530 + 531 531 if (sw->drom) 532 532 return 0; 533 533 ··· 614 612 tb_sw_warn(sw, "drom device_rom_revision %#x unknown\n", 615 613 header->device_rom_revision); 616 614 617 - return tb_drom_parse_entries(sw); 615 + res = tb_drom_parse_entries(sw); 616 + /* If the DROM parsing fails, wait a moment and retry once */ 617 + if (res == -EILSEQ && retries--) { 618 + tb_sw_warn(sw, "parsing DROM failed, retrying\n"); 619 + msleep(100); 620 + res = tb_drom_read_n(sw, 0, sw->drom, size); 621 + if (!res) 622 + goto parse; 623 + } 624 + 625 + return res; 618 626 err: 619 627 kfree(sw->drom); 620 628 sw->drom = NULL;
+5
drivers/usb/class/usblp.c
··· 827 827 if (rv < 0) 828 828 return rv; 829 829 830 + if (!usblp->present) { 831 + count = -ENODEV; 832 + goto done; 833 + } 834 + 830 835 if ((avail = usblp->rstatus) < 0) { 831 836 printk(KERN_ERR "usblp%d: error %d reading from printer\n", 832 837 usblp->minor, (int)avail);
+4
drivers/usb/core/quirks.c
··· 397 397 /* Generic RTL8153 based ethernet adapters */ 398 398 { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM }, 399 399 400 + /* SONiX USB DEVICE Touchpad */ 401 + { USB_DEVICE(0x0c45, 0x7056), .driver_info = 402 + USB_QUIRK_IGNORE_REMOTE_WAKEUP }, 403 + 400 404 /* Action Semiconductor flash disk */ 401 405 { USB_DEVICE(0x10d6, 0x2200), .driver_info = 402 406 USB_QUIRK_STRING_FETCH_255 },
+1
drivers/usb/host/ehci-hcd.c
··· 22 22 #include <linux/interrupt.h> 23 23 #include <linux/usb.h> 24 24 #include <linux/usb/hcd.h> 25 + #include <linux/usb/otg.h> 25 26 #include <linux/moduleparam.h> 26 27 #include <linux/dma-mapping.h> 27 28 #include <linux/debugfs.h>
-1
drivers/usb/host/ehci-hub.c
··· 14 14 */ 15 15 16 16 /*-------------------------------------------------------------------------*/ 17 - #include <linux/usb/otg.h> 18 17 19 18 #define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E) 20 19
+12 -2
drivers/usb/storage/uas.c
··· 662 662 if (devinfo->resetting) { 663 663 cmnd->result = DID_ERROR << 16; 664 664 cmnd->scsi_done(cmnd); 665 - spin_unlock_irqrestore(&devinfo->lock, flags); 666 - return 0; 665 + goto zombie; 667 666 } 668 667 669 668 /* Find a free uas-tag */ ··· 698 699 cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB); 699 700 700 701 err = uas_submit_urbs(cmnd, devinfo); 702 + /* 703 + * in case of fatal errors the SCSI layer is peculiar 704 + * a command that has finished is a success for the purpose 705 + * of queueing, no matter how fatal the error 706 + */ 707 + if (err == -ENODEV) { 708 + cmnd->result = DID_ERROR << 16; 709 + cmnd->scsi_done(cmnd); 710 + goto zombie; 711 + } 701 712 if (err) { 702 713 /* If we did nothing, give up now */ 703 714 if (cmdinfo->state & SUBMIT_STATUS_URB) { ··· 718 709 } 719 710 720 711 devinfo->cmnd[idx] = cmnd; 712 + zombie: 721 713 spin_unlock_irqrestore(&devinfo->lock, flags); 722 714 return 0; 723 715 }
+9 -3
drivers/usb/typec/mux/intel_pmc_mux.c
··· 125 125 static int pmc_usb_command(struct pmc_usb_port *port, u8 *msg, u32 len) 126 126 { 127 127 u8 response[4]; 128 + int ret; 128 129 129 130 /* 130 131 * Error bit will always be 0 with the USBC command. 131 - * Status can be checked from the response message. 132 + * Status can be checked from the response message if the 133 + * function intel_scu_ipc_dev_command succeeds. 132 134 */ 133 - intel_scu_ipc_dev_command(port->pmc->ipc, PMC_USBC_CMD, 0, msg, len, 134 - response, sizeof(response)); 135 + ret = intel_scu_ipc_dev_command(port->pmc->ipc, PMC_USBC_CMD, 0, msg, 136 + len, response, sizeof(response)); 137 + 138 + if (ret) 139 + return ret; 140 + 135 141 if (response[2] & PMC_USB_RESP_STATUS_FAILURE) { 136 142 if (response[2] & PMC_USB_RESP_STATUS_FATAL) 137 143 return -EIO;
+16 -6
drivers/usb/typec/ucsi/ucsi.c
··· 216 216 con->partner_altmode[i] == altmode); 217 217 } 218 218 219 - static u8 ucsi_altmode_next_mode(struct typec_altmode **alt, u16 svid) 219 + static int ucsi_altmode_next_mode(struct typec_altmode **alt, u16 svid) 220 220 { 221 221 u8 mode = 1; 222 222 int i; 223 223 224 - for (i = 0; alt[i]; i++) 224 + for (i = 0; alt[i]; i++) { 225 + if (i > MODE_DISCOVERY_MAX) 226 + return -ERANGE; 227 + 225 228 if (alt[i]->svid == svid) 226 229 mode++; 230 + } 227 231 228 232 return mode; 229 233 } ··· 262 258 goto err; 263 259 } 264 260 265 - desc->mode = ucsi_altmode_next_mode(con->port_altmode, 266 - desc->svid); 261 + ret = ucsi_altmode_next_mode(con->port_altmode, desc->svid); 262 + if (ret < 0) 263 + return ret; 264 + 265 + desc->mode = ret; 267 266 268 267 switch (desc->svid) { 269 268 case USB_TYPEC_DP_SID: ··· 299 292 goto err; 300 293 } 301 294 302 - desc->mode = ucsi_altmode_next_mode(con->partner_altmode, 303 - desc->svid); 295 + ret = ucsi_altmode_next_mode(con->partner_altmode, desc->svid); 296 + if (ret < 0) 297 + return ret; 298 + 299 + desc->mode = ret; 304 300 305 301 alt = typec_partner_register_altmode(con->partner, desc); 306 302 if (IS_ERR(alt)) {
+1 -1
drivers/usb/typec/ucsi/ucsi_acpi.c
··· 78 78 if (ret) 79 79 goto out_clear_bit; 80 80 81 - if (!wait_for_completion_timeout(&ua->complete, msecs_to_jiffies(5000))) 81 + if (!wait_for_completion_timeout(&ua->complete, 60 * HZ)) 82 82 ret = -ETIMEDOUT; 83 83 84 84 out_clear_bit: