Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3706215imm; Mon, 18 Jun 2018 02:40:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKyMisTnsIvXO//fRcTDSZTQIQ8l5rurEMmdPG34lONX6cTERuRalqlnCOVUn8V479CKTkf X-Received: by 2002:a63:a00a:: with SMTP id r10-v6mr10495509pge.222.1529314843079; Mon, 18 Jun 2018 02:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529314843; cv=none; d=google.com; s=arc-20160816; b=bN/g5zJ97iM6ppYui5RVNqQUNZ1MpaoA+/T5TNmTj0Q+BnmmQ6mERFTWdnrMUZCyA1 epTsbvG9hUsiICXvGgOk9QRQkF2nHgYI/w63CyztY5Wejzldi2FJh3/Dxwp/Hsk0ioC0 jvJ8smhRmi5MrbcgF7hC9zWl9BN/1Z+FIx464JCAmZRrlCUn38bXTiuQk0we9EQf3oKv puYiFKchKVNgbOg20Dro+dNc9moI73OigimStII5qtm0wrNwLOhztSOewLO6u8RHrNjF lGclgfeci4YluGgsoOQ0gwg+UIzgG5r974ieswW3wI0Z8IcWpz2f0rHoLQ6o8pE49tEX QMog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1YeJ41RjucDZXl9+gOIaCVF4RFUBngPQVy+2Op7OtF4=; b=d4w06aveJSYS7NwLZV6pUV/gZm0AmZbEupVlGsMXTisgykIQX0vRy++PXT5D4cxV/D ZtcvlrSjH60BBKZVh2BAwiXhAWpJ9jhlY9vt9r4+TOpITWUALs8y+UvL5KrSvqKzv7Tc JIWTtdute71yfsa+6au972PKS+1tQ6r8tErFkQY0EzdhFcGSx7QhtO99ON7epIJCY/S9 sMFA8vpkWY+Dp45jpeiiOdeYxJo/t3eidYvYNcgaTbsm3BXYiWjLhajsNzr3ZqYLgAdE z5MbHr2MxBp2HBnpOWdoGZxM5v55TExfg45hphwndJysHJLfHq83QoBSrFtSOTyoTR20 bI9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n21-v6si9992853plp.31.2018.06.18.02.40.29; Mon, 18 Jun 2018 02:40:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935965AbeFRJjQ (ORCPT + 99 others); Mon, 18 Jun 2018 05:39:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55714 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965700AbeFRIXH (ORCPT ); Mon, 18 Jun 2018 04:23:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CC8FCC7A; Mon, 18 Jun 2018 08:23:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Janusz Krzysztofik , Tony Lindgren , Sasha Levin Subject: [PATCH 4.16 169/279] ARM: OMAP1: ams-delta: fix deferred_fiq handler Date: Mon, 18 Jun 2018 10:12:34 +0200 Message-Id: <20180618080615.816817881@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Janusz Krzysztofik [ Upstream commit baf64250b4a513bf4ac226fd938692dc1836f4f6 ] The deferred_fiq handler used to limit hardware operations to IRQ unmask only, relying on gpio-omap assigned handler performing the ACKs. Since commit 80ac93c27441 ("gpio: omap: Fix lost edge interrupts") this is no longer the case as handle_edge_irq() has been replaced with handle_simmple_irq() which doesn't touch the hardware. Add single ACK operation per each active IRQ pin to the handler. While being at it, move unmask operation out of irq_counter loop so it is also called only once for each active IRQ pin. Fixes: 80ac93c27441 ("gpio: omap: Fix lost edge interrupts") Signed-off-by: Janusz Krzysztofik Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-omap1/ams-delta-fiq.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) --- a/arch/arm/mach-omap1/ams-delta-fiq.c +++ b/arch/arm/mach-omap1/ams-delta-fiq.c @@ -58,22 +58,24 @@ static irqreturn_t deferred_fiq(int irq, irq_num = gpio_to_irq(gpio); fiq_count = fiq_buffer[FIQ_CNT_INT_00 + gpio]; - while (irq_counter[gpio] < fiq_count) { - if (gpio != AMS_DELTA_GPIO_PIN_KEYBRD_CLK) { - struct irq_data *d = irq_get_irq_data(irq_num); + if (irq_counter[gpio] < fiq_count && + gpio != AMS_DELTA_GPIO_PIN_KEYBRD_CLK) { + struct irq_data *d = irq_get_irq_data(irq_num); - /* - * It looks like handle_edge_irq() that - * OMAP GPIO edge interrupts default to, - * expects interrupt already unmasked. - */ - if (irq_chip && irq_chip->irq_unmask) + /* + * handle_simple_irq() that OMAP GPIO edge + * interrupts default to since commit 80ac93c27441 + * requires interrupt already acked and unmasked. + */ + if (irq_chip) { + if (irq_chip->irq_ack) + irq_chip->irq_ack(d); + if (irq_chip->irq_unmask) irq_chip->irq_unmask(d); } - generic_handle_irq(irq_num); - - irq_counter[gpio]++; } + for (; irq_counter[gpio] < fiq_count; irq_counter[gpio]++) + generic_handle_irq(irq_num); } return IRQ_HANDLED; }