- Fixed hardware role switch issue at TI platform

- Fixed scatter-list buffer handling
 - Fixed error goto label issue
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEDaZUZmFxRG/wNThrSFkpgVDWcbsFAl/EinYACgkQSFkpgVDW
 cbueQwf/Zsls6E2Ikhm6oyFbXAqUB8cIvYRH3iefnxuYJXfr36fNhA5l3xwBEUkB
 /qKNvTTiEwrvo7DLjbC7Rwi4en/ekhyGbgMZj+C6baLLIYYCP7PwziLqhfOQ/2qw
 mH/oxdxGmb1CjpllqGDaWUbkp3Yypr1E4oWy2SIN9Fbjzt7hmaI+t3XFbVJCM2l4
 +OG0uU9DQv/NSebn+nN17cPbsAetSFi1JGj4+d4b32NFua0zR5B2wNN9NOYHuV0o
 p5ePwOBxOlR6qvOmfOBAYAxHESvOb6GdJEUZO5fhNa0l0YF1QYKUrDVYg479s9sm
 zW7DinGlvKG6YgM+MOqZ85rFLV04PQ==
 =pDfh
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Greg Kroah-Hartman 2020-11-30 09:10:58 +01:00
commit 7cc01c445d
2 changed files with 17 additions and 13 deletions

View File

@ -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,18 +528,21 @@ static int cdns3_probe(struct platform_device *pdev)
if (ret)
goto err2;
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"))
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;
sw_desc.fwnode = dev->fwnode;
cdns->role_sw = usb_role_switch_register(dev, &sw_desc);
if (IS_ERR(cdns->role_sw)) {
ret = PTR_ERR(cdns->role_sw);
dev_warn(dev, "Unable to register Role Switch\n");
goto err3;
cdns->role_sw = usb_role_switch_register(dev, &sw_desc);
if (IS_ERR(cdns->role_sw)) {
ret = PTR_ERR(cdns->role_sw);
dev_warn(dev, "Unable to register Role Switch\n");
goto err3;
}
}
if (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,7 +584,8 @@ static int cdns3_probe(struct platform_device *pdev)
return 0;
err4:
cdns3_drd_exit(cdns);
usb_role_switch_unregister(cdns->role_sw);
if (cdns->role_sw)
usb_role_switch_unregister(cdns->role_sw);
err3:
set_phy_power_off(cdns);
err2:

View File

@ -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;