Pull USB fixes from Greg KH: "Here are some small USB fixes for 6.7-rc5 to resolve some reported issues. Included in here are: - usb gadget f_hid, and uevent fix - xhci driver revert to resolve a much-reported issue - typec driver fix All of these have been in linux-next with no reported issues" * tag 'usb-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: gadget: f_hid: fix report descriptor allocation Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" usb: typec: class: fix typec_altmode_put_partner to put plugs USB: gadget: core: adjust uevent timing on gadget unbind
Unified · Split
| @@ -92,6 +92,7 @@ static void hidg_release(struct device *dev) · 91 unmodified lines | |||
| 92 | { | 92 | { |
| 93 | struct f_hidg *hidg = container_of(dev, struct f_hidg, dev); | 93 | struct f_hidg *hidg = container_of(dev, struct f_hidg, dev); |
| 94 | 94 | ||
| 95 | kfree(hidg->report_desc); | ||
| 95 | kfree(hidg->set_report_buf); | 96 | kfree(hidg->set_report_buf); |
| 96 | kfree(hidg); | 97 | kfree(hidg); |
| 97 | } | 98 | } |
| @@ -1287,9 +1288,9 @@ static struct usb_function *hidg_alloc(struct usb_function_instance *fi) · 1189 unmodified lines | |||
| 1287 | hidg->report_length = opts->report_length; | 1288 | hidg->report_length = opts->report_length; |
| 1288 | hidg->report_desc_length = opts->report_desc_length; | 1289 | hidg->report_desc_length = opts->report_desc_length; |
| 1289 | if (opts->report_desc) { | 1290 | if (opts->report_desc) { |
| 1290 | hidg->report_desc = devm_kmemdup(&hidg->dev, opts->report_desc, | 1291 | hidg->report_desc = kmemdup(opts->report_desc, |
| 1291 | opts->report_desc_length, | 1292 | opts->report_desc_length, |
| 1292 | GFP_KERNEL); | 1293 | GFP_KERNEL); |
| 1293 | if (!hidg->report_desc) { | 1294 | if (!hidg->report_desc) { |
| 1294 | ret = -ENOMEM; | 1295 | ret = -ENOMEM; |
| 1295 | goto err_put_device; | 1296 | goto err_put_device; |
| @@ -1646,8 +1646,6 @@ static void gadget_unbind_driver(struct device *dev) · 1645 unmodified lines | |||
| 1646 | 1646 | ||
| 1647 | dev_dbg(&udc->dev, "unbinding gadget driver [%s]\n", driver->function); | 1647 | dev_dbg(&udc->dev, "unbinding gadget driver [%s]\n", driver->function); |
| 1648 | 1648 | ||
| 1649 | kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE); | ||
| 1650 | |||
| 1651 | udc->allow_connect = false; | 1649 | udc->allow_connect = false; |
| 1652 | cancel_work_sync(&udc->vbus_work); | 1650 | cancel_work_sync(&udc->vbus_work); |
| 1653 | mutex_lock(&udc->connect_lock); | 1651 | mutex_lock(&udc->connect_lock); |
| @@ -1667,6 +1665,8 @@ static void gadget_unbind_driver(struct device *dev) · 13 unmodified lines | |||
| 1667 | driver->is_bound = false; | 1665 | driver->is_bound = false; |
| 1668 | udc->driver = NULL; | 1666 | udc->driver = NULL; |
| 1669 | mutex_unlock(&udc_lock); | 1667 | mutex_unlock(&udc_lock); |
| 1668 | |||
| 1669 | kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE); | ||
| 1670 | } | 1670 | } |
| 1671 | 1671 | ||
| 1672 | /* ------------------------------------------------------------------------- */ | 1672 | /* ------------------------------------------------------------------------- */ |
| @@ -535,8 +535,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 534 unmodified lines | |||
| 535 | /* xHC spec requires PCI devices to support D3hot and D3cold */ | 535 | /* xHC spec requires PCI devices to support D3hot and D3cold */ |
| 536 | if (xhci->hci_version >= 0x120) | 536 | if (xhci->hci_version >= 0x120) |
| 537 | xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; | 537 | xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; |
| 538 | else if (pdev->vendor == PCI_VENDOR_ID_AMD && xhci->hci_version >= 0x110) | ||
| 539 | xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; | ||
| 540 | 538 | ||
| 541 | if (xhci->quirks & XHCI_RESET_ON_RESUME) | 539 | if (xhci->quirks & XHCI_RESET_ON_RESUME) |
| 542 | xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, | 540 | xhci_dbg_trace(xhci, trace_xhci_dbg_quirks, |
| @@ -267,7 +267,7 @@ static void typec_altmode_put_partner(struct altmode *altmode) · 266 unmodified lines | |||
| 267 | if (!partner) | 267 | if (!partner) |
| 268 | return; | 268 | return; |
| 269 | 269 | ||
| 270 | adev = &partner->adev; | 270 | adev = &altmode->adev; |
| 271 | 271 | ||
| 272 | if (is_typec_plug(adev->dev.parent)) { | 272 | if (is_typec_plug(adev->dev.parent)) { |
| 273 | struct typec_plug *plug = to_typec_plug(adev->dev.parent); | 273 | struct typec_plug *plug = to_typec_plug(adev->dev.parent); |
| @@ -497,7 +497,8 @@ static void typec_altmode_release(struct device *dev) · 223 unmodified lines | |||
| 497 | { | 497 | { |
| 498 | struct altmode *alt = to_altmode(to_typec_altmode(dev)); | 498 | struct altmode *alt = to_altmode(to_typec_altmode(dev)); |
| 499 | 499 | ||
| 500 | typec_altmode_put_partner(alt); | 500 | if (!is_typec_port(dev->parent)) |
| 501 | typec_altmode_put_partner(alt); | ||
| 501 | 502 | ||
| 502 | altmode_id_remove(alt->adev.dev.parent, alt->id); | 503 | altmode_id_remove(alt->adev.dev.parent, alt->id); |
| 503 | kfree(alt); | 504 | kfree(alt); |