Commit da1b4042 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB fixes from Greg KH:
 "Here are a number of small USB driver fixes for 5.18-rc5 for some
  reported issues and new quirks. They include:

   - dwc3 driver fixes

   - xhci driver fixes

   - typec driver fixes

   - new usb-serial driver ids

   - added new USB devices to existing quirk tables

   - other tiny fixes

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

* tag 'usb-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (31 commits)
  usb: phy: generic: Get the vbus supply
  usb: dwc3: gadget: Return proper request status
  usb: dwc3: pci: add support for the Intel Meteor Lake-P
  usb: dwc3: core: Only handle soft-reset in DCTL
  usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind()
  usb: misc: eud: Fix an error handling path in eud_probe()
  usb: core: Don't hold the device lock while sleeping in do_proc_control()
  usb: dwc3: Try usb-role-switch first in dwc3_drd_init
  usb: dwc3: core: Fix tx/rx threshold settings
  usb: mtu3: fix USB 3.0 dual-role-switch from device to host
  xhci: Enable runtime PM on second Alderlake controller
  usb: dwc3: fix backwards compat with rockchip devices
  dt-bindings: usb: samsung,exynos-usb2: add missing required reg
  usb: misc: fix improper handling of refcount in uss720_probe()
  USB: Fix ehci infinite suspend-resume loop issue in zhaoxin
  usb: typec: tcpm: Fix undefined behavior due to shift overflowing the constant
  usb: typec: rt1719: Fix build error without CONFIG_POWER_SUPPLY
  usb: typec: ucsi: Fix role swapping
  usb: typec: ucsi: Fix reuse of completion structure
  usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions
  ...
parents e9512f36 03e607cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ required:
  - interrupts
  - phys
  - phy-names
  - reg

allOf:
  - if:
+5 −2
Original line number Diff line number Diff line
@@ -2684,6 +2684,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
	struct usb_request *request;
	struct cdns3_request *priv_req;
	struct cdns3_trb *trb = NULL;
	struct cdns3_trb trb_tmp;
	int ret;
	int val;

@@ -2693,9 +2694,11 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
	if (request) {
		priv_req = to_cdns3_request(request);
		trb = priv_req->trb;
		if (trb)
		if (trb) {
			trb_tmp = *trb;
			trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
		}
	}

	writel(EP_CMD_CSTALL | EP_CMD_EPRST, &priv_dev->regs->ep_cmd);

@@ -2709,7 +2712,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)

	if (request) {
		if (trb)
			trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
			*trb = trb_tmp;

		cdns3_rearm_transfer(priv_ep, 1);
	}
