From patchwork Thu Nov 19 15:01:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 57019 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3231074lbb; Thu, 19 Nov 2015 07:01:40 -0800 (PST) X-Received: by 10.67.22.99 with SMTP id hr3mr11109427pad.10.1447945300095; Thu, 19 Nov 2015 07:01:40 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oe8si12774933pbc.12.2015.11.19.07.01.39; Thu, 19 Nov 2015 07:01:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-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 linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758755AbbKSPBh (ORCPT + 4 others); Thu, 19 Nov 2015 10:01:37 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:49832 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758737AbbKSPBg (ORCPT ); Thu, 19 Nov 2015 10:01:36 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id tAJF1VR4014674; Thu, 19 Nov 2015 09:01:31 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAJF1VVD031151; Thu, 19 Nov 2015 09:01:31 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Thu, 19 Nov 2015 09:01:30 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAJF1Tkr004657; Thu, 19 Nov 2015 09:01:30 -0600 From: Felipe Balbi To: Linux USB Mailing List CC: Robert Jarzmik , Robert Baldyga , Felipe Balbi , "# v3 . 10+" Subject: [PATCH] usb: gadget: pxa27x: fix suspend callback Date: Thu, 19 Nov 2015 09:01:27 -0600 Message-ID: <1447945287-12698-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.6.3 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 | 1 + 1 file changed, 1 insertion(+) -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" 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..a08ae19ca410 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -2535,6 +2535,7 @@ static int pxa_udc_suspend(struct platform_device *_dev, pm_message_t state) udc_disable(udc); udc->pullup_resume = udc->pullup_on; dplus_pullup(udc, 0); + udc->driver->disconnect(&udc->gadget); return 0; }