Commit 9b6db9a3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'thunderbolt-for-v6.7-rc1' of...

Merge tag 'thunderbolt-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next

Mika writes:

thunderbolt: Changes for v6.7 merge window

This includes following USB4/Thunderbolt changes for the v6.7 merge
window:

  - Configure asymmetric link if the DisplayPort bandwidth requires so
  - Enable path power management packet support for USB4 v2 routers
  - Make the bandwidth reservations to follow the USB4 v2 connection
    manager guide suggestions
  - DisplayPort tunneling improvements
  - Small cleanups and improvements around the driver.

All these have been in linux-next with no reported issues.

* tag 'thunderbolt-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (25 commits)
  thunderbolt: Fix one kernel-doc comment
  thunderbolt: Configure asymmetric link if needed and bandwidth allows
  thunderbolt: Add support for asymmetric link
  thunderbolt: Introduce tb_switch_depth()
  thunderbolt: Introduce tb_for_each_upstream_port_on_path()
  thunderbolt: Introduce tb_port_path_direction_downstream()
  thunderbolt: Set path power management packet support bit for USB4 v2 routers
  thunderbolt: Change bandwidth reservations to comply USB4 v2
  thunderbolt: Make is_gen4_link() available to the rest of the driver
  thunderbolt: Use weight constants in tb_usb3_consumed_bandwidth()
  thunderbolt: Use constants for path weight and priority
  thunderbolt: Add DP IN added last in the head of the list of DP resources
  thunderbolt: Create multiple DisplayPort tunnels if there are more DP IN/OUT pairs
  thunderbolt: Log NVM version of routers and retimers
  thunderbolt: Use tb_tunnel_xxx() log macros in tb.c
  thunderbolt: Expose tb_tunnel_xxx() log macros to the rest of the driver
  thunderbolt: Use tb_tunnel_dbg() where possible to make logging more consistent
  thunderbolt: Fix typo of HPD bit for Hot Plug Detect
  thunderbolt: Fix typo in enum tb_link_width kernel-doc
  thunderbolt: Fix debug log when DisplayPort adapter not available for pairing
  ...
parents ec098970 a558892b
Loading
Loading
Loading
Loading
+25 −22
Original line number Diff line number Diff line
@@ -174,6 +174,28 @@ bool tb_port_clx_is_enabled(struct tb_port *port, unsigned int clx)
	return !!(tb_port_clx(port) & clx);
}

/**
 * tb_switch_clx_is_supported() - Is CLx supported on this type of router
 * @sw: The router to check CLx support for
 */
static bool tb_switch_clx_is_supported(const struct tb_switch *sw)
{
	if (!clx_enabled)
		return false;

	if (sw->quirks & QUIRK_NO_CLX)
		return false;

	/*
	 * CLx is not enabled and validated on Intel USB4 platforms
	 * before Alder Lake.
	 */
	if (tb_switch_is_tiger_lake(sw))
		return false;

	return tb_switch_is_usb4(sw) || tb_switch_is_titan_ridge(sw);
}

/**
 * tb_switch_clx_init() - Initialize router CL states
 * @sw: Router
@@ -273,28 +295,6 @@ static int tb_switch_mask_clx_objections(struct tb_switch *sw)
			   sw->cap_lp + offset, ARRAY_SIZE(val));
}

/**
 * tb_switch_clx_is_supported() - Is CLx supported on this type of router
 * @sw: The router to check CLx support for
 */
bool tb_switch_clx_is_supported(const struct tb_switch *sw)
{
	if (!clx_enabled)
		return false;

	if (sw->quirks & QUIRK_NO_CLX)
		return false;

	/*
	 * CLx is not enabled and validated on Intel USB4 platforms
	 * before Alder Lake.
	 */
	if (tb_switch_is_tiger_lake(sw))
		return false;

	return tb_switch_is_usb4(sw) || tb_switch_is_titan_ridge(sw);
}

