From patchwork Mon Jan 12 16:04:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 5611301 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 133C89F357 for ; Mon, 12 Jan 2015 16:05:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3EA592064F for ; Mon, 12 Jan 2015 16:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62E282064B for ; Mon, 12 Jan 2015 16:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbbALQEh (ORCPT ); Mon, 12 Jan 2015 11:04:37 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:44057 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbbALQEd (ORCPT ); Mon, 12 Jan 2015 11:04:33 -0500 Received: from ayla.of.borg ([84.193.93.87]) by andre.telenet-ops.be with bizsmtp id f44X1p00t1t5w8s0144XAu; Mon, 12 Jan 2015 17:04:31 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1YAhTj-0004zp-Hu; Mon, 12 Jan 2015 17:04:31 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1YAhTm-0001YB-Uu; Mon, 12 Jan 2015 17:04:34 +0100 From: Geert Uytterhoeven To: Linus Walleij , Alexandre Courbot , Thomas Gleixner Cc: Santosh Shilimkar , linux-gpio@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH resend 2/2] [RFC] genirq: Set IRQCHIP_SKIP_SET_WAKE for no_irq_chip and dummy_irq_chip Date: Mon, 12 Jan 2015 17:04:31 +0100 Message-Id: <1421078671-5920-2-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421078671-5920-1-git-send-email-geert+renesas@glider.be> References: <1421078671-5920-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If no_irq_chip or dummy_irq_chip are used for wake up (e.g. gpio-keys with a simple GPIO controller), the following warning is printed on resume from s2ram: WANING: CPU: 0 PID: 1046 at kernel/irq/manage.c:537 irq_set_irq_wake+0x9c/0xf8() Unbalanced IRQ 113 wake disable This happens because no_irq_chip and dummy_irq_chip do not implement irq_chip.irq_set_wake(), causing set_irq_wake_real() to return -ENXIO, and irq_set_irq_wake() to reset the wake_depth to zero. Set IRQCHIP_SKIP_SET_WAKE to indicate that irq_chip.irq_set_wake() is not implemented. Signed-off-by: Geert Uytterhoeven --- Alternatively, can't we remove IRQCHIP_SKIP_SET_WAKE, and just check for the presence of irq_chip.irq_set_wake()? I'll be happy to send a patch to do that instead... Is there anything that relies on this -ENXIO error code? All irq_chip implementations that set IRQCHIP_SKIP_SET_WAKE do not implement irq_chip.irq_set_wake(). There are probably more of them that forgot to set IRQCHIP_SKIP_SET_WAKE though. Am I missing something? Commit 60f96b41f71d2a13 ("genirq: Add IRQCHIP_SKIP_SET_WAKE flag") doesn't explain why adding the flag was chosen. Thanks! --- Resend: Use Santosh' new email address kernel/irq/dummychip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/irq/dummychip.c b/kernel/irq/dummychip.c index 988dc58e8847f6eb..326a67f2410bf95c 100644 --- a/kernel/irq/dummychip.c +++ b/kernel/irq/dummychip.c @@ -42,6 +42,7 @@ struct irq_chip no_irq_chip = { .irq_enable = noop, .irq_disable = noop, .irq_ack = ack_bad, + .flags = IRQCHIP_SKIP_SET_WAKE, }; /* @@ -57,5 +58,6 @@ struct irq_chip dummy_irq_chip = { .irq_ack = noop, .irq_mask = noop, .irq_unmask = noop, + .flags = IRQCHIP_SKIP_SET_WAKE, }; EXPORT_SYMBOL_GPL(dummy_irq_chip);