]> git.itanic.dy.fi Git - linux-stable/commit
usb: typec: tcpm: Try PD-2.0 if sink does not respond to 3.0 source-caps
authorHans de Goede <hdegoede@redhat.com>
Sat, 16 Mar 2019 15:57:12 +0000 (16:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Sep 2019 06:22:09 +0000 (08:22 +0200)
commit3cfce8b77aad06fbd2e43b3ae847ad8bd78334b0
tree33da75a374322ba147130833a2773234d1c5d5ba
parentfba4f7c118e4a8c0eb23e8eccaca1f1a30892506
usb: typec: tcpm: Try PD-2.0 if sink does not respond to 3.0 source-caps

[ Upstream commit 976daf9d1199932df80e7b04546d1a1bd4ed5ece ]

PD 2.0 sinks are supposed to accept src-capabilities with a 3.0 header and
simply ignore any src PDOs which the sink does not understand such as PPS
but some 2.0 sinks instead ignore the entire PD_DATA_SOURCE_CAP message,
causing contract negotiation to fail.

This commit fixes such sinks not working by re-trying the contract
negotiation with PD-2.0 source-caps messages if we don't have a contract
after PD_N_HARD_RESET_COUNT hard-reset attempts.

The problem fixed by this commit was noticed with a Type-C to VGA dongle.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/typec/tcpm.c