mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: fix possible regression introduced with ep->claimed
@ 2015-08-21  9:01 Robert Baldyga
  2015-08-21 15:00 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Baldyga @ 2015-08-21  9:01 UTC (permalink / raw)
  To: balbi; +Cc: stern, r.baldyga, linux-usb, linux-kernel, Robert Baldyga

This patch fixes possible regression introduced by patch reworking endpoint
claiming mechanism. It restores setring ep->driver_data to NULL in
usb_ep_autoconfig_reset(), which was removed by patch [1].

[1] commit cc476b42a39d ("usb: gadget: encapsulate endpoint claiming
    mechanism")

Reported-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---

Hi Felipe,

I was not able to reproduce the problem that you have described (functions
trying to enable eps that are already enabled, and disable eps that are
already disabled), but I have analysed the problem and I have concluded
that the only possible cause of regression can be that my patch removed
setting ep->driver_data to NULL in usb_ep_autoconfig_reset() function.
Because of this change initial state of ep->driver_data could be non-NULL
value, which could change behavoiur of some functions. I can't imagine
any other possible cause of regression introduced by such simple patch.

Thanks,
Robert

 drivers/usb/gadget/epautoconf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 978435a..6399c10 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -186,6 +186,7 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget)
 
 	list_for_each_entry (ep, &gadget->ep_list, ep_list) {
 		ep->claimed = false;
+		ep->driver_data = NULL;
 	}
 	gadget->in_epnum = 0;
 	gadget->out_epnum = 0;
-- 
1.9.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-21 20:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-21  9:01 [PATCH] usb: gadget: fix possible regression introduced with ep->claimed Robert Baldyga
2015-08-21 15:00 ` Felipe Balbi
2015-08-21 20:22   ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®