diff options
author | Peter Chen <peter.chen@nxp.com> | 2017-03-14 13:57:39 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:25:57 +0800 |
commit | 3ca4c52bd3e0e20149a94ab4b163e81762f8a5dd (patch) | |
tree | 7c373564e95884e3a0bbdb9efa73b1beaa1f9261 /drivers/usb/chipidea/core.c | |
parent | 5f69ffe2713ae0c6137e3317f732b613ea0b8f80 (diff) |
MLK-14396 usb: chipidea: add mutex for concurrent running
The ci_handle_id_switch is called at two places, at very rare situations,
it may be running at the same time. Eg, when the system is back from
the resume, the id event is occurred from extcon driver, as well as
power_lost work item is called due to the controller is poweroff at
the suspend.
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r-- | drivers/usb/chipidea/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 73fbcf4c7721..1a83465eee36 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -1125,6 +1125,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) /* Init workqueue for controller power lost handling */ INIT_WORK(&ci->power_lost_work, ci_power_lost_work); + mutex_init(&ci->mutex); ret = dbg_create_files(ci); if (ret) |