Commit 469a2f50 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull USB / Thunderbolt driver fixes from Greg KH:
 "Here are some small USB and Thunderbolt driver fixes for reported
  problems. Included in here are:

   - thunderbolt driver memory leak fix

   - thunderbolt display flicker fix

   - usb dwc3 driver fix

   - usb gadget uvc disconnect crash fix

   - usb typec Kconfig build dependency fix

   - usb typec small fixes

   - usb-con-gpio bugfix

   - usb-storage old driver bugfix

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
  usb: dwc3: Properly handle processing of pending events
  usb-storage: alauda: Fix uninit-value in alauda_check_media()
  usb: common: usb-conn-gpio: Prevent bailing out if initial role is none
  USB: Gadget: core: Help prevent panic during UVC unconfigure
  usb: typec: mux: intel: Add dependency on USB_COMMON
  usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe()
  usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment
  usb: typec: tcpm: Fix response to vsafe0V event
  thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards
parents 43972cf2 f48585c4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1964,6 +1964,8 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)

	pm_runtime_mark_last_busy(&tb->dev);
	pm_runtime_put_autosuspend(&tb->dev);

	kfree(ev);
}

static void tb_queue_dp_bandwidth_request(struct tb *tb, u64 route, u8 port)
+3 −1
Original line number Diff line number Diff line
@@ -579,7 +579,9 @@ int tb_switch_tmu_disable(struct tb_switch *sw)
		 * uni-directional mode and we don't want to change it's TMU
		 * mode.
		 */
		tb_switch_tmu_rate_write(sw, tmu_rates[TB_SWITCH_TMU_MODE_OFF]);
		ret = tb_switch_tmu_rate_write(sw, tmu_rates[TB_SWITCH_TMU_MODE_OFF]);
		if (ret)
			return ret;

		tb_port_tmu_time_sync_disable(up);
		ret = tb_port_tmu_time_sync_disable(down);
+5 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ struct usb_conn_info {

	struct power_supply_desc desc;
	struct power_supply *charger;
	bool initial_detection;
};

/*
@@ -86,11 +87,13 @@ static void usb_conn_detect_cable(struct work_struct *work)
	dev_dbg(info->dev, "role %s -> %s, gpios: id %d, vbus %d\n",
		usb_role_string(info->last_role), usb_role_string(role), id, vbus);

	if (info->last_role == role) {
	if (!info->initial_detection && info->last_role == role) {
		dev_warn(info->dev, "repeated role: %s\n", usb_role_string(role));
		return;
	}

	info->initial_detection = false;

	if (info->last_role == USB_ROLE_HOST && info->vbus)
		regulator_disable(info->vbus);

@@ -258,6 +261,7 @@ static int usb_conn_probe(struct platform_device *pdev)
	device_set_wakeup_capable(&pdev->dev, true);

	/* Perform initial detection */
	info->initial_detection = true;
	usb_conn_queue_dwork(info, 0);

	return 0;
+8 −1
Original line number Diff line number Diff line
@@ -4455,9 +4455,14 @@ static irqreturn_t dwc3_check_event_buf(struct dwc3_event_buffer *evt)
	u32 count;

	if (pm_runtime_suspended(dwc->dev)) {
		dwc->pending_events = true;
		/*
		 * Trigger runtime resume. The get() function will be balanced
		 * after processing the pending events in dwc3_process_pending
		 * events().
		 */
		pm_runtime_get(dwc->dev);
		disable_irq_nosync(dwc->irq_gadget);
		dwc->pending_events = true;
		return IRQ_HANDLED;
	}

@@ -4718,6 +4723,8 @@ void dwc3_gadget_process_pending_events(struct dwc3 *dwc)
{
	if (dwc->pending_events) {
		dwc3_interrupt(dwc->irq_gadget, dwc->ev_buf);
		dwc3_thread_interrupt(dwc->irq_gadget, dwc->ev_buf);
		pm_runtime_put(dwc->dev);
		dwc->pending_events = false;
		enable_irq(dwc->irq_gadget);
	}
+9 −0
Original line number Diff line number Diff line
@@ -822,6 +822,9 @@ EXPORT_SYMBOL_GPL(usb_gadget_disconnect);
 * usb_gadget_activate() is called.  For example, user mode components may
 * need to be activated before the system can talk to hosts.
 *
 * This routine may sleep; it must not be called in interrupt context
 * (such as from within a gadget driver's disconnect() callback).
 *
 * Returns zero on success, else negative errno.
 */
int usb_gadget_deactivate(struct usb_gadget *gadget)
@@ -860,6 +863,8 @@ EXPORT_SYMBOL_GPL(usb_gadget_deactivate);
 * This routine activates gadget which was previously deactivated with
 * usb_gadget_deactivate() call. It calls usb_gadget_connect() if needed.
 *
 * This routine may sleep; it must not be called in interrupt context.
 *
 * Returns zero on success, else negative errno.
 */
int usb_gadget_activate(struct usb_gadget *gadget)
@@ -1638,7 +1643,11 @@ static void gadget_unbind_driver(struct device *dev)
	usb_gadget_disable_async_callbacks(udc);
	if (gadget->irq)
		synchronize_irq(gadget->irq);
	mutex_unlock(&udc->connect_lock);

	udc->driver->unbind(gadget);

	mutex_lock(&udc->connect_lock);
	usb_gadget_udc_stop_locked(udc);
	mutex_unlock(&udc->connect_lock);

Loading