Hi Alan,

On 12/06/2016 09:21 PM, Alan Stern wrote:
> Krzysztof:
> 
> Your patch doesn't address a bug that has been present in
> usb_add_gadget_udc_release() for some time.  If the bind callback fails
> with any error other than -EPROBE_DEFER, the driver remains unbound to
> the gadget but it is not added back on to the
> gadget_driver_pending_list.  As a result, when the driver is
> unregistered, the list_del() call will cause problems.
> 

You are absolutely right. I have never claimed that I fixed anything
more than described in commit msg;)

> There's a good reason not to add the driver back on to the list: If 
> it's not working then we don't want to keep trying to probe it over and 
> over again.  I think the best thing to do would be 
> list_del_init(&driver->pending), so that at least unregistration won't 
> cause an oops.
> 

Sounds reasonable. I will submit a patch for this.

> There's another thing.  If the bind callback fails, why not continue 
> the loop in check_pending_gadget_drivers()?  Maybe another pending 
> driver will succeed.  (Of course, to do this would require using 
> list_for_each_entry_safe instead of list_for_each_entry.)

Yah. True. That's how probing drivers for devices usually works. I'll
submit a patch for this.

@Felipe
Please ignore this patch. I will post it together with fixes suggested
by Alan in a series so they can be easily applied without ordering problems.

Best regards,
-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to