diff options
author | Gil Fine <gil.fine@intel.com> | 2022-05-26 13:59:19 +0300 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2022-06-06 12:19:23 +0300 |
commit | 5fd6b9a5cbe63fea4c490fee8af34144a139a266 (patch) | |
tree | 8ca79d9e0a0cc896001ef423925d7e6e5789d6b9 /drivers | |
parent | b4e08d5d08192699e68ffa796bd2c3ab58af5730 (diff) | |
download | linux-stable-5fd6b9a5cbe63fea4c490fee8af34144a139a266.tar.gz linux-stable-5fd6b9a5cbe63fea4c490fee8af34144a139a266.tar.bz2 linux-stable-5fd6b9a5cbe63fea4c490fee8af34144a139a266.zip |
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: Gil Fine <gil.fine@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/thunderbolt/tmu.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/thunderbolt/tmu.c b/drivers/thunderbolt/tmu.c index b656659d02fb..985ca43b8f39 100644 --- a/drivers/thunderbolt/tmu.c +++ b/drivers/thunderbolt/tmu.c @@ -359,13 +359,14 @@ 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_switch_tmu_rate_write(sw, TB_SWITCH_TMU_RATE_OFF); tb_port_tmu_time_sync_disable(up); ret = tb_port_tmu_time_sync_disable(down); |