Commit f5054240 authored by Xu Yang's avatar Xu Yang Committed by sanglipeng
Browse files

usb: chipidea: core: fix possible concurrent when switch role

stable inclusion
from stable-v5.10.177
commit 09671cfc2b22fa1a4cec29464205d9ac62f821e5
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=09671cfc2b22fa1a4cec29464205d9ac62f821e5



--------------------------------

commit 451b15ed upstream.

The user may call role_store() when driver is handling
ci_handle_id_switch() which is triggerred by otg event or power lost
event. Unfortunately, the controller may go into chaos in this case.
Fix this by protecting it with mutex lock.

Fixes: a932a804 ("usb: chipidea: core: add sysfs group")
cc: <stable@vger.kernel.org>
Acked-by: default avatarPeter Chen <peter.chen@kernel.org>
Signed-off-by: default avatarXu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20230317061516.2451728-2-xu.yang_2@nxp.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent a2db108f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment