Commit 7cc01c44 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'usb-fixes-v5.10-rc6' of...

Merge tag 'usb-fixes-v5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-linus

Peter writes:

- Fixed hardware role switch issue at TI platform
- Fixed scatter-list buffer handling
- Fixed error goto label issue

* tag 'usb-fixes-v5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb:
  usb: cdns3: core: fix goto label for error path
  usb: cdns3: gadget: clear trb->length as zero after preparing every trb
  usb: cdns3: Fix hardware based role switch
parents b6505459 6b813751
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -427,7 +427,6 @@ static irqreturn_t cdns3_wakeup_irq(int irq, void *data)
 */
static int cdns3_probe(struct platform_device *pdev)
{
	struct usb_role_switch_desc sw_desc = { };
	struct device *dev = &pdev->dev;
	struct resource	*res;
	struct cdns3 *cdns;
@@ -529,11 +528,13 @@ static int cdns3_probe(struct platform_device *pdev)
	if (ret)
		goto err2;

	if (device_property_read_bool(dev, "usb-role-switch")) {
		struct usb_role_switch_desc sw_desc = { };

		sw_desc.set = cdns3_role_set;
		sw_desc.get = cdns3_role_get;
		sw_desc.allow_userspace_control = true;
		sw_desc.driver_data = cdns;
	if (device_property_read_bool(dev, "usb-role-switch"))
		sw_desc.fwnode = dev->fwnode;

		cdns->role_sw = usb_role_switch_register(dev, &sw_desc);
@@ -542,6 +543,7 @@ static int cdns3_probe(struct platform_device *pdev)
			dev_warn(dev, "Unable to register Role Switch\n");
			goto err3;
		}
	}

	if (cdns->wakeup_irq) {
		ret = devm_request_irq(cdns->dev, cdns->wakeup_irq,
@@ -551,7 +553,7 @@ static int cdns3_probe(struct platform_device *pdev)

		if (ret) {
			dev_err(cdns->dev, "couldn't register wakeup irq handler\n");
			goto err3;
			goto err4;
		}
	}

@@ -582,6 +584,7 @@ static int cdns3_probe(struct platform_device *pdev)
	return 0;
err4:
	cdns3_drd_exit(cdns);
	if (cdns->role_sw)
		usb_role_switch_unregister(cdns->role_sw);
err3:
	set_phy_power_off(cdns);
+1 −0
Original line number Diff line number Diff line
@@ -1260,6 +1260,7 @@ static int cdns3_ep_run_transfer(struct cdns3_endpoint *priv_ep,
		priv_req->end_trb = priv_ep->enqueue;
		cdns3_ep_inc_enq(priv_ep);
		trb = priv_ep->trb_pool + priv_ep->enqueue;
		trb->length = 0;
	} while (sg_iter < num_trb);

	trb = priv_req->trb;