From: Greg Kroah-Hartman Date: Mon, 23 Jan 2023 14:38:08 +0000 (+0100) Subject: Merge 6.2-rc5 into usb-next X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e3e9fc7fa7ad221cc2e7b207d514cc84ed393251;p=linux.git Merge 6.2-rc5 into usb-next We need the USB fixes in here and this resolves merge conflicts as reported in linux-next in the following files: drivers/usb/host/xhci.c drivers/usb/host/xhci.h drivers/usb/typec/ucsi/ucsi.c Reported-by: Stephen Rothwell Signed-off-by: Greg Kroah-Hartman --- e3e9fc7fa7ad221cc2e7b207d514cc84ed393251 diff --cc drivers/usb/host/xhci.c index 748c7158198f6,2b280beb00115..f61fda4715cc1 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@@ -5502,8 -5516,8 +5516,10 @@@ void xhci_init_driver(struct hc_driver drv->check_bandwidth = over->check_bandwidth; if (over->reset_bandwidth) drv->reset_bandwidth = over->reset_bandwidth; + if (over->update_hub_device) + drv->update_hub_device = over->update_hub_device; + if (over->hub_control) + drv->hub_control = over->hub_control; } } EXPORT_SYMBOL_GPL(xhci_init_driver); diff --cc drivers/usb/host/xhci.h index f71841812f060,dcee7f3207add..7547037b57bfe --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@@ -1943,8 -1944,8 +1944,10 @@@ struct xhci_driver_overrides struct usb_host_endpoint *ep); int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); + int (*update_hub_device)(struct usb_hcd *hcd, struct usb_device *hdev, + struct usb_tt *tt, gfp_t mem_flags); + int (*hub_control)(struct usb_hcd *hcd, u16 typeReq, u16 wValue, + u16 wIndex, char *buf, u16 wLength); }; #define XHCI_CFC_DELAY 10 diff --cc drivers/usb/typec/ucsi/ucsi.c index d04809476f714,1292241d581a6..00fc8672098f3 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@@ -1551,14 -1426,20 +1557,27 @@@ void ucsi_unregister(struct ucsi *ucsi ucsi_unregister_altmodes(&ucsi->connector[i], UCSI_RECIPIENT_CON); ucsi_unregister_port_psy(&ucsi->connector[i]); - if (ucsi->connector[i].wq) + + if (ucsi->connector[i].wq) { + struct ucsi_work *uwork; + + mutex_lock(&ucsi->connector[i].lock); + /* + * queue delayed items immediately so they can execute + * and free themselves before the wq is destroyed + */ + list_for_each_entry(uwork, &ucsi->connector[i].partner_tasks, node) + mod_delayed_work(ucsi->connector[i].wq, &uwork->work, 0); + mutex_unlock(&ucsi->connector[i].lock); destroy_workqueue(ucsi->connector[i].wq); + } ++ + usb_power_delivery_unregister_capabilities(ucsi->connector[i].port_sink_caps); + ucsi->connector[i].port_sink_caps = NULL; + usb_power_delivery_unregister_capabilities(ucsi->connector[i].port_source_caps); + ucsi->connector[i].port_source_caps = NULL; + usb_power_delivery_unregister(ucsi->connector[i].pd); + ucsi->connector[i].pd = NULL; typec_unregister_port(ucsi->connector[i].port); }