mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
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>
This commit is contained in:
parent
1402ba08ab
commit
b7b83911f7
1 changed files with 9 additions and 1 deletions
|
@ -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,6 +271,7 @@ static ssize_t nvm_authenticate_store(struct device *dev,
|
|||
}
|
||||
|
||||
exit_unlock:
|
||||
if (ret || val == WRITE_ONLY)
|
||||
tb_retimer_unset_inbound_sbtx(rt->port);
|
||||
mutex_unlock(&rt->tb->lock);
|
||||
exit_rpm:
|
||||
|
|
Loading…
Reference in a new issue