From patchwork Sun Aug 26 04:17:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 1374481 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 53233402E1 for ; Sun, 26 Aug 2012 04:19:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750875Ab2HZESN (ORCPT ); Sun, 26 Aug 2012 00:18:13 -0400 Received: from na3sys009aog135.obsmtp.com ([74.125.149.84]:37731 "EHLO na3sys009aog135.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749Ab2HZESM (ORCPT ); Sun, 26 Aug 2012 00:18:12 -0400 Received: from mail-iy0-f180.google.com ([209.85.210.180]) (using TLSv1) by na3sys009aob135.postini.com ([74.125.148.12]) with SMTP ID DSNKUDmjg0GGhsWnNp/tkQr4bDVQpIS8Xiz6@postini.com; Sat, 25 Aug 2012 21:18:12 PDT Received: by iafj25 with SMTP id j25so5117053iaf.39 for ; Sat, 25 Aug 2012 21:18:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=ZGDsXrXaA/K3tiujpLnBD1NDS2ETYfAdWJ1VMsqsLLM=; b=KfRNjLXnygiWMs1HG3DrMsTNHFB69237p4Ebbnf5jxrUzyAIOICGsfA4xOa4E6DP3v c5CEBrUGEeAd44SudusWaoKEfMKaNw5FRtihrE/Br7ib5lyxY89IsRXP2CmuFpBwXe3D gsNXZHvp5vYfYjzDx0xS5lMxUeg/aGg0GxFE9k0dAS81za0qnvPgY3nyiiQQhaqsmuuS Q+C+wdt2GOxTJszelgpyIgYdus8kVnmGofbY9qZhBg03g/8b6JtaTdHiQfnMYEnRT+fN Exp6IFo9upYTYBkGv6Yr5CKEa0bOqGD+qJlpthf5N+7DxphViiZA2tb8/nE+S7jyvrSn P2SA== Received: by 10.50.87.198 with SMTP id ba6mr6611099igb.22.1345954690956; Sat, 25 Aug 2012 21:18:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.65.85 with HTTP; Sat, 25 Aug 2012 21:17:50 -0700 (PDT) In-Reply-To: <20120825214459.7333a376@notabene.brown> References: <20120825214459.7333a376@notabene.brown> From: "Shilimkar, Santosh" Date: Sun, 26 Aug 2012 09:47:50 +0530 Message-ID: Subject: Re: [PATCH] OMAP GPIO - don't wake from suspend unless requested. To: NeilBrown Cc: Tarun Kanti DebBarma , Kevin Hilman , Tony Lindgren , Cousson@suse.de, Benoit , Grant Likely , Felipe Balbi , linux-omap@vger.kernel.org, lkml , Jon Hunter X-Gm-Message-State: ALoCoQl7DrcHCejHSagJXypHE7y8i1ZBJDNPMj2O6TegGKL/Q7Ecuxrx5T3KZ+O90KZMh9IUKI4M Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org + Jon, On Sat, Aug 25, 2012 at 5:14 PM, NeilBrown wrote: > > > > Current kernel will wake from suspend on an event on any active > GPIO even if enable_irq_wake() wasn't called. > > There are two reasons that the hardware wake-enable bit should be set: > > 1/ while non-suspended the CPU might go into a deep sleep (off_mode) > in which the wake-enable bit is needed for an interrupt to be > recognised. > 2/ while suspended the GPIO interrupt should wake from suspend if and > only if irq_wake as been enabled. > > The code currently doesn't keep these two reasons separate so they get > confused and sometimes the wakeup flags is set incorrectly. > > This patch reverts: > commit 9c4ed9e6c01e7a8bd9079da8267e1f03cb4761fc > gpio/omap: remove suspend/resume callbacks > and > commit 0aa2727399c0b78225021413022c164cb99fbc5e > gpio/omap: remove suspend_wakeup field from struct gpio_bank > > and makes some minor changes so that we have separate flags for "GPIO > should wake from deep idle" and "GPIO should wake from suspend". > > With this patch, the GPIO from my touch screen doesn't wake my device > any more, which is what I want. > > Cc: Kevin Hilman > Cc: Tony Lindgren > Cc: Santosh Shilimkar > Cc: Cousson, Benoit > Cc: Grant Likely > Cc: Tarun Kanti DebBarma > Cc: Felipe Balbi > Cc: Govindraj.R > > Signed-off-by: NeilBrown > The patch doesn't seems to be correct. At least the 2/ gets fixed with a proper IRQCHIP flag. Can you try the patch at end of the email and see if it helps ? Am attaching it in case mailer damages it. Regards Santosh From b8a38fc75e046f6462610e26c47c620cad850c24 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Sun, 26 Aug 2012 09:39:51 +0530 Subject: [PATCH] gpio: omap: Set IRQCHIP_MASK_ON_SUSPEND to mask all non-wakeup gpio wakeups. Set the irq chip flag IRQCHIP_MASK_ON_SUSPEND to cause the irq pm code to mask all non-wake gpios in suspend, which will ensure the wakeup enable bit is not set on non-wake gpios. Signed-off-by: Santosh Shilimkar --- drivers/gpio/gpio-omap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index e6efd77..50b4c18 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -779,6 +779,7 @@ static struct irq_chip gpio_irq_chip = { .irq_unmask = gpio_unmask_irq, .irq_set_type = gpio_irq_type, .irq_set_wake = gpio_wake_enable, + .flags = IRQCHIP_MASK_ON_SUSPEND; }; /*---------------------------------------------------------------------*/