From patchwork Sun Mar 10 00:46:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 2242711 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8A9683FCF6 for ; Sun, 10 Mar 2013 00:47:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751307Ab3CJAq4 (ORCPT ); Sat, 9 Mar 2013 19:46:56 -0500 Received: from mail-ee0-f42.google.com ([74.125.83.42]:56323 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237Ab3CJAqz (ORCPT ); Sat, 9 Mar 2013 19:46:55 -0500 Received: by mail-ee0-f42.google.com with SMTP id b47so1679610eek.29 for ; Sat, 09 Mar 2013 16:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=7HqC96OdKn1ppjWPP6ZzSYP0wISpyvdPk97cD9gJluc=; b=v3aD7ipijcYF27nORmmB+TsR3+8MWDWnD+KYf9uYQ5hdjsNiqFOiNL2tryHiEc4ukr dBTeqgIFL9/VetXRli97f0GJiDmiGdzQBJTR3Ztq1tmL4Z+SjGDi+29gfFerzyYmuMJY ymk1MWr4FnKof7/U53UtJJmbR40gw6djVJmT/ecCxSJp8wuxNR/ztbSn+XJipZLlFIKB XsipQMiU6eAxTwK24c2/Whci2xkqb9ugtd/qLG5lTn7IcdFLiUIR1YUMBcBzKXhw8D9Y sXSWhdYdmr7rlVm6CNwaX1uMxgQVie/ZdNcNdeZLiAjfED9/IvCmj6zMRgIwWgM3sd0g BAwQ== X-Received: by 10.14.211.65 with SMTP id v41mr20678669eeo.33.1362876414130; Sat, 09 Mar 2013 16:46:54 -0800 (PST) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt. [88.119.226.136]) by mx.google.com with ESMTPS id z45sm15662460eeu.10.2013.03.09.16.46.51 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Mar 2013 16:46:52 -0800 (PST) From: Grazvydas Ignotas To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Tony Lindgren , Paul Walmsley , Grazvydas Ignotas Subject: [PATCH] ARM: OMAP3: hwmod data: disable MIDLEMODE control for musb Date: Sun, 10 Mar 2013 02:46:31 +0200 Message-Id: <1362876391-6801-1-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org For some unknown reason, allowing hwmod to control MIDLEMODE causes core_pwrdm to not hit idle states for musb in DM3730 at least. I've verified that setting any MIDLEMODE value other than "force standby" before enabling the device causes subsequent suspend attempts to fail with core_pwrdm not entering idle states, even if the driver is unloaded and "force standby" is restored before suspend attempt. Keeping the register set at force standby (reset value) makes it work and device still functions properly. musb has driver-controlled OTG_FORCESTDBY register that controls MSTANDBY signal, so perhaps MIDLEMODE is not even needed? Note that TI PSP kernels also have similar workarounds. Signed-off-by: Grazvydas Ignotas --- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index ac7e03e..0388bba 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -1666,11 +1666,15 @@ static struct omap_hwmod_class_sysconfig omap3xxx_usbhsotg_sysc = { .rev_offs = 0x0400, .sysc_offs = 0x0404, .syss_offs = 0x0408, - .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE| - SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | - SYSC_HAS_AUTOIDLE), - .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | - MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), + /* + * musb has MMIDLEMODE, but if we ever enable the device not in force + * idle mode, core_pwrdm does not enter idle states at least on 36xx. + * Note that musb also has OTG_FORCESTDBY register that the driver + * uses to control MSTANDBY signal manually. + */ + .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP | + SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), .sysc_fields = &omap_hwmod_sysc_type1, };