Commit 3d9061d2 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull USB / Thunderbolt driver fixes from Greg KH:
 "Here are some small USB and Thunderbolt driver fixes for 6.11-rc4 to
  resolve some reported issues. Included in here are:

   - thunderbolt driver fixes for reported problems

   - typec driver fixes

   - xhci fixes

   - new device id for ljca usb driver

  All of these have been in linux-next this week with no reported
  issues"

* tag 'usb-6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  xhci: Fix Panther point NULL pointer deref at full-speed re-enumeration
  usb: misc: ljca: Add Lunar Lake ljca GPIO HID to ljca_gpio_hids[]
  Revert "usb: typec: tcpm: clear pd_event queue in PORT_RESET"
  usb: typec: ucsi: Fix the return value of ucsi_run_command()
  usb: xhci: fix duplicate stall handling in handle_tx_event()
  usb: xhci: Check for xhci->interrupters being allocated in xhci_mem_clearup()
  thunderbolt: Mark XDomain as unplugged when router is removed
  thunderbolt: Fix memory leaks in {port|retimer}_sb_regs_write()
parents 57b14823 af8e119f
...@@ -323,16 +323,17 @@ static ssize_t port_sb_regs_write(struct file *file, const char __user *user_buf ...@@ -323,16 +323,17 @@ static ssize_t port_sb_regs_write(struct file *file, const char __user *user_buf
if (mutex_lock_interruptible(&tb->lock)) { if (mutex_lock_interruptible(&tb->lock)) {
ret = -ERESTARTSYS; ret = -ERESTARTSYS;
goto out_rpm_put; goto out;
} }
ret = sb_regs_write(port, port_sb_regs, ARRAY_SIZE(port_sb_regs), ret = sb_regs_write(port, port_sb_regs, ARRAY_SIZE(port_sb_regs),
USB4_SB_TARGET_ROUTER, 0, buf, count, ppos); USB4_SB_TARGET_ROUTER, 0, buf, count, ppos);
mutex_unlock(&tb->lock); mutex_unlock(&tb->lock);
out_rpm_put: out:
pm_runtime_mark_last_busy(&sw->dev); pm_runtime_mark_last_busy(&sw->dev);
pm_runtime_put_autosuspend(&sw->dev); pm_runtime_put_autosuspend(&sw->dev);
free_page((unsigned long)buf);
return ret < 0 ? ret : count; return ret < 0 ? ret : count;
} }
...@@ -355,16 +356,17 @@ static ssize_t retimer_sb_regs_write(struct file *file, ...@@ -355,16 +356,17 @@ static ssize_t retimer_sb_regs_write(struct file *file,
if (mutex_lock_interruptible(&tb->lock)) { if (mutex_lock_interruptible(&tb->lock)) {
ret = -ERESTARTSYS; ret = -ERESTARTSYS;
goto out_rpm_put; goto out;
} }
ret = sb_regs_write(rt->port, retimer_sb_regs, ARRAY_SIZE(retimer_sb_regs), ret = sb_regs_write(rt->port, retimer_sb_regs, ARRAY_SIZE(retimer_sb_regs),
USB4_SB_TARGET_RETIMER, rt->index, buf, count, ppos); USB4_SB_TARGET_RETIMER, rt->index, buf, count, ppos);
mutex_unlock(&tb->lock); mutex_unlock(&tb->lock);
out_rpm_put: out:
pm_runtime_mark_last_busy(&rt->dev); pm_runtime_mark_last_busy(&rt->dev);
pm_runtime_put_autosuspend(&rt->dev); pm_runtime_put_autosuspend(&rt->dev);
free_page((unsigned long)buf);
return ret < 0 ? ret : count; return ret < 0 ? ret : count;
} }
......
...@@ -3392,6 +3392,7 @@ void tb_switch_remove(struct tb_switch *sw) ...@@ -3392,6 +3392,7 @@ void tb_switch_remove(struct tb_switch *sw)
tb_switch_remove(port->remote->sw); tb_switch_remove(port->remote->sw);
port->remote = NULL; port->remote = NULL;
} else if (port->xdomain) { } else if (port->xdomain) {
port->xdomain->is_unplugged = true;
tb_xdomain_remove(port->xdomain); tb_xdomain_remove(port->xdomain);
port->xdomain = NULL; port->xdomain = NULL;
} }
......
...@@ -1872,7 +1872,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) ...@@ -1872,7 +1872,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
cancel_delayed_work_sync(&xhci->cmd_timer); cancel_delayed_work_sync(&xhci->cmd_timer);
for (i = 0; i < xhci->max_interrupters; i++) { for (i = 0; xhci->interrupters && i < xhci->max_interrupters; i++) {
if (xhci->interrupters[i]) { if (xhci->interrupters[i]) {
xhci_remove_interrupter(xhci, xhci->interrupters[i]); xhci_remove_interrupter(xhci, xhci->interrupters[i]);
xhci_free_interrupter(xhci, xhci->interrupters[i]); xhci_free_interrupter(xhci, xhci->interrupters[i]);
......
...@@ -2910,6 +2910,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, ...@@ -2910,6 +2910,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
process_isoc_td(xhci, ep, ep_ring, td, ep_trb, event); process_isoc_td(xhci, ep, ep_ring, td, ep_trb, event);
else else
process_bulk_intr_td(xhci, ep, ep_ring, td, ep_trb, event); process_bulk_intr_td(xhci, ep, ep_ring, td, ep_trb, event);
return 0;
check_endpoint_halted: check_endpoint_halted:
if (xhci_halted_host_endpoint(ep_ctx, trb_comp_code)) if (xhci_halted_host_endpoint(ep_ctx, trb_comp_code))
......
...@@ -2837,7 +2837,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, ...@@ -2837,7 +2837,7 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci,
xhci->num_active_eps); xhci->num_active_eps);
return -ENOMEM; return -ENOMEM;
} }
if ((xhci->quirks & XHCI_SW_BW_CHECKING) && if ((xhci->quirks & XHCI_SW_BW_CHECKING) && !ctx_change &&
xhci_reserve_bandwidth(xhci, virt_dev, command->in_ctx)) { xhci_reserve_bandwidth(xhci, virt_dev, command->in_ctx)) {
if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK)) if ((xhci->quirks & XHCI_EP_LIMIT_QUIRK))
xhci_free_host_resources(xhci, ctrl_ctx); xhci_free_host_resources(xhci, ctrl_ctx);
...@@ -4200,8 +4200,10 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, ...@@ -4200,8 +4200,10 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
mutex_unlock(&xhci->mutex); mutex_unlock(&xhci->mutex);
ret = xhci_disable_slot(xhci, udev->slot_id); ret = xhci_disable_slot(xhci, udev->slot_id);
xhci_free_virt_device(xhci, udev->slot_id); xhci_free_virt_device(xhci, udev->slot_id);
if (!ret) if (!ret) {
xhci_alloc_dev(hcd, udev); if (xhci_alloc_dev(hcd, udev) == 1)
xhci_setup_addressable_virt_dev(xhci, udev);
}
kfree(command->completion); kfree(command->completion);
kfree(command); kfree(command);
return -EPROTO; return -EPROTO;
......
...@@ -169,6 +169,7 @@ static const struct acpi_device_id ljca_gpio_hids[] = { ...@@ -169,6 +169,7 @@ static const struct acpi_device_id ljca_gpio_hids[] = {
{ "INTC1096" }, { "INTC1096" },
{ "INTC100B" }, { "INTC100B" },
{ "INTC10D1" }, { "INTC10D1" },
{ "INTC10B5" },
{}, {},
}; };
......
...@@ -5655,7 +5655,6 @@ static void run_state_machine(struct tcpm_port *port) ...@@ -5655,7 +5655,6 @@ static void run_state_machine(struct tcpm_port *port)
break; break;
case PORT_RESET: case PORT_RESET:
tcpm_reset_port(port); tcpm_reset_port(port);
port->pd_events = 0;
if (port->self_powered) if (port->self_powered)
tcpm_set_cc(port, TYPEC_CC_OPEN); tcpm_set_cc(port, TYPEC_CC_OPEN);
else else
......
...@@ -137,7 +137,7 @@ static int ucsi_run_command(struct ucsi *ucsi, u64 command, u32 *cci, ...@@ -137,7 +137,7 @@ static int ucsi_run_command(struct ucsi *ucsi, u64 command, u32 *cci,
if (ret) if (ret)
return ret; return ret;
return err; return err ?: UCSI_CCI_LENGTH(*cci);
} }
static int ucsi_read_error(struct ucsi *ucsi, u8 connector_num) static int ucsi_read_error(struct ucsi *ucsi, u8 connector_num)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment