Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753485AbbHUJBx (ORCPT ); Fri, 21 Aug 2015 05:01:53 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:58202 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbbHUJBv (ORCPT ); Fri, 21 Aug 2015 05:01:51 -0400 X-AuditID: cbfee61b-f79706d000001b96-9a-55d6e8f7fdfd From: Robert Baldyga To: balbi@ti.com Cc: stern@rowland.harvard.edu, r.baldyga@hackerion.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Baldyga Subject: [PATCH] usb: gadget: fix possible regression introduced with ep->claimed Date: Fri, 21 Aug 2015 11:01:29 +0200 Message-id: <1440147689-1157-1-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJJMWRmVeSWpSXmKPExsVy+t9jAd3vL66FGqy7b2Bx8H69xeVdc9gs Fi1rZba4++8To8WDwzvZLSb8vsDmwOZxZOcxNo/Zd38wevRtWcXocfzGdiaPz5vkAlijuGxS UnMyy1KL9O0SuDKmn9jBXtDNU7F69jzmBsY2ri5GTg4JAROJ5RefsEDYYhIX7q1nA7GFBJYy Siy4KdjFyAVk/2SUmNr5jAkkwSagI7Hl+wRGEFtEQEBi/YtL7CBFzAKzGSX+TGtmB0kICwRL fNhzDWwqi4CqROPKecwgNq+Ai8SrQ5cYIbbJSZw8Npl1AiP3AkaGVYwSqQXJBcVJ6blGeanl esWJucWleel6yfm5mxjBAfJMegfj4V3uhxgFOBiVeHhnRF4LFWJNLCuuzD3EKMHBrCTCK/gY KMSbklhZlVqUH19UmpNafIhRmoNFSZxX32RTqJBAemJJanZqakFqEUyWiYNTqoFxu++PE4EM +7NdGwvMziUq3d73vWSC0bTHuybXTlVf0pCQOtlqxz2D2lsXN+2tzbineu7UlM9NcXNPPtzR Fvw1I/+CenazXUxytNPnNznxe+bt5vISrYjhnJUafufeCZM9imWfA37lcDzaYL6P7/+L4N7X E+W3+Yhfa5586OCyfTyVFnde+IllKrEUZyQaajEXFScCAAWyfHAMAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1749 Lines: 48 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 Signed-off-by: Robert Baldyga --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/