summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2023-05-26 14:51:23 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2023-06-12 08:38:01 +0300
commitb7b83911f7906a72f50806279ef22c86be728b69 (patch)
tree8b42b852d52bbeb17bbefcba42b62bd061bcaaf4 /drivers/thunderbolt
parent1402ba08abae5cfa583ff1a40b99c098a0532d41 (diff)
downloadlinux-b7b83911f7906a72f50806279ef22c86be728b69.tar.xz
thunderbolt: Do not send UNSET_INBOUND_SBTX when retimer NVM authentication started
Once retimer NVM authentication is started, sending UNSET_INBOUND_SBTX will fail so avoid doing that. Only send it when we are writing an image with not authentication or when the authentication failed early. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/retimer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
index fb8e113488db..a273fb02a02c 100644
--- a/drivers/thunderbolt/retimer.c
+++ b/drivers/thunderbolt/retimer.c
@@ -244,6 +244,13 @@ static ssize_t nvm_authenticate_store(struct device *dev,
rt->auth_status = 0;
if (val) {
+ /*
+ * When NVM authentication starts the retimer is not
+ * accessible so calling tb_retimer_unset_inbound_sbtx()
+ * will fail and therefore we do not call it. Exception
+ * is when the validation fails or we only write the new
+ * NVM image without authentication.
+ */
tb_retimer_set_inbound_sbtx(rt->port);
if (val == AUTHENTICATE_ONLY) {
ret = tb_retimer_nvm_authenticate(rt, true);
@@ -264,7 +271,8 @@ static ssize_t nvm_authenticate_store(struct device *dev,
}
exit_unlock:
- tb_retimer_unset_inbound_sbtx(rt->port);
+ if (ret || val == WRITE_ONLY)
+ tb_retimer_unset_inbound_sbtx(rt->port);
mutex_unlock(&rt->tb->lock);
exit_rpm:
pm_runtime_mark_last_busy(&rt->dev);