From patchwork Wed Aug 12 17:45:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 7003511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 912FAC05AC for ; Wed, 12 Aug 2015 17:49:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 990C320670 for ; Wed, 12 Aug 2015 17:49:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A47D920553 for ; Wed, 12 Aug 2015 17:49:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZPa7I-0005XI-QE; Wed, 12 Aug 2015 17:47:08 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZPa75-0005RD-KW for linux-arm-kernel@lists.infradead.org; Wed, 12 Aug 2015 17:46:56 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t7CHk8lS013015; Wed, 12 Aug 2015 12:46:08 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7CHk8Cv002827; Wed, 12 Aug 2015 12:46:08 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Wed, 12 Aug 2015 12:46:08 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7CHk7NR027924; Wed, 12 Aug 2015 12:46:07 -0500 From: Grygorii Strashko To: , , Subject: [PATCH v2 2/6] genirq: fix irqchip_set_wake_parent if IRQCHIP_SKIP_SET_WAKE Date: Wed, 12 Aug 2015 20:45:58 +0300 Message-ID: <1439401562-28874-3-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1439401562-28874-1-git-send-email-grygorii.strashko@ti.com> References: <1439401562-28874-1-git-send-email-grygorii.strashko@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150812_104655_890579_5975E491 X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Grygorii Strashko , linux@arm.linux.org.uk, jason@lakedaemon.net, nsekhar@ti.com, linux-kernel@vger.kernel.org, balbi@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The irqchip_set_wake_parent should not fail if IRQ chip specifies IRQCHIP_SKIP_SET_WAKE. Otherwise, IRQ wakeup configuration can't be propagated properly through IRQ domains hierarchy. In case of TI OMAP DRA7 the issue reproduced with following configuration: ARM GIC<-OMAP wakeupgen<-TI CBAR<-GPIO<-GPIO pcf857x<-gpio_key gpio_key is wakeup source Failure is reproduced during suspend/resume to RAM: suspend: - gpio_keys_suspend enable_irq_wake + pcf857x_irq_set_wake + omap_gpio_wake_enable + TI CBAR irq_chip_set_wake_parent + OMAP wakeupgen has no .irq_set_wake() and -ENOSYS will be returned resume: - gpio_keys_resume + disable_irq_wake + irq_set_irq_wake + WARN(1, "Unbalanced IRQ %d wake disable\n", irq); Fixes: 08b55e2a9208 ('genirq: Add irqchip_set_wake_parent') Signed-off-by: Grygorii Strashko --- kernel/irq/chip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 6de638b..bdb1b9d 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -1024,6 +1024,10 @@ int irq_chip_set_vcpu_affinity_parent(struct irq_data *data, void *vcpu_info) int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on) { data = data->parent_data; + + if (irq_data_get_irq_chip(data)->flags & IRQCHIP_SKIP_SET_WAKE) + return 0; + if (data->chip->irq_set_wake) return data->chip->irq_set_wake(data, on);