Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753323AbbHUPBA (ORCPT ); Fri, 21 Aug 2015 11:01:00 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:33249 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbbHUPA7 (ORCPT ); Fri, 21 Aug 2015 11:00:59 -0400 Date: Fri, 21 Aug 2015 10:00:50 -0500 From: Felipe Balbi To: Robert Baldyga CC: , , , , Subject: Re: [PATCH] usb: gadget: fix possible regression introduced with ep->claimed Message-ID: <20150821150050.GB527@saruman.tx.rr.com> Reply-To: References: <1440147689-1157-1-git-send-email-r.baldyga@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A6N2fC+uXW/VQSAv" Content-Disposition: inline In-Reply-To: <1440147689-1157-1-git-send-email-r.baldyga@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3346 Lines: 93 --A6N2fC+uXW/VQSAv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 21, 2015 at 11:01:29AM +0200, Robert Baldyga wrote: > This patch fixes possible regression introduced by patch reworking endpoi= nt > claiming mechanism. It restores setring ep->driver_data to NULL in > usb_ep_autoconfig_reset(), which was removed by patch [1]. >=20 > [1] commit cc476b42a39d ("usb: gadget: encapsulate endpoint claiming > mechanism") >=20 > Reported-by: Felipe Balbi > Signed-off-by: Robert Baldyga > --- >=20 > Hi Felipe, >=20 > 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 it happens with all, you can't see it because dwc3 (only) has a WARN() for when an endpoint is enabled and has previously been enabled (drivers/usb/dwc3/gadget.c). If you track your endpoint's state regarding being enabled or not, you can add a WARN() to see the error. > 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. yeah, I'll test this later. >=20 > Thanks, > Robert >=20 > drivers/usb/gadget/epautoconf.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoc= onf.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 *gadg= et) > =20 > list_for_each_entry (ep, &gadget->ep_list, ep_list) { > ep->claimed =3D false; > + ep->driver_data =3D NULL; > } > gadget->in_epnum =3D 0; > gadget->out_epnum =3D 0; > --=20 > 1.9.1 >=20 --=20 balbi --A6N2fC+uXW/VQSAv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV1z0iAAoJEIaOsuA1yqREHngP/0d2M63FHVK7qjMIFufIh2gm qsnDp9O87q7G/w2j4rAvUcX/jew72J0hf1IRhw20C0TA04vBKT9xg4x8uMraQ2JN CHl4w/C66JeEIe305tq86+ZqRWosyoqlAvxgwRzJFsq9VaadhTwmuwrJHLkBqmfm kGi/0rePNe7rlRhTEFGjKN3gdEiU3PiLDhQ/gACiEXQovcQn6BPWFVd+tGVobODZ X0e+ofY0dTUhjSlAXL6XxOmT4OBxIqtCUsJDRIIHzIx/y9PSXnTXGb2MGTkvlxEX OzraYeo1qTWK/u0uFK5DVCUFu1rRaAxhfdwm+/pOSJlQf9QNthW9m5fPyJ//nG26 AsIHZ1qfburFsUSC2L4HOhxOWOiUHFDvz8qyDmOLHm+ZIcetPlFTXSx5sY6QktCJ 9iKVhPtvhGchX5nCkJa3lmzjJ0JEm/OPFTA1MXrsZagBHwk59FFgsVHw1BL3KkOp oWDUrCBDN4tg0s2xPLTtDPdUebjUx6tNhUyzDSLHXK6hwH5HBruBt0mwuUbb27QJ 9XL12C5VAcfnaKohTp7IzuWv6bkk4E6YQA8uIJDz/VcAgeMCd0rsZkApvmTh/rWW K3LMV7dwL96sU9G6YpitYI3k0007CNMIFWZzyGPNi9y7HqEPZoNO3zE1CjDB4ArQ jzD5ony1lumPJZi+UZh2 =7+OO -----END PGP SIGNATURE----- --A6N2fC+uXW/VQSAv-- -- 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/