From patchwork Fri Sep 15 21:45:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 9953857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B9A7601C0 for ; Fri, 15 Sep 2017 21:46:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 878B32956E for ; Fri, 15 Sep 2017 21:46:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A13029571; Fri, 15 Sep 2017 21:46:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE0212956E for ; Fri, 15 Sep 2017 21:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751211AbdIOVp6 (ORCPT ); Fri, 15 Sep 2017 17:45:58 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:48266 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbdIOVp6 (ORCPT ); Fri, 15 Sep 2017 17:45:58 -0400 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23992121AbdIOVp5jFGGZ (ORCPT ); Fri, 15 Sep 2017 23:45:57 +0200 Date: Fri, 15 Sep 2017 23:45:52 +0200 From: Ladislav Michl To: linux-omap@vger.kernel.org Cc: Grygorii Strashko , Tony Lindgren Subject: [PATCH] gpio: omap: Fix lost edge interrupts Message-ID: <20170915214552.h54qifw2hxyvgmue@lenoch> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Grygorii Strashko Edge interrupts are already cleared in omap_gpio_irq_handler, so clearing them again in omap_gpio_ack_irq causes lost interrupts. Cc: stable@vger.kernel.org Signed-off-by: Grygorii Strashko Signed-off-by: Ladislav Michl --- drivers/gpio/gpio-omap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index dbf869fb63ce..a25738862129 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -811,7 +811,12 @@ static void omap_gpio_ack_irq(struct irq_data *d) struct gpio_bank *bank = omap_irq_data_get_bank(d); unsigned offset = d->hwirq; - omap_clear_gpio_irqstatus(bank, offset); + /* + * Edge GPIOs are already cleared during handling, clearing + * them here again will cause lost interrupts. + */ + if (bank->level_mask & BIT(offset)) + omap_clear_gpio_irqstatus(bank, offset); } static void omap_gpio_mask_irq(struct irq_data *d)