From patchwork Mon Nov 28 16:26:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 84424 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1210655qgi; Mon, 28 Nov 2016 08:26:32 -0800 (PST) X-Received: by 10.99.102.69 with SMTP id a66mr41054144pgc.49.1480350392863; Mon, 28 Nov 2016 08:26:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si55876310pfg.259.2016.11.28.08.26.32; Mon, 28 Nov 2016 08:26:32 -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; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.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 S932955AbcK1Q0b (ORCPT + 4 others); Mon, 28 Nov 2016 11:26:31 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36503 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932406AbcK1Q02 (ORCPT ); Mon, 28 Nov 2016 11:26:28 -0500 Received: by mail-wm0-f44.google.com with SMTP id g23so211151576wme.1 for ; Mon, 28 Nov 2016 08:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EFlz0jbUjpzLyklSkAZS404lYdgFfyv/mDJVoJ+5Dqo=; b=podzSs96x4c2Co3ZA+CPEbUwXihF1pXfQPYPQO6fn32BbSgfglfikA80tAjFNWkkdq yrWa85KfX9AVI2rpOb3/r+Cw0Jsee2tbSpIh75eoTpweJxKZx17a/UCwM5YcSGWLttwx NwNTJR1GNv34JguCCxY0D+V0N/CJ40Gig9POT1XoHXbV0ecEDIN/oUA0FSOSQEd28bSD 1iOQho+Gsmz3iCUa3Rc1jC56w8HzJy+9t6ndujjtD5UBMaCYVts8pUBRqm6kwrtggJqa rQT/0/mmzGrxVnU/aaxJvxk6yVd//B9zixbHU7iHYnnBZUvKjHtrKzzFyD7PGeFQJOMz 4+NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EFlz0jbUjpzLyklSkAZS404lYdgFfyv/mDJVoJ+5Dqo=; b=YYAWnmAk537Kvo1zPu5UQKJiJLAb50bF9b4Fb3sbnv/1Zk91nTC9VC4elBtevhs+Iz okM06wgizFbQ4eWzTrcJyPf4XWlMpKGOA5aoGsu0h6g1sqyc8Qf6v63qFUlAn5/lP7Hg jBhL3VuRHEA3lMFugF8u+BJnOYrO4DJcKCTAzylSyKZqVWhGn31AaoN2yPvGXvbwO/F7 K1WOn/nvKHmnS9y5MBFsT3hbc/JBgYiMlYkFdsUCZ20l4ae8b3vY7RCdfHd1mdByfKkN 3Ss7kNFtoTuSWUlrZZlv2pYzPXrBKk06kXB/F2vXIy8oyk9WrMV29QhBPmIAgOWPLd1V i1/g== X-Gm-Message-State: AKaTC00ODc8xJv+5SpLtp8QayKEf6B+E22Flo2Nns0YQGbGZLYBeBPT5Vu636ldCE15+kcn6 X-Received: by 10.28.183.215 with SMTP id h206mr21066128wmf.60.1480350386182; Mon, 28 Nov 2016 08:26:26 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id t82sm29710641wmd.17.2016.11.28.08.26.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 08:26:25 -0800 (PST) From: Alexandre Bailon To: b-liu@ti.com Cc: linux-usb@vger.kernel.org, nsekhar@ti.com, khilman@baylibre.com, ptitiano@baylibre.com, Alexandre Bailon Subject: [PATCH 3/3] usb: musb: da8xx: Fix host mode suspend Date: Mon, 28 Nov 2016 17:26:21 +0100 Message-Id: <1480350381-26151-4-git-send-email-abailon@baylibre.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1480350381-26151-1-git-send-email-abailon@baylibre.com> References: <1480350381-26151-1-git-send-email-abailon@baylibre.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On da8xx, VBUS is not maintained during suspend when musb is in host mode. On resume, all the connected devices will be disconnected and then will be enumerated again. This happens because MUSB_DEVCTL is cleared during suspend. MUSB_DEVCTL is clear twice: once by da8xx_musb_disable() and once musb_generic_disable(). Don't clear MUSB_DEVCTL in da8xx_musb_disable() and use the quirk MUSB_PRESERVE_DEVCTL to preseve MUSB_DEVCTL during suspend. Signed-off-by: Alexandre Bailon --- drivers/usb/musb/da8xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.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/musb/da8xx.c b/drivers/usb/musb/da8xx.c index 905f0d9..90f0c06 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -125,7 +125,6 @@ static void da8xx_musb_disable(struct musb *musb) musb_writel(reg_base, DA8XX_USB_INTR_MASK_CLEAR_REG, DA8XX_INTR_USB_MASK | DA8XX_INTR_TX_MASK | DA8XX_INTR_RX_MASK); - musb_writeb(musb->mregs, MUSB_DEVCTL, 0); musb_writel(reg_base, DA8XX_USB_END_OF_INTR_REG, 0); } @@ -458,7 +457,8 @@ static inline u8 get_vbus_power(struct device *dev) } static const struct musb_platform_ops da8xx_ops = { - .quirks = MUSB_DMA_CPPI | MUSB_INDEXED_EP, + .quirks = MUSB_DMA_CPPI | MUSB_INDEXED_EP | + MUSB_PRESERVE_DEVCTL, .init = da8xx_musb_init, .exit = da8xx_musb_exit,