From patchwork Mon Nov 25 21:26:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 3234491 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC196C045B for ; Mon, 25 Nov 2013 21:27:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 120E120177 for ; Mon, 25 Nov 2013 21:27:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 19BA620176 for ; Mon, 25 Nov 2013 21:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752308Ab3KYV1K (ORCPT ); Mon, 25 Nov 2013 16:27:10 -0500 Received: from mail-bk0-f44.google.com ([209.85.214.44]:50892 "EHLO mail-bk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098Ab3KYV1D (ORCPT ); Mon, 25 Nov 2013 16:27:03 -0500 Received: by mail-bk0-f44.google.com with SMTP id d7so2208098bkh.17 for ; Mon, 25 Nov 2013 13:27:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KvduuCPwZICu2h15i1UVp2lSIbTcBw1Vi8/7xymVNdI=; b=tnl5Hvg1G8yAkur/dBGhcCHS/HOR6z0CdDgY300RZ7J91r70Y6hMHYjcWelnJE0NO5 kV+xBt2DWImfk3QYEHlb89NZ78Tik9I1n7r1AfBD10LbtUHotCoGNZ3N+VIn9oVzyx3Z CibmKpnYmxyaa7hMjKcfDOcH27L05AN/4C9wSJN6TCTH1AtpUsD+fi9mxI+lrCtPfsn6 ZY/FhPrninmm2KPumSlbaHaIP/UzGdyLmwY8+6MMxBovQKJrPM+kiBahwPUtWtBUZsmO i0wJeLah1k+otahVHV5iMiWc+Lt5PoCUBF38n8Hcj9ri5ztENW6vc+Be5tDyAFF7JxIq F6zw== X-Received: by 10.205.33.16 with SMTP id sm16mr140860bkb.55.1385414821382; Mon, 25 Nov 2013 13:27:01 -0800 (PST) Received: from tamtam.fritz.box (p54AF4EE7.dip0.t-ipconnect.de. [84.175.78.231]) by mx.google.com with ESMTPSA id on10sm48242038bkb.13.2013.11.25.13.27.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Nov 2013 13:27:00 -0800 (PST) From: Daniel Mack To: balbi@ti.com Cc: bigeasy@linutronix.de, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, neumann@teufel.de, Daniel Mack Subject: [PATCH v2 1/4] usb: musb: unconditionally save and restore the context on suspend Date: Mon, 25 Nov 2013 22:26:40 +0100 Message-Id: <1385414803-13212-2-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1385414803-13212-1-git-send-email-zonque@gmail.com> References: <1385414803-13212-1-git-send-email-zonque@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It appears not all platforms featuring a musb core need to save the musb core registers at suspend time and restore them on resume. The dsps platform does, however, and because it shouldn't cause any trouble on other platforms, do it unconditionally for all of them. Signed-off-by: Daniel Mack --- drivers/usb/musb/musb_core.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 0a43329..797709d 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2215,16 +2215,28 @@ static int musb_suspend(struct device *dev) */ } + musb_save_context(musb); + spin_unlock_irqrestore(&musb->lock, flags); return 0; } static int musb_resume_noirq(struct device *dev) { - /* for static cmos like DaVinci, register values were preserved + struct musb *musb = dev_to_musb(dev); + + /* + * For static cmos like DaVinci, register values were preserved * unless for some reason the whole soc powered down or the USB * module got reset through the PSC (vs just being disabled). + * + * For the DSPS glue layer though, a full register restore has to + * be done. As it shouldn't harm other platforms, we do it + * unconditionally. */ + + musb_restore_context(musb); + return 0; }