]> git.baikalelectronics.ru Git - kernel.git/commit
thunderbolt: Do not call PM runtime functions in tb_retimer_scan()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 29 Dec 2022 12:10:30 +0000 (14:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:24:37 +0000 (07:24 +0100)
commit765ae2f50b42f6c01e0e0e58e3505794aa667fb5
tree55c8097ecd3111d239c367090fd67a4241151199
parente2915be3a2f5e66898f13ec95bce15e8ea12b7e1
thunderbolt: Do not call PM runtime functions in tb_retimer_scan()

commit 23257cfc1cb7202fd0065e9f4a6a0aac1c04c4a9 upstream.

We cannot call PM runtime functions in tb_retimer_scan() because it will
also be called when retimers are scanned from userspace (happens when
there is no device connected on ChromeOS for instance) and at the same
USB4 port runtime resume hook. This leads to hang because neither can
proceed.

Fix this by runtime resuming USB4 ports in tb_scan_port() instead. This
makes sure the ports are runtime PM active when retimers are added under
it while avoiding the reported hang as well.

Reported-by: Utkarsh Patel <utkarsh.h.patel@intel.com>
Fixes: f357a354f425 ("thunderbolt: Runtime resume USB4 port when retimers are scanned")
Cc: stable@vger.kernel.org
Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/retimer.c
drivers/thunderbolt/tb.c