usb: typec: retimer: Add missing id check in match callback
authorNícolas F. R. A. Prado <nfraprado@collabora.com>
Mon, 25 Jul 2022 20:31:29 +0000 (16:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2022 12:37:26 +0000 (14:37 +0200)
commit0c34043897736a3fac259564a6323a1f045100bb
treef796bc1aa7a7ec20106165eefbfc093dc51a3de8
parent13da6f41fbe01afc4937aabef87950223d52c83f
usb: typec: retimer: Add missing id check in match callback

The fwnode_connection_find_match() function handles two cases: named
references and graph endpoints. In the second case, the match function
passed in is called with the id to check for the match. However, the
match function for the recently added type-c retimer class assumes the
connection has already been matched (which is only true for the first
case).

The result is that with that change, all type-c nodes with graph
endpoints defer probe indefinitely, independently of having a retimer
connection or not.

Add the missing check, like is done by the type-c mux and usb role
switch code, to fix the issue.

Fixes: ddaf8d96f93b ("usb: typec: Add support for retimers")
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20220725203129.1973260-1-nfraprado@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/retimer.c