+9 −5
Original line number Diff line number Diff line
@@ -1209,12 +1209,16 @@ static int do_proc_control(struct usb_dev_state *ps,

		usb_unlock_device(dev);
		i = usbfs_start_wait_urb(urb, tmo, &actlen);

		/* Linger a bit, prior to the next control message. */
		if (dev->quirks & USB_QUIRK_DELAY_CTRL_MSG)
			msleep(200);
		usb_lock_device(dev);
		snoop_urb(dev, NULL, pipe, actlen, i, COMPLETE, tbuf, actlen);
		if (!i && actlen) {
			if (copy_to_user(ctrl->data, tbuf, actlen)) {
				ret = -EFAULT;
				goto recv_fault;
				goto done;
			}
		}
	} else {
@@ -1231,6 +1235,10 @@ static int do_proc_control(struct usb_dev_state *ps,

		usb_unlock_device(dev);
		i = usbfs_start_wait_urb(urb, tmo, &actlen);

		/* Linger a bit, prior to the next control message. */
		if (dev->quirks & USB_QUIRK_DELAY_CTRL_MSG)
			msleep(200);
		usb_lock_device(dev);
		snoop_urb(dev, NULL, pipe, actlen, i, COMPLETE, NULL, 0);
	}
@@ -1242,10 +1250,6 @@ static int do_proc_control(struct usb_dev_state *ps,
	}
	ret = (i < 0 ? i : actlen);

 recv_fault:
	/* Linger a bit, prior to the next control message. */
	if (dev->quirks & USB_QUIRK_DELAY_CTRL_MSG)
		msleep(200);
 done:
	kfree(dr);
	usb_free_urb(urb);
+6 −0
Original line number Diff line number Diff line
@@ -404,6 +404,9 @@ static const struct usb_device_id usb_quirk_list[] = {
	{ USB_DEVICE(0x0b05, 0x17e0), .driver_info =
			USB_QUIRK_IGNORE_REMOTE_WAKEUP },

	/* Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)*/
	{ USB_DEVICE(0x0bda, 0x0151), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },

	/* Realtek hub in Dell WD19 (Type-C) */
	{ USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM },

@@ -507,6 +510,9 @@ static const struct usb_device_id usb_quirk_list[] = {
	/* DJI CineSSD */
	{ USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },

	/* VCOM device */
	{ USB_DEVICE(0x4296, 0x7570), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },

	/* INTEL VALUE SSD */
	{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },

+29 −5
Original line number Diff line number Diff line
@@ -274,7 +274,8 @@ int dwc3_core_soft_reset(struct dwc3 *dwc)

	reg = dwc3_readl(dwc->regs, DWC3_DCTL);
	reg |= DWC3_DCTL_CSFTRST;
	dwc3_writel(dwc->regs, DWC3_DCTL, reg);
	reg &= ~DWC3_DCTL_RUN_STOP;
	dwc3_gadget_dctl_write_safe(dwc, reg);

	/*
	 * For DWC_usb31 controller 1.90a and later, the DCTL.CSFRST bit
@@ -1377,10 +1378,10 @@ static void dwc3_get_properties(struct dwc3 *dwc)
	u8			lpm_nyet_threshold;
	u8			tx_de_emphasis;
	u8			hird_threshold;
	u8			rx_thr_num_pkt_prd;
	u8			rx_max_burst_prd;
	u8			tx_thr_num_pkt_prd;
	u8			tx_max_burst_prd;
	u8			rx_thr_num_pkt_prd = 0;
	u8			rx_max_burst_prd = 0;
	u8			tx_thr_num_pkt_prd = 0;
	u8			tx_max_burst_prd = 0;
	u8			tx_fifo_resize_max_num;
	const char		*usb_psy_name;
	int			ret;
@@ -1690,21 +1691,44 @@ static int dwc3_probe(struct platform_device *pdev)
		/*
		 * Clocks are optional, but new DT platforms should support all
		 * clocks as required by the DT-binding.
		 * Some devices have different clock names in legacy device trees,
		 * check for them to retain backwards compatibility.
		 */
		dwc->bus_clk = devm_clk_get_optional(dev, "bus_early");
		if (IS_ERR(dwc->bus_clk))
			return dev_err_probe(dev, PTR_ERR(dwc->bus_clk),
					     "could not get bus clock\n");

		if (dwc->bus_clk == NULL) {
			dwc->bus_clk = devm_clk_get_optional(dev, "bus_clk");
			if (IS_ERR(dwc->bus_clk))
				return dev_err_probe(dev, PTR_ERR(dwc->bus_clk),
						     "could not get bus clock\n");
		}

		dwc->ref_clk = devm_clk_get_optional(dev, "ref");
		if (IS_ERR(dwc->ref_clk))
			return dev_err_probe(dev, PTR_ERR(dwc->ref_clk),
					     "could not get ref clock\n");

		if (dwc->ref_clk == NULL) {
			dwc->ref_clk = devm_clk_get_optional(dev, "ref_clk");
			if (IS_ERR(dwc->ref_clk))
				return dev_err_probe(dev, PTR_ERR(dwc->ref_clk),
						     "could not get ref clock\n");
		}

		dwc->susp_clk = devm_clk_get_optional(dev, "suspend");
		if (IS_ERR(dwc->susp_clk))
			return dev_err_probe(dev, PTR_ERR(dwc->susp_clk),
					     "could not get suspend clock\n");

		if (dwc->susp_clk == NULL) {
			dwc->susp_clk = devm_clk_get_optional(dev, "suspend_clk");
			if (IS_ERR(dwc->susp_clk))
				return dev_err_probe(dev, PTR_ERR(dwc->susp_clk),
						     "could not get suspend clock\n");
		}
	}

	ret = reset_control_deassert(dwc->reset);
Loading