From patchwork Thu Oct 25 16:51:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dromede@gmail.com X-Patchwork-Id: 1645971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 35FCCDF2AB for ; Thu, 25 Oct 2012 16:53:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TRQf6-0004N2-VT; Thu, 25 Oct 2012 16:52:05 +0000 Received: from mail-bk0-f49.google.com ([209.85.214.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TRQf2-0004LO-Jm for linux-arm-kernel@lists.infradead.org; Thu, 25 Oct 2012 16:52:01 +0000 Received: by mail-bk0-f49.google.com with SMTP id j4so815532bkw.36 for ; Thu, 25 Oct 2012 09:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=uNjUl92SHMaOS42Mx+5xXoCf17bNMIRhXXZbV8/FlS8=; b=LFyeN00xPUFz9M7CC+dwNUu8pR4BYL6R9xMr21OSZue6mm1g+i/SDKEuLKOzMEa+Ay 8HzS2eZ7Oui0WoTVpMPwNlz3Yk9kTNMKe4fv9U8jRjr9c4DQ5byNFrv+iuOv4UWGG9Oy j1BQl35wIhZPWBX8ssIVZ3/CDaEOiiKJH4XfzU3bSf0wksWl2yCVADgEMNhR3zM4K9gQ klRWQ8gKwUIkoqfH1Iuq2QRuBPyOJheftoRuvxmfKcHi+ymVQz1bHguAnbGbPzqcMfzC iPFLdcYcqu0zskN0uZ1b1Ki1/ytvF21nBRNrcpphQIjiakXsCdORgOSbgUZ2GDZxUHaQ L6BA== Received: by 10.204.147.89 with SMTP id k25mr6154576bkv.127.1351183917957; Thu, 25 Oct 2012 09:51:57 -0700 (PDT) Received: from localhost.localdomain (93-139-142-243.adsl.net.t-com.hr. [93.139.142.243]) by mx.google.com with ESMTPS id ht18sm10798398bkc.14.2012.10.25.09.51.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Oct 2012 09:51:57 -0700 (PDT) From: dromede@gmail.com To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] [ARM] pxa/spitz_pm.c: Fix hang under certain conditions when resuming from STR. Date: Thu, 25 Oct 2012 18:51:38 +0200 Message-Id: <1351183898-12856-1-git-send-email-dromede@gmail.com> X-Mailer: git-send-email 1.7.4.1 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dromede[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: eric.y.miao@gmail.com, haojian.zhuang@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Marko Katic Devices that use spitz_pm.c will fail to resume from STR (Suspend To Ram) when the charger plug is inserted or removed when a device is in STR mode. The culprit is a misconfigured gpio line - GPIO18. GPIO18 should be configured as a regular GPIO input but it gets configured as an alternate function GPIO18_RDY. And then later in postsuspend() it gets configured as a regular GPIO18 input line. Fix this by removing the GPIO18_RDY configuration so that GPIO18 only gets configured as a regular gpio input. Signed-off-by: Marko Katic --- arch/arm/mach-pxa/spitz_pm.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 438f02f..842596d 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c @@ -86,10 +86,7 @@ static void spitz_discharge1(int on) gpio_set_value(SPITZ_GPIO_LED_GREEN, on); } -static unsigned long gpio18_config[] = { - GPIO18_RDY, - GPIO18_GPIO, -}; +static unsigned long gpio18_config = GPIO18_GPIO; static void spitz_presuspend(void) { @@ -112,7 +109,7 @@ static void spitz_presuspend(void) PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); - pxa2xx_mfp_config(&gpio18_config[0], 1); + pxa2xx_mfp_config(&gpio18_config, 1); gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown"); gpio_free(18); @@ -131,7 +128,6 @@ static void spitz_presuspend(void) static void spitz_postsuspend(void) { - pxa2xx_mfp_config(&gpio18_config[1], 1); } static int spitz_should_wakeup(unsigned int resume_on_alarm)