Commit 8004d083 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB fixes from Greg KH:
 "Here are some small USB driver fixes for 6.17-rc3 to resolve a bunch
  of reported issues. Included in here are:

   - typec driver fixes

   - dwc3 new device id

   - dwc3 driver fixes

   - new usb-storage driver quirks

   - xhci driver fixes

   - other tiny USB driver fixes to resolve bugs

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

* tag 'usb-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: xhci: fix host not responding after suspend and resume
  usb: xhci: Fix slot_id resource race conflict
  usb: typec: fusb302: Revert incorrect threaded irq fix
  USB: core: Update kerneldoc for usb_hcd_giveback_urb()
  usb: typec: maxim_contaminant: re-enable cc toggle if cc is open and port is clean
  usb: typec: maxim_contaminant: disable low power mode when reading comparator values
  usb: dwc3: Remove WARN_ON for device endpoint command timeouts
  USB: storage: Ignore driver CD mode for Realtek multi-mode Wi-Fi dongles
  usb: storage: realtek_cr: Use correct byte order for bcs->Residue
  usb: chipidea: imx: improve usbmisc_imx7d_pullup()
  kcov, usb: Don't disable interrupts in kcov_remote_start_usb_softirq()
  usb: dwc3: pci: add support for the Intel Wildcat Lake
  usb: dwc3: Ignore late xferNotReady event to prevent halt timeout
  USB: storage: Add unusual-devs entry for Novatek NTK96550-based camera
  usb: core: hcd: fix accessing unmapped memory in SINGLE_STEP_SET_FEATURE test
  usb: renesas-xhci: Fix External ROM access timeouts
  usb: gadget: tegra-xudc: fix PM use count underflow
  usb: quirks: Add DELAY_INIT quick for another SanDisk 3.2Gen1 Flash Drive
parents e1d8f9cc ff9a09b3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -338,7 +338,8 @@ static int ci_hdrc_imx_notify_event(struct ci_hdrc *ci, unsigned int event)
			schedule_work(&ci->usb_phy->chg_work);
		break;
	case CI_HDRC_CONTROLLER_PULLUP_EVENT:
		if (ci->role == CI_ROLE_GADGET)
		if (ci->role == CI_ROLE_GADGET &&
		    ci->gadget.speed == USB_SPEED_HIGH)
			imx_usbmisc_pullup(data->usbmisc_data,
					   ci->gadget.connected);
		break;
