From patchwork Thu Nov 19 19:51:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 57046 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp56666lbb; Thu, 19 Nov 2015 11:51:20 -0800 (PST) X-Received: by 10.68.114.36 with SMTP id jd4mr13116023pbb.135.1447962680127; Thu, 19 Nov 2015 11:51:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qp8si13550222pac.135.2015.11.19.11.51.19; Thu, 19 Nov 2015 11:51:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756889AbbKSTvT (ORCPT + 2 others); Thu, 19 Nov 2015 14:51:19 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:35879 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756555AbbKSTvS (ORCPT ); Thu, 19 Nov 2015 14:51:18 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id tAJJpGUY004928; Thu, 19 Nov 2015 13:51:16 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAJJpGW5003413; Thu, 19 Nov 2015 13:51:16 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 19 Nov 2015 13:51:16 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAJJpFmR003081; Thu, 19 Nov 2015 13:51:15 -0600 From: Felipe Balbi To: Linux USB Mailing List CC: , Felipe Balbi , "# v3 . 10+" Subject: [PATCH] usb: gadget: pxa27x: fix suspend callback Date: Thu, 19 Nov 2015 13:51:13 -0600 Message-ID: <1447962673-21509-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <8737w1942u.fsf@belgarion.home> References: <8737w1942u.fsf@belgarion.home> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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(). Cc: # v3.10+ Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/pxa27x_udc.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index 670ac0b12f00..001a3b74a993 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -2536,6 +2536,9 @@ static int pxa_udc_suspend(struct platform_device *_dev, pm_message_t state) udc->pullup_resume = udc->pullup_on; dplus_pullup(udc, 0); + if (udc->driver) + udc->driver->disconnect(&udc->gadget); + return 0; }