Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1729497iob; Thu, 5 May 2022 07:15:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfmdijEk1gN6Fi4Ef4wmeXTQcGUQ/Rs2kJj8xWnEuuLoouxgEgLzZAeEq8NFvMhGydJ7Ff X-Received: by 2002:a17:90b:33ca:b0:1d4:d5ab:40b0 with SMTP id lk10-20020a17090b33ca00b001d4d5ab40b0mr6531185pjb.96.1651760103018; Thu, 05 May 2022 07:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651760103; cv=none; d=google.com; s=arc-20160816; b=Xw3XhKA3f52hfvjaIm5uhIXTsvuc+5cewaPdaWaOW4LLeb38L8HJKhi39FQ2EDzhi4 qNxsEupnfCjr1s63aLFgJ/qu1pOmA3H/Gl85dHv3idHv2UUuhsqIBwQRwZoVLR3bepZb mEc9tHw/U0mbYttmEwyvv7UryszePosfDD0bpXSI+n9gqxVtgqDmJHlzGvPltoABEUbb IX3Yg32dh6zrT5IeQ0XIetu1JeWcrwLGxL6h8TFN7aEi2E0n61R4/bsBloPehOJ+l39e eCgh2VasuQQXOsbVsbUyLDeOwtFhFBkXK4JL1t2zVxabYpDRlLrJ7PWnFgQRru9IO6qy EymA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+hb+Z2MWWdX6KnBkxgyrWG6rTs06czCyQ3T2GwfZP18=; b=eowPOGskxdiGgNL84DSBPE8GHxfumMS5s2i4uBB23fg3fvysnUyUZOycV/tpLFEY2W CX/ZJs6BGIs3Gm9my5rd9ndFeQfIqMIsXdXWbWj/NhtuxyZuHzBPrfEZt9qih8WoNbII 3chO77xEAG1/UHHZpVYzkvq9s4K4e/TcX+MR69IRGt0V4oFLM6tcQAL+qq/09/DtVbMW jGCw3s0DrHpGrYB4NfoDGRg/saxliQxBZlSX5zcQ46nKd5vrNFs1CGRtBLdhFPzbzKNI qeAdy4/6WcvCadzi9Db0dk/0t/yrD84ZJ1wHnKItMZJzIuK61AWvNFXhvgJsVDmvqw1/ I67w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UMhjjl8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls11-20020a17090b350b00b001dc4e0e712asi9094205pjb.125.2022.05.05.07.14.46; Thu, 05 May 2022 07:15:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UMhjjl8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358066AbiEDRUX (ORCPT + 99 others); Wed, 4 May 2022 13:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355938AbiEDREr (ORCPT ); Wed, 4 May 2022 13:04:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280014FC50; Wed, 4 May 2022 09:53:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AE932B827AC; Wed, 4 May 2022 16:53:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E6A4C385A5; Wed, 4 May 2022 16:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683213; bh=mmNb0QQ6+Ixfyf+1ANzPjL3xuEFqItZxzDmgCCM79dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UMhjjl8EtzJYpjAMp5uDeIrLdDs6E6p6ME1zkfpRN1ZkteKtZWINlvk7ruF/jBfD4 XM/p/M05sODC/jaLkEikWtPwRhoKK6uGVQII2TnU4WrGV+RcYMeb7Pc7f4Ydf9Ah/1 Ela3WeBlnG3PX6adVy/8smuWxxHZMEDMprce0SJ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Vasut , Alexandre Torgue , Fabien Dessenne , Linus Walleij , Marc Zyngier , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Sasha Levin Subject: [PATCH 5.15 078/177] pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI Date: Wed, 4 May 2022 18:44:31 +0200 Message-Id: <20220504153100.054423299@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Vasut [ Upstream commit e74200ebf7c4f6a7a7d1be9f63833ddba251effa ] The stm32_gpio_get() should only be called for LEVEL triggered interrupts, skip calling it for EDGE triggered interrupts altogether to avoid wasting CPU cycles in EOI handler. On this platform, EDGE triggered interrupts are the majority and LEVEL triggered interrupts are the exception no less, and the CPU cycles are not abundant. Fixes: 47beed513a85b ("pinctrl: stm32: Add level interrupt support to gpio irq chip") Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Fabien Dessenne Cc: Linus Walleij Cc: Marc Zyngier Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org To: linux-gpio@vger.kernel.org Link: https://lore.kernel.org/r/20220415215410.498349-1-marex@denx.de Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/stm32/pinctrl-stm32.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index 8934b4878fa8..2c78af0aac57 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -311,6 +311,10 @@ static void stm32_gpio_irq_trigger(struct irq_data *d) struct stm32_gpio_bank *bank = d->domain->host_data; int level; + /* Do not access the GPIO if this is not LEVEL triggered IRQ. */ + if (!(bank->irq_type[d->hwirq] & IRQ_TYPE_LEVEL_MASK)) + return; + /* If level interrupt type then retrig */ level = stm32_gpio_get(&bank->gpio_chip, d->hwirq); if ((level == 0 && bank->irq_type[d->hwirq] == IRQ_TYPE_LEVEL_LOW) || -- 2.35.1