static bool validate_mask(unsigned int clx)
{
	/* Previous states need to be enabled */
@@ -405,6 +405,9 @@ int tb_switch_clx_disable(struct tb_switch *sw)
	if (!clx)
		return 0;

	if (sw->is_unplugged)
		return clx;

	up = tb_upstream_port(sw);
	down = tb_switch_downstream_port(sw);

+5 −9
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ struct dma_test {
	unsigned int packets_sent;
	unsigned int packets_received;
	unsigned int link_speed;
	unsigned int link_width;
	enum tb_link_width link_width;
	unsigned int crc_errors;
	unsigned int buffer_overflow_errors;
	enum dma_test_result result;
@@ -465,9 +465,9 @@ DMA_TEST_DEBUGFS_ATTR(packets_to_send, packets_to_send_get,
static int dma_test_set_bonding(struct dma_test *dt)
{
	switch (dt->link_width) {
	case 2:
	case TB_LINK_WIDTH_DUAL:
		return tb_xdomain_lane_bonding_enable(dt->xd);
	case 1:
	case TB_LINK_WIDTH_SINGLE:
		tb_xdomain_lane_bonding_disable(dt->xd);
		fallthrough;
	default:
@@ -490,11 +490,7 @@ static void dma_test_check_errors(struct dma_test *dt, int ret)
	if (!dt->error_code) {
		if (dt->link_speed && dt->xd->link_speed != dt->link_speed) {
			dt->error_code = DMA_TEST_SPEED_ERROR;
		} else if (dt->link_width) {
			const struct tb_xdomain *xd = dt->xd;

			if ((dt->link_width == 1 && xd->link_width != TB_LINK_WIDTH_SINGLE) ||
			    (dt->link_width == 2 && xd->link_width < TB_LINK_WIDTH_DUAL))
		} else if (dt->link_width && dt->link_width != dt->xd->link_width) {
			dt->error_code = DMA_TEST_WIDTH_ERROR;
		} else if (dt->packets_to_send != dt->packets_sent ||
			 dt->packets_to_receive != dt->packets_received ||
+4 −3
Original line number Diff line number Diff line
@@ -19,9 +19,9 @@ static void tb_dump_hop(const struct tb_path_hop *hop, const struct tb_regs_hop

	tb_port_dbg(port, " In HopID: %d => Out port: %d Out HopID: %d\n",
		    hop->in_hop_index, regs->out_port, regs->next_hop);
	tb_port_dbg(port, "  Weight: %d Priority: %d Credits: %d Drop: %d\n",
		    regs->weight, regs->priority,
		    regs->initial_credits, regs->drop_packages);
	tb_port_dbg(port, "  Weight: %d Priority: %d Credits: %d Drop: %d PM: %d\n",
		    regs->weight, regs->priority, regs->initial_credits,
		    regs->drop_packages, regs->pmps);
	tb_port_dbg(port, "   Counter enabled: %d Counter index: %d\n",
		    regs->counter_enable, regs->counter);
	tb_port_dbg(port, "  Flow Control (In/Eg): %d/%d Shared Buffer (In/Eg): %d/%d\n",
@@ -535,6 +535,7 @@ int tb_path_activate(struct tb_path *path)
		hop.next_hop = path->hops[i].next_hop_index;
		hop.out_port = path->hops[i].out_port->port;
		hop.initial_credits = path->hops[i].initial_credits;
		hop.pmps = path->hops[i].pm_support;
		hop.unknown1 = 0;
		hop.enable = 1;

+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ static void quirk_usb3_maximum_bandwidth(struct tb_switch *sw)
{
	struct tb_port *port;

	if (tb_switch_is_icm(sw))
		return;

	tb_switch_for_each_port(sw, port) {
		if (!tb_port_is_usb3_down(port))
			continue;
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ static int tb_retimer_nvm_add(struct tb_retimer *rt)
		goto err_nvm;

	rt->nvm = nvm;
	dev_dbg(&rt->dev, "NVM version %x.%x\n", nvm->major, nvm->minor);
	return 0;

err_nvm:
Loading