Commit ce20d7bf authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull USB fixes from Greg KH:
 "Here are a few small USB fixes, and one thunderbolt fix, for 5.8-rc6.

  Nothing huge in here, just the normal collection of gadget, dwc2/3,
  serial, and other minor USB driver fixes and id additions. Full
  details are in the shortlog.

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

* tag 'usb-5.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  USB: serial: iuu_phoenix: fix memory corruption
  USB: c67x00: fix use after free in c67x00_giveback_urb
  usb: gadget: function: fix missing spinlock in f_uac1_legacy
  usb: gadget: udc: atmel: fix uninitialized read in debug printk
  usb: gadget: udc: atmel: remove outdated comment in usba_ep_disable()
  usb: dwc2: Fix shutdown callback in platform
  usb: cdns3: trace: fix some endian issues
  usb: cdns3: ep0: fix some endian issues
  usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init()
  usb: gadget: fix langid kernel-doc warning in usbstring.c
  usb: dwc3: pci: add support for the Intel Jasper Lake
  usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variant
  usb: chipidea: core: add wakeup support for extcon
  USB: serial: option: add Quectel EG95 LTE modem
  thunderbolt: Fix path indices used in USB3 tunnel discovery
  USB: serial: ch341: add new Product ID for CH340
  USB: serial: option: add GosunCn GM500 series
  USB: serial: cypress_m8: enable Simply Automated UPB PIM
parents 8c18fc63 c7300cdf
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -913,21 +913,21 @@ struct tb_tunnel *tb_tunnel_discover_usb3(struct tb *tb, struct tb_port *down)
	 * case.
	 */
	path = tb_path_discover(down, TB_USB3_HOPID, NULL, -1,
				&tunnel->dst_port, "USB3 Up");
				&tunnel->dst_port, "USB3 Down");
	if (!path) {
		/* Just disable the downstream port */
		tb_usb3_port_enable(down, false);
		goto err_free;
	}
	tunnel->paths[TB_USB3_PATH_UP] = path;
	tb_usb3_init_path(tunnel->paths[TB_USB3_PATH_UP]);
	tunnel->paths[TB_USB3_PATH_DOWN] = path;
	tb_usb3_init_path(tunnel->paths[TB_USB3_PATH_DOWN]);

	path = tb_path_discover(tunnel->dst_port, -1, down, TB_USB3_HOPID, NULL,
				"USB3 Down");
				"USB3 Up");
	if (!path)
		goto err_deactivate;
	tunnel->paths[TB_USB3_PATH_DOWN] = path;
	tb_usb3_init_path(tunnel->paths[TB_USB3_PATH_DOWN]);
	tunnel->paths[TB_USB3_PATH_UP] = path;
	tb_usb3_init_path(tunnel->paths[TB_USB3_PATH_UP]);

	/* Validate that the tunnel is complete */
	if (!tb_port_is_usb3_up(tunnel->dst_port)) {
+1 −1
Original line number Diff line number Diff line
@@ -486,7 +486,7 @@ c67x00_giveback_urb(struct c67x00_hcd *c67x00, struct urb *urb, int status)
	c67x00_release_urb(c67x00, urb);
	usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb);
	spin_unlock(&c67x00->lock);
	usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status);
	usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, status);
	spin_lock(&c67x00->lock);
}

+15 −15
Original line number Diff line number Diff line
@@ -37,18 +37,18 @@ static void cdns3_ep0_run_transfer(struct cdns3_device *priv_dev,
	struct cdns3_usb_regs __iomem *regs = priv_dev->regs;
	struct cdns3_endpoint *priv_ep = priv_dev->eps[0];

	priv_ep->trb_pool[0].buffer = TRB_BUFFER(dma_addr);
	priv_ep->trb_pool[0].length = TRB_LEN(length);
	priv_ep->trb_pool[0].buffer = cpu_to_le32(TRB_BUFFER(dma_addr));
	priv_ep->trb_pool[0].length = cpu_to_le32(TRB_LEN(length));

	if (zlp) {
		priv_ep->trb_pool[0].control = TRB_CYCLE | TRB_TYPE(TRB_NORMAL);
		priv_ep->trb_pool[1].buffer = TRB_BUFFER(dma_addr);
		priv_ep->trb_pool[1].length = TRB_LEN(0);
		priv_ep->trb_pool[1].control = TRB_CYCLE | TRB_IOC |
		    TRB_TYPE(TRB_NORMAL);
		priv_ep->trb_pool[0].control = cpu_to_le32(TRB_CYCLE | TRB_TYPE(TRB_NORMAL));
		priv_ep->trb_pool[1].buffer = cpu_to_le32(TRB_BUFFER(dma_addr));
		priv_ep->trb_pool[1].length = cpu_to_le32(TRB_LEN(0));
		priv_ep->trb_pool[1].control = cpu_to_le32(TRB_CYCLE | TRB_IOC |
		    TRB_TYPE(TRB_NORMAL));
	} else {
		priv_ep->trb_pool[0].control = TRB_CYCLE | TRB_IOC |
		    TRB_TYPE(TRB_NORMAL);
		priv_ep->trb_pool[0].control = cpu_to_le32(TRB_CYCLE | TRB_IOC |
		    TRB_TYPE(TRB_NORMAL));
		priv_ep->trb_pool[1].control = 0;
	}

@@ -264,11 +264,11 @@ static int cdns3_req_ep0_get_status(struct cdns3_device *priv_dev,
	case USB_RECIP_INTERFACE:
		return cdns3_ep0_delegate_req(priv_dev, ctrl);
	case USB_RECIP_ENDPOINT:
		index = cdns3_ep_addr_to_index(ctrl->wIndex);
		index = cdns3_ep_addr_to_index(le16_to_cpu(ctrl->wIndex));
		priv_ep = priv_dev->eps[index];

		/* check if endpoint is stalled or stall is pending */
		cdns3_select_ep(priv_dev, ctrl->wIndex);
		cdns3_select_ep(priv_dev, le16_to_cpu(ctrl->wIndex));
		if (EP_STS_STALL(readl(&priv_dev->regs->ep_sts)) ||
		    (priv_ep->flags & EP_STALL_PENDING))
			usb_status =  BIT(USB_ENDPOINT_HALT);
@@ -381,10 +381,10 @@ static int cdns3_ep0_feature_handle_endpoint(struct cdns3_device *priv_dev,
	if (!(ctrl->wIndex & ~USB_DIR_IN))
		return 0;

	index = cdns3_ep_addr_to_index(ctrl->wIndex);
	index = cdns3_ep_addr_to_index(le16_to_cpu(ctrl->wIndex));
	priv_ep = priv_dev->eps[index];

	cdns3_select_ep(priv_dev, ctrl->wIndex);
	cdns3_select_ep(priv_dev, le16_to_cpu(ctrl->wIndex));

	if (set)
		__cdns3_gadget_ep_set_halt(priv_ep);
@@ -445,7 +445,7 @@ static int cdns3_req_ep0_set_sel(struct cdns3_device *priv_dev,
	if (priv_dev->gadget.state < USB_STATE_ADDRESS)
		return -EINVAL;

	if (ctrl_req->wLength != 6) {
	if (le16_to_cpu(ctrl_req->wLength) != 6) {
		dev_err(priv_dev->dev, "Set SEL should be 6 bytes, got %d\n",
			ctrl_req->wLength);
		return -EINVAL;
@@ -469,7 +469,7 @@ static int cdns3_req_ep0_set_isoch_delay(struct cdns3_device *priv_dev,
	if (ctrl_req->wIndex || ctrl_req->wLength)
		return -EINVAL;

	priv_dev->isoch_delay = ctrl_req->wValue;
	priv_dev->isoch_delay = le16_to_cpu(ctrl_req->wValue);

	return 0;
}
+3 −3
Original line number Diff line number Diff line
@@ -404,9 +404,9 @@ DECLARE_EVENT_CLASS(cdns3_log_trb,
	TP_fast_assign(
		__assign_str(name, priv_ep->name);
		__entry->trb = trb;
		__entry->buffer = trb->buffer;
		__entry->length = trb->length;
		__entry->control = trb->control;
		__entry->buffer = le32_to_cpu(trb->buffer);
		__entry->length = le32_to_cpu(trb->length);
		__entry->control = le32_to_cpu(trb->control);
		__entry->type = usb_endpoint_type(priv_ep->endpoint.desc);
		__entry->last_stream_id = priv_ep->last_stream_id;
	),
+24 −0
Original line number Diff line number Diff line
@@ -1243,6 +1243,29 @@ static void ci_controller_suspend(struct ci_hdrc *ci)
	enable_irq(ci->irq);
}

/*
 * Handle the wakeup interrupt triggered by extcon connector
 * We need to call ci_irq again for extcon since the first
 * interrupt (wakeup int) only let the controller be out of
 * low power mode, but not handle any interrupts.
 */
static void ci_extcon_wakeup_int(struct ci_hdrc *ci)
{
	struct ci_hdrc_cable *cable_id, *cable_vbus;
	u32 otgsc = hw_read_otgsc(ci, ~0);

	cable_id = &ci->platdata->id_extcon;
	cable_vbus = &ci->platdata->vbus_extcon;

	if (!IS_ERR(cable_id->edev) && ci->is_otg &&
		(otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS))
		ci_irq(ci->irq, ci);

	if (!IS_ERR(cable_vbus->edev) && ci->is_otg &&
		(otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS))
		ci_irq(ci->irq, ci);
}

static int ci_controller_resume(struct device *dev)
{
	struct ci_hdrc *ci = dev_get_drvdata(dev);
@@ -1275,6 +1298,7 @@ static int ci_controller_resume(struct device *dev)
		enable_irq(ci->irq);
		if (ci_otg_is_fsm_mode(ci))
			ci_otg_fsm_wakeup_by_srp(ci);
		ci_extcon_wakeup_int(ci);
	}

	return 0;
Loading