Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions drivers/thunderbolt/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,20 @@ int tb_domain_resume_noirq(struct tb *tb)
int ret = 0;

mutex_lock(&tb->lock);
if (!tb->noirq_ctl_retained)
tb_ctl_start(tb->ctl);
if (tb->cm_ops->resume_noirq)
ret = tb->cm_ops->resume_noirq(tb);
/*
* End the hold before resume_noirq(), where a stopped channel would be
* started: hotplug events and XDomain responses then reach the
* connection manager from the same point as without the hold. Requests
* still wait for tb->lock, which is held until the resume is done.
*/
if (tb->noirq_ctl_retained) {
WRITE_ONCE(tb->noirq_ctl_retained, false);
tb_dbg(tb, "XDomain control channel remained active\n");
} else {
tb_ctl_start(tb->ctl);
}
if (tb->cm_ops->resume_noirq)
ret = tb->cm_ops->resume_noirq(tb);
mutex_unlock(&tb->lock);

return ret;
Expand Down
5 changes: 4 additions & 1 deletion drivers/thunderbolt/xdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,10 @@ static void stop_handshake(struct tb_xdomain *xd)

/*
* The XDomain discovery requests answered while the control channel is kept
* through s2idle (tb->noirq_ctl_retained): they only read state.
* through s2idle (tb->noirq_ctl_retained). They change no state: UUID and
* properties are answered from memory, and LINK_STATE_STATUS_REQUEST reads
* the downstream port's registers, under tb->lock, from a host router that
* stays powered (QUIRK_NO_SYSTEM_SLEEP).
*/
static bool tb_xdp_noirq_request(enum tb_xdp_type type)
{
Expand Down
Loading