Received: by 10.192.165.148 with SMTP id m20csp959272imm; Wed, 2 May 2018 11:33:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpoA09Jevh01Myk8EAY6ip/omk0BFZ8jNe32Ff4QnUhGrblK17abSbGLl0ilYwGxv+Mi8Y0 X-Received: by 10.98.47.2 with SMTP id v2mr20380892pfv.239.1525285992386; Wed, 02 May 2018 11:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525285992; cv=none; d=google.com; s=arc-20160816; b=VQYlxPmB61YC8IEa8g5C3Y6p8yWpZDB2zZuyUjn1C1KKaKvadeCwAY3cNFCJRgThjf H1l3RY4eMYqsoQlRp8MD9KH/X2S4W00x/G6IUY2ak+0+5UMQSCy25+rmQuINECXBM/3b 5ALD0TePYwEl7zSMU9eXADmDpWHPPBmw/rMU+GXxPebgVC86u1AjS/U6G2U0ovYs93+c uCyD7b8ZopPtb7pzNv8bnxCZc1xOO9JL+mCCx1NPZdrJJ/Qn+PebktaUzhwVQ3775k6D MJmoza3FI5FPpp/o2pe0H2nMrXKjvIFKmZCXeJb4oWQor1hIWaqzdBVIP29Xscg1DyHk l/0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ggsOSgi2u3HW635hpp5tujki8gFfh4qkmUydJbLIVJ0=; b=zQQCTd1u20MZjGtdJ/GFdg7xiinemyPx6uiLIJBHLo9awslnhOmxY33Nc4BOwQarPY q2AfruU5IZOA9CKMfv6kPpsePQG9GGsdhVJxiwtDQhomW2S98jlSmuPJzoI2PHixEUeP 24AkaQk9yGCYBVZs6uJaIUs8hrZzbwlXNbTGAgV1nFlxQN1sZAtrFHydsvrsZKp7or9U CXhGVpKLa1k5b8EFqEMPLEgOAq+PgomzqWIDX7sJl1NYeGbTN2O64BuVp80v6/3Sxu4V 3RbvO7UZHRrXS4WxtogAziJ4A91WfQSSogUsGFaRRzIM9C+AAr+GRhNdll6GaJmmyRov 5Azg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MUFaALad; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si11865159plw.519.2018.05.02.11.32.28; Wed, 02 May 2018 11:33:12 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MUFaALad; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751054AbeEBScT (ORCPT + 99 others); Wed, 2 May 2018 14:32:19 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:42438 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbeEBScR (ORCPT ); Wed, 2 May 2018 14:32:17 -0400 Received: by mail-lf0-f65.google.com with SMTP id u21-v6so22293439lfu.9; Wed, 02 May 2018 11:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ggsOSgi2u3HW635hpp5tujki8gFfh4qkmUydJbLIVJ0=; b=MUFaALadb75qPsrbdHuehLQ8ZAkqzz7MDG533LWJa3d/Dtgd9MLL7AbpuphYlHbs4q qIeQfkPIiQi9vXy3o77RqTTIjSS5DMV9NsWs/w1j2z/Ya5fSUGIeYewOsSwM6SfhRUie W5Ghjk8XsXXRp8saqlXqFB8vG4TenhlL+gZCSphb1TFf9FwlOPYm4ai8U9RxCbskCNxs 4l57o1DVYl8PhXJyK/jncxUraKipkHFaifYkD1LHqHXsHEnpMT6eSnetVgnNhLMk5iT3 evkFmOZsnCQ7GTyO+N6eL1n6xnYQPbQDIlfKTliXZ6RMxrNxdzAR85EUmyx/dWbrwsAb PgKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ggsOSgi2u3HW635hpp5tujki8gFfh4qkmUydJbLIVJ0=; b=G4+0vcWardGVhOHBBpFnyk3S52agdwU08AvaAfXsJDHPVw8YXoTVa6bAaOksw56nZX tXWXedMo3fKo1F71btpV1woyDFZndpVZ5jKBxaQyFIkOKiAHxp/6neHsgHf1tj99nru0 wg8UA+3jQHUMIepXMmdiCKwXoq1EpGPg+8VGW4fe2ZoIu3es6BAqg40a/4mN/3Wh9U3Q DSEgGGL4JfmsWr7AKe8Wp5ABUfKDO4wQg6CDSqHQD3kjX85MSj9HCZ37mqxW7UuUv+Pe pkAsS6bRo+Okl9f6eZ+7vJRdA3st8Mo9zVzhsiACFDPRmsK0xExwOMarQK/1LdfCTBHd h3uQ== X-Gm-Message-State: ALQs6tDWA2XV5BZtkAIz9urYNscddqzqE2HL8MQEyeQeebmYfC5HkzV9 chl0sM1+UkzMWibi71Pp4jM= X-Received: by 2002:a19:2687:: with SMTP id m129-v6mr7052212lfm.132.1525285935826; Wed, 02 May 2018 11:32:15 -0700 (PDT) Received: from localhost.localdomain (apn-37-248-162-64.dynamic.gprs.plus.pl. [37.248.162.64]) by smtp.gmail.com with ESMTPSA id x67-v6sm1289978lfd.11.2018.05.02.11.32.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 11:32:14 -0700 (PDT) From: Janusz Krzysztofik To: Tony Lindgren Cc: Aaro Koskinen , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Janusz Krzysztofik Subject: [PATCH] arm: omap1: ams-delta: fix deferred_fiq handler Date: Wed, 2 May 2018 20:32:03 +0200 Message-Id: <20180502183203.16034-1-jmkrzyszt@gmail.com> X-Mailer: git-send-email 2.16.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Created and tested against linux-4.17-rc2. Signed-off-by: Janusz Krzysztofik --- arch/arm/mach-omap1/ams-delta-fiq.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c index 793a24a53c52..d7ca9e2b40d2 100644 --- 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, void *dev_id) 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); - - /* - * It looks like handle_edge_irq() that - * OMAP GPIO edge interrupts default to, - * expects interrupt already unmasked. - */ - if (irq_chip && irq_chip->irq_unmask) + if (irq_counter[gpio] < fiq_count && + gpio != AMS_DELTA_GPIO_PIN_KEYBRD_CLK) { + struct irq_data *d = irq_get_irq_data(irq_num); + + /* + * 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; } -- 2.16.1