From patchwork Mon Mar 9 22:14:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 10719 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n29MD8N4025972 for ; Mon, 9 Mar 2009 22:14:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbZCIWO3 (ORCPT ); Mon, 9 Mar 2009 18:14:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751780AbZCIWO3 (ORCPT ); Mon, 9 Mar 2009 18:14:29 -0400 Received: from mail-ew0-f177.google.com ([209.85.219.177]:38607 "EHLO mail-ew0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751575AbZCIWO2 (ORCPT ); Mon, 9 Mar 2009 18:14:28 -0400 Received: by ewy25 with SMTP id 25so1037422ewy.37 for ; Mon, 09 Mar 2009 15:14:26 -0700 (PDT) Received: by 10.216.20.210 with SMTP id p60mr2360992wep.172.1236636865648; Mon, 09 Mar 2009 15:14:25 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id f4sm2880052nfh.46.2009.03.09.15.14.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Mar 2009 15:14:24 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org Subject: [PATCH omap-fixes v2] OMAP2/3: GPIO: do not attempt to wake-enable GPIO bank IRQ Date: Mon, 9 Mar 2009 15:14:20 -0700 Message-Id: <1236636860-2804-1-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.1.2 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The GPIO IRQ enable/disable path attempts to also enable IRQ wake support for the parent GPIO bank IRQ as well. However, since there is no 'set_wake' hook for the bank IRQs, these calls will always fail. Also, since the enable will fail on the suspend path, the disable on the resume path will trigger unbalanced enable/disable warnings. This was discovered in the suspend/resume path on OMAP3/Beagle using the gpio-keys driver which disables/re-enables GPIO IRQ wakeups in the suspend/resume path. Signed-off-by: Kevin Hilman --- This patch was sent on 28 jan 2009 as: [PATCH omap-fixes] OMAP2/3: GPIO: remove recursion in IRQ wakeup path This version simply updates the description to better describe the problem and solution. arch/arm/plat-omap/gpio.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index f856a90..798a8cd 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -837,13 +837,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) case METHOD_MPUIO: case METHOD_GPIO_1610: spin_lock_irqsave(&bank->lock, flags); - if (enable) { + if (enable) bank->suspend_wakeup |= (1 << gpio); - enable_irq_wake(bank->irq); - } else { - disable_irq_wake(bank->irq); + else bank->suspend_wakeup &= ~(1 << gpio); - } spin_unlock_irqrestore(&bank->lock, flags); return 0; #endif @@ -856,13 +853,10 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) return -EINVAL; } spin_lock_irqsave(&bank->lock, flags); - if (enable) { + if (enable) bank->suspend_wakeup |= (1 << gpio); - enable_irq_wake(bank->irq); - } else { - disable_irq_wake(bank->irq); + else bank->suspend_wakeup &= ~(1 << gpio); - } spin_unlock_irqrestore(&bank->lock, flags); return 0; #endif