+16 −7
Original line number Diff line number Diff line
@@ -1068,15 +1068,24 @@ static void usbmisc_imx7d_pullup(struct imx_usbmisc_data *data, bool on)
	unsigned long flags;
	u32 val;

	if (on)
		return;

	spin_lock_irqsave(&usbmisc->lock, flags);
	val = readl(usbmisc->base + MX7D_USBNC_USB_CTRL2);
	if (!on) {
	val &= ~MX7D_USBNC_USB_CTRL2_OPMODE_OVERRIDE_MASK;
	val |= MX7D_USBNC_USB_CTRL2_OPMODE(1);
	val |= MX7D_USBNC_USB_CTRL2_OPMODE_OVERRIDE_EN;
	} else {
	writel(val, usbmisc->base + MX7D_USBNC_USB_CTRL2);
	spin_unlock_irqrestore(&usbmisc->lock, flags);

	/* Last for at least 1 micro-frame to let host see disconnect signal */
	usleep_range(125, 150);

	spin_lock_irqsave(&usbmisc->lock, flags);
	val &= ~MX7D_USBNC_USB_CTRL2_OPMODE_OVERRIDE_MASK;
	val |= MX7D_USBNC_USB_CTRL2_OPMODE(0);
	val &= ~MX7D_USBNC_USB_CTRL2_OPMODE_OVERRIDE_EN;
	}
	writel(val, usbmisc->base + MX7D_USBNC_USB_CTRL2);
	spin_unlock_irqrestore(&usbmisc->lock, flags);
}
+16 −12
Original line number Diff line number Diff line
@@ -1636,7 +1636,6 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
	struct usb_hcd *hcd = bus_to_hcd(urb->dev->bus);
	struct usb_anchor *anchor = urb->anchor;
	int status = urb->unlinked;
	unsigned long flags;

	urb->hcpriv = NULL;
	if (unlikely((urb->transfer_flags & URB_SHORT_NOT_OK) &&
@@ -1654,14 +1653,13 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
	/* pass ownership to the completion handler */
	urb->status = status;
	/*
	 * Only collect coverage in the softirq context and disable interrupts
	 * to avoid scenarios with nested remote coverage collection sections
	 * that KCOV does not support.
	 * See the comment next to kcov_remote_start_usb_softirq() for details.
	 * This function can be called in task context inside another remote
	 * coverage collection section, but kcov doesn't support that kind of
	 * recursion yet. Only collect coverage in softirq context for now.
	 */
	flags = kcov_remote_start_usb_softirq((u64)urb->dev->bus->busnum);
	kcov_remote_start_usb_softirq((u64)urb->dev->bus->busnum);
	urb->complete(urb);
	kcov_remote_stop_softirq(flags);
	kcov_remote_stop_softirq();

	usb_anchor_resume_wakeups(anchor);
	atomic_dec(&urb->use_count);
@@ -1719,10 +1717,10 @@ static void usb_giveback_urb_bh(struct work_struct *work)
 * @urb: urb being returned to the USB device driver.
 * @status: completion status code for the URB.
 *
 * Context: atomic. The completion callback is invoked in caller's context.
 * For HCDs with HCD_BH flag set, the completion callback is invoked in BH
 * context (except for URBs submitted to the root hub which always complete in
 * caller's context).
 * Context: atomic. The completion callback is invoked either in a work queue
 * (BH) context or in the caller's context, depending on whether the HCD_BH
 * flag is set in the @hcd structure, except that URBs submitted to the
 * root hub always complete in BH context.
 *
 * This hands the URB from HCD to its USB device driver, using its
 * completion function.  The HCD has freed all per-urb resources
@@ -2166,7 +2164,7 @@ static struct urb *request_single_step_set_feature_urb(
	urb->complete = usb_ehset_completion;
	urb->status = -EINPROGRESS;
	urb->actual_length = 0;
	urb->transfer_flags = URB_DIR_IN;
	urb->transfer_flags = URB_DIR_IN | URB_NO_TRANSFER_DMA_MAP;
	usb_get_urb(urb);
	atomic_inc(&urb->use_count);
	atomic_inc(&urb->dev->urbnum);
@@ -2230,9 +2228,15 @@ int ehset_single_step_set_feature(struct usb_hcd *hcd, int port)

	/* Complete remaining DATA and STATUS stages using the same URB */
	urb->status = -EINPROGRESS;
	urb->transfer_flags &= ~URB_NO_TRANSFER_DMA_MAP;
	usb_get_urb(urb);
	atomic_inc(&urb->use_count);
	atomic_inc(&urb->dev->urbnum);
	if (map_urb_for_dma(hcd, urb, GFP_KERNEL)) {
		usb_put_urb(urb);
		goto out1;
	}

	retval = hcd->driver->submit_single_step_set_feature(hcd, urb, 0);
	if (!retval && !wait_for_completion_timeout(&done,
						msecs_to_jiffies(2000))) {
+1 −0
Original line number Diff line number Diff line
@@ -371,6 +371,7 @@ static const struct usb_device_id usb_quirk_list[] = {
	{ USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM },

	/* SanDisk Corp. SanDisk 3.2Gen1 */
	{ USB_DEVICE(0x0781, 0x5596), .driver_info = USB_QUIRK_DELAY_INIT },
	{ USB_DEVICE(0x0781, 0x55a3), .driver_info = USB_QUIRK_DELAY_INIT },

	/* SanDisk Extreme 55AE */
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#define PCI_DEVICE_ID_INTEL_TGPLP		0xa0ee
#define PCI_DEVICE_ID_INTEL_TGPH		0x43ee
#define PCI_DEVICE_ID_INTEL_JSP			0x4dee
#define PCI_DEVICE_ID_INTEL_WCL			0x4d7e
#define PCI_DEVICE_ID_INTEL_ADL			0x460e
#define PCI_DEVICE_ID_INTEL_ADL_PCH		0x51ee
#define PCI_DEVICE_ID_INTEL_ADLN		0x465e
@@ -431,6 +432,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
	{ PCI_DEVICE_DATA(INTEL, TGPLP, &dwc3_pci_intel_swnode) },
	{ PCI_DEVICE_DATA(INTEL, TGPH, &dwc3_pci_intel_swnode) },
	{ PCI_DEVICE_DATA(INTEL, JSP, &dwc3_pci_intel_swnode) },
	{ PCI_DEVICE_DATA(INTEL, WCL, &dwc3_pci_intel_swnode) },
	{ PCI_DEVICE_DATA(INTEL, ADL, &dwc3_pci_intel_swnode) },
	{ PCI_DEVICE_DATA(INTEL, ADL_PCH, &dwc3_pci_intel_swnode) },
	{ PCI_DEVICE_DATA(INTEL, ADLN, &dwc3_pci_intel_swnode) },
Loading