From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from devils.ext.ti.com ([198.47.26.153]:33368 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbbKSTsr (ORCPT ); Thu, 19 Nov 2015 14:48:47 -0500 From: Felipe Balbi To: Robert Jarzmik CC: Linux USB Mailing List , Robert Baldyga , "# v3 . 10+" Subject: Re: [PATCH] usb: gadget: pxa27x: fix suspend callback In-Reply-To: <8737w1942u.fsf@belgarion.home> References: <1447945287-12698-1-git-send-email-balbi@ti.com> <8737w1942u.fsf@belgarion.home> Date: Thu, 19 Nov 2015 13:48:38 -0600 Message-ID: <87oaepepnt.fsf@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: stable-owner@vger.kernel.org List-ID: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Robert Jarzmik writes: > Felipe Balbi writes: > >> pxa27x disconnects pullups on suspend but doesn't >> notify the gadget driver about it, so gadget driver >> can't disable the endpoints it was using. >> >> This causes problems on resume because gadget core >> will think endpoints are still enabled and just >> ignore the following usb_ep_enable(). >> >> Fix this problem by calling >> gadget_driver->disconnect(). > Thanks for doing this for me. >> @@ -2535,6 +2535,7 @@ static int pxa_udc_suspend(struct platform_device = *_dev, pm_message_t state) >> udc_disable(udc); >> udc->pullup_resume =3D udc->pullup_on; >> dplus_pullup(udc, 0); >> + udc->driver->disconnect(&udc->gadget); > If no driver is bound, this will segfault, right ? > Shouldn't an "if (udc->driver)" protect this line ? good catch. v2 coming shortly. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWTieXAAoJEIaOsuA1yqRE61kQAI13bjjcufcpoDkjBD3WBIB4 /qN3lYiXgcyrVeIiXKI9eCzhSd4kMrr+7DEvBnClHuzwGwBKGk6JrvpMkZrKcIfE Bq0665KH3JCQgNuV0P9yaRlZAIfjTuKAo18Y+YJQ4r4OX2cHFNLKQeTjvOyjTMx/ 0NR4u08Am6lZuaox8WFITThJQoaQxOrGhjaBBNcvThhSp6VCxkD0jf6uxldKFRwg 134Cwkv1M0EF46h1U2IlOg61O5np8lw5114G/o1eXY+qZAh+b8jMVxQSXVu5AHmV xNQ4OL5q4efZBGmwa1KO6O1GP+c/09dLZJ5SGYN2l5QHYRonUuobKeWBsTDFrPtK hrwnrukvH2kQ0/BM0dVWRIifDtY9UozT8IMeE+m3Oytde9xQDVOBi2EhKcDbVb0M ewmkRWpesEZk85hQFhweHpEZdXb0KIf27HCu6ClSmqMU0zg0Ufz1BMqVN2akhnmf Ic8Gfk+QdmvYvkX9HW9LyGhA3hlLit2E95QnzCokaetI14K/kl22vTCFrjieWORW Mwf7MjGS80u+q7zSbIySjmRKgHq7irRoVzM9VdHocQI2hxFJWcteV+tWlzkfZkp+ aWjGQ4GxoXcmTBVnlnt65HIVYkFVJyDR9zXqqC6zPPROfLM5SIesrww0kPbobrwW XNqEZiR4xH2jyR0HZ9/F =AKs0 -----END PGP SIGNATURE----- --=-=-=--