usb: gadget: configfs: Correct usb functions order for UDC gadget bind
During multiple adb reboots test case, adbd is taking time to start and write the descriptors from the userspace. If adb is their in the composition and its not ready when bind happens, UDC bind for ffs will fail and adding the function back to the func_list in failure path and calling purge_configs_funcs. In purge_func adb driver unbind the functions from config->functions list and add back to the tail of the func_list. With this order of the functions in func_list got changed and next time when bind happens from adbd start usb does not working. Fix this issue by changing the order of the functions while adding the functions back to the list in purge_configs_funcs. Change-Id: I50c2362062130836d66edfcf8e1f020134248cb4 Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
This commit is contained in:
parent
2386158c7b
commit
8b8a942bd1
1 changed files with 2 additions and 2 deletions
|
@ -1259,9 +1259,9 @@ static void purge_configs_funcs(struct gadget_info *gi)
|
|||
|
||||
cfg = container_of(c, struct config_usb_cfg, c);
|
||||
|
||||
list_for_each_entry_safe(f, tmp, &c->functions, list) {
|
||||
list_for_each_entry_safe_reverse(f, tmp, &c->functions, list) {
|
||||
|
||||
list_move_tail(&f->list, &cfg->func_list);
|
||||
list_move(&f->list, &cfg->func_list);
|
||||
if (f->unbind) {
|
||||
dev_err(&gi->cdev.gadget->dev, "unbind function"
|
||||
" '%s'/%pK\n", f->name, f);
|
||||
|
|
Loading…
Add table
Reference in a new issue