From patchwork Wed Aug 22 20:41:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 144857 Delivered-To: patch@linaro.org Received: by 2002:a2e:164a:0:0:0:0:0 with SMTP id 10-v6csp401611ljw; Wed, 22 Aug 2018 13:41:37 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwvHPGOkMyFne5nQYR7f57Y7DxW3d8OWSZqxZVubpag9cWMvpznauOWQq4MuwXH5bx9NrZ7 X-Received: by 2002:a63:d916:: with SMTP id r22-v6mr52898629pgg.381.1534970497079; Wed, 22 Aug 2018 13:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534970497; cv=none; d=google.com; s=arc-20160816; b=pGwbA+jIB7dhphX5ID8X7mvqhqVqMSivOiUJmz6KOzXv13/sDJCqwgBYLOyUEEU+bY KF9fV8tRw1h62oAAeS1HqGIGB5o/hb2U5MgsTEExjt/QdMOspBYK5sU5BqIzpvzKIx2V tPVjKAzjuE3Jkw3s6AIIvy/AQ6ASPcyGd3AunqWaGnIgRRCAFGsBd7pEqArKgS764NJj SRcuTzRMErzE7dD3+tGj9H/VZn+vYH82lDMB34DLG0hZ7vrIhFRp/jmCp8T+cjuNqjU0 W8uD5ji3XhLZzb3bXAfg/qgluvrrCY84ppVqogmlz6WV/KXFWkM1Fkql+y9iApGKNpxR WIBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=+UwefDXh4P3wfTzsSfvtpWRGxLEovImVzBLhuTW/X0U=; b=xt+heaqotAsnP1qWybk0LzDui9Rp6r09xjvsjYJY48gj6tWsxAFA23e8Pp1fhF5gBa C0OgfMwgjNYwT84d5INxqhxWcmZlKZcKYWHTfJoO3PSGRr0xLhsaDnORNmNQnF2M+zK3 pC+wn40dwtGgg82ZpjpVyKzK0kr/2d8ETDE/SC/pygupNOYH3WPBvszVPwhO7lqh+dmw cEaPisznocCPYs5+nzvls3LSezUZmATI28fyNTBcGu/iPi9sL0uNUM7l1sWrBfI5nFxg 8j2E8hTG0illzcnr1BPhc6o0ai/fMfUD0uJNu3buoBfmgIei4KvDHUjXSdK6+Ylvg0iS z8mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UdBy42H8; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23-v6si2559068pgi.301.2018.08.22.13.41.36; Wed, 22 Aug 2018 13:41:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=@linaro.org header.s=google header.b=UdBy42H8; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727467AbeHWAH7 (ORCPT + 5 others); Wed, 22 Aug 2018 20:07:59 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:46699 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727395AbeHWAH7 (ORCPT ); Wed, 22 Aug 2018 20:07:59 -0400 Received: by mail-lj1-f193.google.com with SMTP id 203-v6so2428066ljj.13 for ; Wed, 22 Aug 2018 13:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+UwefDXh4P3wfTzsSfvtpWRGxLEovImVzBLhuTW/X0U=; b=UdBy42H8OeFnQDXC+PD47SlY612ms/viUbekBtgBeiJsRnBk6TYdldMVmkqDrw1nVx VdKHtbNUPmeWKIvuXVXKdaJXmkZmlQ/sa3n1yR7y2G14lZHnRA45C1v9nXuRNUpsDOhp bQKrg+O4YSvhqDxG4Lt1Up/LqpBmZXV92X7HQ= 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:in-reply-to :references; bh=+UwefDXh4P3wfTzsSfvtpWRGxLEovImVzBLhuTW/X0U=; b=oQi5DE11Hh0NdyzAO3kZoqA0r2qYd9n7nmjLA9UF5T0Nk2izd/UdpZf8sX07tLSKo8 hn+P+O1cJQ0vUy6+xzyOvGS6Q8F0nocQOvSMYbXa5egMyeDoQaKvirGI7JvS6VPTWUdQ jFY2ZMiQVmJWDsgych+hwxg7tSBBzPkZrEsTjtbr5hWS+2GWWAciHuR0agkOr2iLakDk z0IJYYiX1MZlWmLx5QYxIJd5clI0WMjMXf5AfSWfD+2kxpy4rkfzQPxyutDIPN36phyo Z82Q8BTs5/usoYDfaekI+LkzJJALc0ouNDzs/znFUNBAzO5gHhsSiHYza2ewmsiUpOm8 d2qA== X-Gm-Message-State: AOUpUlFKj0yPCPvRiYdKVIj+esUnwyWFip9aIp6krCLbA2wCN092xeKe oyGCO61ydmSdsICmUwvIzw77uw== X-Received: by 2002:a2e:9d45:: with SMTP id y5-v6mr40376932ljj.136.1534970494348; Wed, 22 Aug 2018 13:41:34 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id q128-v6sm431515ljq.72.2018.08.22.13.41.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Aug 2018 13:41:33 -0700 (PDT) From: Linus Walleij To: H Hartley Sweeten , Alexander Sverdlin Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, Linus Walleij Subject: [PATCH 06/11] gpio: ep93xx: Properly call the chained IRQ handler Date: Wed, 22 Aug 2018 22:41:06 +0200 Message-Id: <20180822204111.9581-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180822204111.9581-1-linus.walleij@linaro.org> References: <20180822204111.9581-1-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The chained irq handler should call chained_irq_enter() and chained_irq_exit() before/after handling the chained IRQ. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-ep93xx.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c index a81d1e796912..ce7e88df9cc5 100644 --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c @@ -88,9 +88,12 @@ static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc) { struct gpio_chip *gc = irq_desc_get_handler_data(desc); struct ep93xx_gpio *epg = gpiochip_get_data(gc); + struct irq_chip *irqchip = irq_desc_get_chip(desc); unsigned char status; int i; + chained_irq_enter(irqchip, desc); + status = readb(epg->base + EP93XX_GPIO_A_INT_STATUS); for (i = 0; i < 8; i++) { if (status & (1 << i)) { @@ -106,6 +109,8 @@ static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc) generic_handle_irq(gpio_irq); } } + + chained_irq_exit(irqchip, desc); } static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc) @@ -115,11 +120,14 @@ static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc) * * IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7}) */ + struct irq_chip *irqchip = irq_desc_get_chip(desc); unsigned int irq = irq_desc_get_irq(desc); int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */ int gpio_irq = gpio_to_irq(16) + port_f_idx; + chained_irq_enter(irqchip, desc); generic_handle_irq(gpio_irq); + chained_irq_exit(irqchip, desc); } static void ep93xx_gpio_irq_ack(struct irq_data *d)