Hi Qing,Not sure if I understood your scenario. Why there is a deadlock here?
I suspect there is potential dead-lock with this patch:
cpu0 cpu1
driver_deferred_probe_add deferred_probe_work_func
... mutex_unlock(&deferred_probe_mutex)
mutex_lock(&deferred_probe_mutex) bus_probe_device(dev)
... device return -EPROBE_DEFER
... driver_deferred_probe_add
... mutex_lock(&deferred_probe_mutex)
... <deadlock!>
cancel_delayed_work(&deferred_probe_trigger_work)
<work will never end - deadlock!>
Please confirm if this scenario is possible.
BR, Shamir Rabinovitch