Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932815AbdHVMrS (ORCPT ); Tue, 22 Aug 2017 08:47:18 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:33411 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932716AbdHVMrQ (ORCPT ); Tue, 22 Aug 2017 08:47:16 -0400 MIME-Version: 1.0 In-Reply-To: <1502439824-18733-1-git-send-email-rushikesh.s.kadam@intel.com> References: <1502439824-18733-1-git-send-email-rushikesh.s.kadam@intel.com> From: Linus Walleij Date: Tue, 22 Aug 2017 14:47:15 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: intel: Disable GPIO pin interrupts in suspend To: Rushikesh S Kadam Cc: Mika Westerberg , Heikki Krogerus , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Thomas Gleixner , rajneesh.bhardwaj@intel.com, andy@infradead.org, "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1744 Lines: 37 On Fri, Aug 11, 2017 at 10:23 AM, Rushikesh S Kadam wrote: > The fix prevents unintended wakes from second level GPIO pin interrupts. > > On some Intel Kabylake platforms, it is observed that GPIO pin interrupts > can wake the platform from suspend-to-idle, even though the IRQ is not > configured as IRQF_NO_SUSPEND or enable_irq_wake(). > > This can cause undesired wakes on Mobile devices such as Laptops and > Chromebook devices. For example a headset jack insertion is not a desired > wake source on Chromebook devices. > > The pinctrl-intel (GPIO controller) driver implements a "Shared IRQ" model. > All GPIO pin interrupts are OR'ed and mapped to a first level IRQ14 (or > IRQ15). The driver registers an irq_chip struct and maps an irq_domain for > the GPIO pin interrupts. The IRQ14 handler demuxes and calls the second > level IRQ for the respective pin. > > In the suspend entry flow, at suspend_noirq stage, the kernel disables IRQs > that are not marked for wake. The pinctrl-intel driver does not implement a > irq_disable() callback (to take advantage of lazy disabling). The > pinctrl-intel GPIO interrupts are not disabled in hardware during suspend > entry, and thus are able to wake the SoC out of suspend-to-idle. > > This patch sets the IRQCHIP_MASK_ON_SUSPEND flag for the GPIO irq_chip, to > disable the second level interrupts at suspend_noirq stage via the irq_mask > callbacks. The irq_mask callback disables the IRQs in hardware by > programming the corresponding GPIO pad registers. Only IRQs that are not > marked for wake are disabled. > > Signed-off-by: Rushikesh S Kadam Excellent work, patch applied with the collected ACKs. Yours, Linus Walleij