]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
usb: dwc2: drd: reset current session before setting the new one
authorAmelie Delaunay <amelie.delaunay@foss.st.com>
Tue, 5 Oct 2021 09:53:05 +0000 (11:53 +0200)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:31 +0000 (09:48 +0100)
commitefedf259459f41e26d45b98758fc38faffd513ec
tree7161eedbb1bee0f01e6ee60955d7bcd0b357ab38
parent851e6fc941a19fe53fa6bf355666a0f753f98f93
usb: dwc2: drd: reset current session before setting the new one

BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit 1ad707f559f7cb12c64f3d7cb37f0b1ea27c1058 ]

If role is changed without the "none" step, A- and B- valid session could
be set at the same time. It is an issue.
This patch resets A-session if role switch sets B-session, and resets
B-session if role switch sets A-session.
Then, it is possible to change the role without the "none" step.

Fixes: 17f934024e84 ("usb: dwc2: override PHY input signals with usb role switch support")
Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20211005095305.66397-4-amelie.delaunay@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/usb/dwc2/drd.c