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-6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are some small USB fixes for some reported problems for 6.12-rc3.
Include in here is:

- fix for yurex driver that was caused in -rc1

- build error fix for usbg network filesystem code

- onboard_usb_dev build fix

- dwc3 driver fixes for reported errors

- gadget driver fix

- new USB storage driver quirk

- xhci resume bugfix

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

* tag 'usb-6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
net/9p/usbg: Fix build error
USB: yurex: kill needless initialization in yurex_read
Revert "usb: yurex: Replace snprintf() with the safer scnprintf() variant"
usb: xhci: Fix problem with xhci resume from suspend
usb: misc: onboard_usb_dev: introduce new config symbol for usb5744 SMBus support
usb: dwc3: core: Stop processing of pending events if controller is halted
usb: dwc3: re-enable runtime PM after failed resume
usb: storage: ignore bogus device raised by JieLi BR21 USB sound chip
usb: gadget: core: force synchronous registration

+66 -37
+22 -8
drivers/usb/dwc3/core.c
··· 544 544 int dwc3_event_buffers_setup(struct dwc3 *dwc) 545 545 { 546 546 struct dwc3_event_buffer *evt; 547 + u32 reg; 547 548 548 549 if (!dwc->ev_buf) 549 550 return 0; ··· 557 556 upper_32_bits(evt->dma)); 558 557 dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0), 559 558 DWC3_GEVNTSIZ_SIZE(evt->length)); 560 - dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 0); 561 559 560 + /* Clear any stale event */ 561 + reg = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0)); 562 + dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), reg); 562 563 return 0; 563 564 } 564 565 ··· 587 584 dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(0), 0); 588 585 dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0), DWC3_GEVNTSIZ_INTMASK 589 586 | DWC3_GEVNTSIZ_SIZE(0)); 590 - dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), 0); 587 + 588 + /* Clear any stale event */ 589 + reg = dwc3_readl(dwc->regs, DWC3_GEVNTCOUNT(0)); 590 + dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), reg); 591 591 } 592 592 593 593 static void dwc3_core_num_eps(struct dwc3 *dwc) ··· 2505 2499 2506 2500 switch (dwc->current_dr_role) { 2507 2501 case DWC3_GCTL_PRTCAP_DEVICE: 2508 - dwc3_gadget_process_pending_events(dwc); 2502 + if (dwc->pending_events) { 2503 + pm_runtime_put(dwc->dev); 2504 + dwc->pending_events = false; 2505 + enable_irq(dwc->irq_gadget); 2506 + } 2509 2507 break; 2510 2508 case DWC3_GCTL_PRTCAP_HOST: 2511 2509 default: ··· 2562 2552 static int dwc3_resume(struct device *dev) 2563 2553 { 2564 2554 struct dwc3 *dwc = dev_get_drvdata(dev); 2565 - int ret; 2555 + int ret = 0; 2566 2556 2567 2557 pinctrl_pm_select_default_state(dev); 2568 2558 ··· 2570 2560 pm_runtime_set_active(dev); 2571 2561 2572 2562 ret = dwc3_resume_common(dwc, PMSG_RESUME); 2573 - if (ret) { 2563 + if (ret) 2574 2564 pm_runtime_set_suspended(dev); 2575 - return ret; 2576 - } 2577 2565 2578 2566 pm_runtime_enable(dev); 2579 2567 2580 - return 0; 2568 + return ret; 2581 2569 } 2582 2570 2583 2571 static void dwc3_complete(struct device *dev) ··· 2597 2589 static const struct dev_pm_ops dwc3_dev_pm_ops = { 2598 2590 SET_SYSTEM_SLEEP_PM_OPS(dwc3_suspend, dwc3_resume) 2599 2591 .complete = dwc3_complete, 2592 + 2593 + /* 2594 + * Runtime suspend halts the controller on disconnection. It relies on 2595 + * platforms with custom connection notification to start the controller 2596 + * again. 2597 + */ 2600 2598 SET_RUNTIME_PM_OPS(dwc3_runtime_suspend, dwc3_runtime_resume, 2601 2599 dwc3_runtime_idle) 2602 2600 };
-4
drivers/usb/dwc3/core.h
··· 1675 1675 #if !IS_ENABLED(CONFIG_USB_DWC3_HOST) 1676 1676 int dwc3_gadget_suspend(struct dwc3 *dwc); 1677 1677 int dwc3_gadget_resume(struct dwc3 *dwc); 1678 - void dwc3_gadget_process_pending_events(struct dwc3 *dwc); 1679 1678 #else 1680 1679 static inline int dwc3_gadget_suspend(struct dwc3 *dwc) 1681 1680 { ··· 1686 1687 return 0; 1687 1688 } 1688 1689 1689 - static inline void dwc3_gadget_process_pending_events(struct dwc3 *dwc) 1690 - { 1691 - } 1692 1690 #endif /* !IS_ENABLED(CONFIG_USB_DWC3_HOST) */ 1693 1691 1694 1692 #if IS_ENABLED(CONFIG_USB_DWC3_ULPI)
-11
drivers/usb/dwc3/gadget.c
··· 4728 4728 4729 4729 return dwc3_gadget_soft_connect(dwc); 4730 4730 } 4731 - 4732 - void dwc3_gadget_process_pending_events(struct dwc3 *dwc) 4733 - { 4734 - if (dwc->pending_events) { 4735 - dwc3_interrupt(dwc->irq_gadget, dwc->ev_buf); 4736 - dwc3_thread_interrupt(dwc->irq_gadget, dwc->ev_buf); 4737 - pm_runtime_put(dwc->dev); 4738 - dwc->pending_events = false; 4739 - enable_irq(dwc->irq_gadget); 4740 - } 4741 - }
+1
drivers/usb/gadget/udc/core.c
··· 1696 1696 driver->driver.bus = &gadget_bus_type; 1697 1697 driver->driver.owner = owner; 1698 1698 driver->driver.mod_name = mod_name; 1699 + driver->driver.probe_type = PROBE_FORCE_SYNCHRONOUS; 1699 1700 ret = driver_register(&driver->driver); 1700 1701 if (ret) { 1701 1702 pr_warn("%s: driver registration failed: %d\n",
+5
drivers/usb/host/xhci-pci.c
··· 79 79 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142 80 80 #define PCI_DEVICE_ID_ASMEDIA_1142_XHCI 0x1242 81 81 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142 82 + #define PCI_DEVICE_ID_ASMEDIA_3042_XHCI 0x3042 82 83 #define PCI_DEVICE_ID_ASMEDIA_3242_XHCI 0x3242 83 84 84 85 #define PCI_DEVICE_ID_CADENCE 0x17CD ··· 451 450 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && 452 451 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI) 453 452 xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL; 453 + 454 + if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && 455 + pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI) 456 + xhci->quirks |= XHCI_RESET_ON_RESUME; 454 457 455 458 if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) 456 459 xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
+12
drivers/usb/misc/Kconfig
··· 331 331 this config will enable the driver and it will automatically 332 332 match the state of the USB subsystem. If this driver is a 333 333 module it will be called onboard_usb_dev. 334 + 335 + config USB_ONBOARD_DEV_USB5744 336 + bool "Onboard USB Microchip usb5744 hub with SMBus support" 337 + depends on (USB_ONBOARD_DEV && I2C=y) || (USB_ONBOARD_DEV=m && I2C=m) 338 + help 339 + Say Y here if you want to support onboard USB Microchip usb5744 340 + hub that requires SMBus initialization. 341 + 342 + This options enables usb5744 i2c default initialization sequence 343 + during hub start-up configuration stage. It is must to enable this 344 + option on AMD Kria KR260 Robotics Starter Kit as this hub is 345 + connected to USB-SD converter which mounts the root filesystem.
+4 -2
drivers/usb/misc/onboard_usb_dev.c
··· 311 311 312 312 static int onboard_dev_5744_i2c_init(struct i2c_client *client) 313 313 { 314 - #if IS_ENABLED(CONFIG_I2C) 314 + #if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744) 315 315 struct device *dev = &client->dev; 316 316 int ret; 317 317 ··· 394 394 395 395 i2c_node = of_parse_phandle(pdev->dev.of_node, "i2c-bus", 0); 396 396 if (i2c_node) { 397 - struct i2c_client *client; 397 + struct i2c_client *client = NULL; 398 398 399 + #if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744) 399 400 client = of_find_i2c_device_by_node(i2c_node); 401 + #endif 400 402 of_node_put(i2c_node); 401 403 402 404 if (!client) {
+9 -12
drivers/usb/misc/yurex.c
··· 34 34 #define YUREX_BUF_SIZE 8 35 35 #define YUREX_WRITE_TIMEOUT (HZ*2) 36 36 37 - #define MAX_S64_STRLEN 20 /* {-}922337203685477580{7,8} */ 38 - 39 37 /* table of devices that work with this driver */ 40 38 static struct usb_device_id yurex_table[] = { 41 39 { USB_DEVICE(YUREX_VENDOR_ID, YUREX_PRODUCT_ID) }, ··· 400 402 loff_t *ppos) 401 403 { 402 404 struct usb_yurex *dev; 403 - int len = 0; 404 - char in_buffer[MAX_S64_STRLEN]; 405 + int len; 406 + char in_buffer[20]; 407 + unsigned long flags; 405 408 406 409 dev = file->private_data; 407 410 ··· 412 413 return -ENODEV; 413 414 } 414 415 415 - if (WARN_ON_ONCE(dev->bbu > S64_MAX || dev->bbu < S64_MIN)) { 416 - mutex_unlock(&dev->io_mutex); 417 - return -EIO; 418 - } 419 - 420 - spin_lock_irq(&dev->lock); 421 - scnprintf(in_buffer, MAX_S64_STRLEN, "%lld\n", dev->bbu); 422 - spin_unlock_irq(&dev->lock); 416 + spin_lock_irqsave(&dev->lock, flags); 417 + len = snprintf(in_buffer, 20, "%lld\n", dev->bbu); 418 + spin_unlock_irqrestore(&dev->lock, flags); 423 419 mutex_unlock(&dev->io_mutex); 420 + 421 + if (WARN_ON_ONCE(len >= sizeof(in_buffer))) 422 + return -EIO; 424 423 425 424 return simple_read_from_buffer(buffer, count, ppos, in_buffer, len); 426 425 }
+11
drivers/usb/storage/unusual_devs.h
··· 2423 2423 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 2424 2424 US_FL_NOT_LOCKABLE), 2425 2425 2426 + /* 2427 + * Reported by Icenowy Zheng <uwu@icenowy.me> 2428 + * This is an interface for vendor-specific cryptic commands instead 2429 + * of real USB storage device. 2430 + */ 2431 + UNUSUAL_DEV( 0xe5b7, 0x0811, 0x0100, 0x0100, 2432 + "ZhuHai JieLi Technology", 2433 + "JieLi BR21", 2434 + USB_SC_DEVICE, USB_PR_DEVICE, NULL, 2435 + US_FL_IGNORE_DEVICE), 2436 + 2426 2437 /* Reported by Andrew Simmons <andrew.simmons@gmail.com> */ 2427 2438 UNUSUAL_DEV( 0xed06, 0x4500, 0x0001, 0x0001, 2428 2439 "DataStor",
+2
net/9p/Kconfig
··· 43 43 config NET_9P_USBG 44 44 bool "9P USB Gadget Transport" 45 45 depends on USB_GADGET=y || USB_GADGET=NET_9P 46 + select CONFIGFS_FS 47 + select USB_LIBCOMPOSITE 46 48 help 47 49 This builds support for a transport for 9pfs over 48 50 usb gadget.