From patchwork Tue Nov 26 12:31:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 3238931 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E81689F3A0 for ; Tue, 26 Nov 2013 12:31:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4ADE920134 for ; Tue, 26 Nov 2013 12:31:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B951203B5 for ; Tue, 26 Nov 2013 12:31:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756729Ab3KZMbY (ORCPT ); Tue, 26 Nov 2013 07:31:24 -0500 Received: from mail-bk0-f46.google.com ([209.85.214.46]:43126 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756672Ab3KZMbW (ORCPT ); Tue, 26 Nov 2013 07:31:22 -0500 Received: by mail-bk0-f46.google.com with SMTP id u15so2532832bkz.19 for ; Tue, 26 Nov 2013 04:31:20 -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=4+At6g3b8jBJwPvcsSY87+CZSOz/4UXg5WwHxEuQP2Y=; b=qFkFg1sXlT/UqOEGfS9OvbPzZybnKd5MPHRV7FCns3oTHrXvlLXjXoFE2mQonWcCWC vPOk5ek79/bg7m1EXQz4CmdSuL0MBgz6p9So635CAE24wIUGeTBMo9bvEkeNx+WhCVw2 J/cvzYTOlGyUzs1Y/knA2zmkoCudZ60vF2lmeIRVydSFKcQ4QJmR4w+0oYhkCyxaNRio xuybXhZxBYRIvXWmbdfDvOBQp2ORYvzoLx+UnFeI/AjnLDZsFNVSgTEquLuCWGWPquIk bBnVGEtsmPYOMwz6fS6GK/3WWMvJN3UDxC4hTjohBLDugAv+Xyeb1a/xjQustK3iS6yW YGJQ== X-Received: by 10.204.100.193 with SMTP id z1mr144354bkn.53.1385469080912; Tue, 26 Nov 2013 04:31:20 -0800 (PST) Received: from tamtam.fritz.box ([2001:4dd0:ff00:9394:224:d7ff:fec6:a0ec]) by mx.google.com with ESMTPSA id b7sm50912648bkg.1.2013.11.26.04.31.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Nov 2013 04:31:20 -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 v4 1/4] usb: musb: unconditionally save and restore the context on suspend Date: Tue, 26 Nov 2013 13:31:11 +0100 Message-Id: <1385469074-19312-2-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1385469074-19312-1-git-send-email-zonque@gmail.com> References: <1385469074-19312-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 should cause any trouble on other platforms, do it unconditionally. 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; }