History

Merge tag 'usb-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

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

Linus Torvalds committed 2 years ago

Commit 21b73ff2 parents 0b52609 61890dc4 files · +9 −9Browse files

Unified · Split

4 files
  1. drivers/usb/gadget/function/f_hid.c +4 −3
  2. drivers/usb/gadget/udc/core.c +2 −2
  3. drivers/usb/host/xhci-pci.c +0 −2
  4. drivers/usb/typec/class.c +3 −2
drivers/usb/gadget/function/f_hid.c+4−3
@@ -92,6 +92,7 @@ static void hidg_release(struct device *dev) · 91 unmodified lines
9292 {
9393 struct f_hidg *hidg = container_of(dev, struct f_hidg, dev);
9494
95+ kfree(hidg->report_desc);
9596 kfree(hidg->set_report_buf);
9697 kfree(hidg);
9798 }
@@ -1287,9 +1288,9 @@ static struct usb_function *hidg_alloc(struct usb_function_instance *fi) · 1189 unmodified lines
12871288 hidg->report_length = opts->report_length;
12881289 hidg->report_desc_length = opts->report_desc_length;
12891290 if (opts->report_desc) {
1290− hidg->report_desc = devm_kmemdup(&hidg->dev, opts->report_desc,
1291− opts->report_desc_length,
1292− GFP_KERNEL);
1291+ hidg->report_desc = kmemdup(opts->report_desc,
1292+ opts->report_desc_length,
1293+ GFP_KERNEL);
12931294 if (!hidg->report_desc) {
12941295 ret = -ENOMEM;
12951296 goto err_put_device;
drivers/usb/gadget/udc/core.c+2−2
@@ -1646,8 +1646,6 @@ static void gadget_unbind_driver(struct device *dev) · 1645 unmodified lines
16461646
16471647 dev_dbg(&udc->dev, "unbinding gadget driver [%s]\n", driver->function);
16481648
1649− kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);
1650−
16511649 udc->allow_connect = false;
16521650 cancel_work_sync(&udc->vbus_work);
16531651 mutex_lock(&udc->connect_lock);
@@ -1667,6 +1665,8 @@ static void gadget_unbind_driver(struct device *dev) · 13 unmodified lines
16671665 driver->is_bound = false;
16681666 udc->driver = NULL;
16691667 mutex_unlock(&udc_lock);
1668+
1669+ kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);
16701670 }
16711671
16721672 /* ------------------------------------------------------------------------- */
drivers/usb/host/xhci-pci.c+0−2
@@ -535,8 +535,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 534 unmodified lines
535535 /* xHC spec requires PCI devices to support D3hot and D3cold */
536536 if (xhci->hci_version >= 0x120)
537537 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;
540538
541539 if (xhci->quirks & XHCI_RESET_ON_RESUME)
542540 xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
drivers/usb/typec/class.c+3−2
@@ -267,7 +267,7 @@ static void typec_altmode_put_partner(struct altmode *altmode) · 266 unmodified lines
267267 if (!partner)
268268 return;
269269
270− adev = &partner->adev;
270+ adev = &altmode->adev;
271271
272272 if (is_typec_plug(adev->dev.parent)) {
273273 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
497497 {
498498 struct altmode *alt = to_altmode(to_typec_altmode(dev));
499499
500− typec_altmode_put_partner(alt);
500+ if (!is_typec_port(dev->parent))
501+ typec_altmode_put_partner(alt);
501502
502503 altmode_id_remove(alt->adev.dev.parent, alt->id);
503504 kfree(alt);