Commit 5fd6b9a5 authored by Gil Fine's avatar Gil Fine Committed by Mika Westerberg
Browse files

thunderbolt: Change downstream router's TMU rate in both TMU uni/bidir mode



In case of uni-directional time sync, TMU handshake is
initiated by upstream router. In case of bi-directional
time sync, TMU handshake is initiated by downstream router.
In order to handle correctly the case of uni-directional mode,
we avoid changing the upstream router's rate to off,
because it might have another downstream router plugged that is set to
uni-directional mode (and we don't want to change its mode).
Instead, we always change downstream router's rate.

Signed-off-by: default avatarGil Fine <gil.fine@intel.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent b4e08d5d
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -359,12 +359,13 @@ int tb_switch_tmu_disable(struct tb_switch *sw)
		 * In case of uni-directional time sync, TMU handshake is
		 * initiated by upstream router. In case of bi-directional
		 * time sync, TMU handshake is initiated by downstream router.
		 * Therefore, we change the rate to off in the respective
		 * router.
		 * We change downstream router's rate to off for both uni/bidir
		 * cases although it is needed only for the bi-directional mode.
		 * We avoid changing upstream router's mode since it might
		 * have another downstream router plugged, that is set to
		 * uni-directional mode and we don't want to change it's TMU
		 * mode.
		 */
		if (unidirectional)
			tb_switch_tmu_rate_write(parent, TB_SWITCH_TMU_RATE_OFF);
		else
		tb_switch_tmu_rate_write(sw, TB_SWITCH_TMU_RATE_OFF);

		tb_port_tmu_time_sync_disable(up);