Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4510559pxv; Tue, 29 Jun 2021 08:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUtKmJIloYK1t9U2PvrdRsZ0Llz6vpBMfeC9sSpamqBioauhauIliUg5n6Ihlcm22TgSIi X-Received: by 2002:a17:906:38c6:: with SMTP id r6mr18203141ejd.411.1624981145887; Tue, 29 Jun 2021 08:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624981145; cv=none; d=google.com; s=arc-20160816; b=bBI6loa6WYPTp9R9tJ/wFx68o/E4gZVl8wGOrFBe01vfk1PCRO3rXhD3VLEtywdVGn fqhzDnpMrjvgZHQPnFG64d8Ay9jx72bO67duRcS0h5ZdWoLbrlJ0EaQIf3d0G3suGd+g OwkHHoQd9ae8jaGRPxvJgcZ0ZfNJJhQxMdlnFK4Bc6iRKj4im9dcUwOV3EsxE9ssABRe jbljZKp7R/9dGbIRrT04IlSXiWqfI+unMKe4aIf3sTYEw7rGEQp8zPNI4IJq9na4PqEX zsD1WaBJmp9ul99mi1milszNjOfVRurh6aYjLg268pB+mA1qHE7pepKPEp8/e+8Rkor5 s6ug== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/nsp2hI/kFD+QYVhzf+h4uhvyzlv6qEIbt48Kd1UpfE=; b=O39P5C5yndtxDIPH+l8ww1pH9Yxrdx6vW/FEJSOznwoUjq1hQAL1YNeGv4XJw1slBI Ckdp85Hv3Pz9wSmQP971ibRFTFf4E4IX5Em2CN73Wui+H8kqBW+cZU+FwmYV/YiesBP8 GoyYAEvbGwpfKQwKVZ+ea6msP9xl7vpxTmH1536ZJZBA61qcTqsYGvTyu3hOaRdUUxx9 BBlhgyzgoy7riXZOk7cmZ1ZWNWzygl5kfGXpUz2MtbHj6MVY0BM7Q5hVY0k8SdOzKYCK X4LyqLzyruQ/8OTQLal4Pm+r908XFD1V599FLkhSHPVUP/w6+Y+uh/JMsRoMIap2zUgv Xslg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f14si20755682ejx.530.2021.06.29.08.38.36; Tue, 29 Jun 2021 08:39:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233460AbhF2Mx1 (ORCPT + 99 others); Tue, 29 Jun 2021 08:53:27 -0400 Received: from foss.arm.com ([217.140.110.172]:50376 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233827AbhF2MxQ (ORCPT ); Tue, 29 Jun 2021 08:53:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E886111D4; Tue, 29 Jun 2021 05:50:48 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E7F3E3F718; Tue, 29 Jun 2021 05:50:47 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , Thomas Gleixner , Lorenzo Pieralisi , Vincenzo Frascino Subject: [PATCH v3 02/13] genirq: Define ack_irq() and eoi_irq() helpers Date: Tue, 29 Jun 2021 13:49:59 +0100 Message-Id: <20210629125010.458872-3-valentin.schneider@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629125010.458872-1-valentin.schneider@arm.com> References: <20210629125010.458872-1-valentin.schneider@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The newly-added IRQCHIP_AUTOMASKS_FLOW flag requires some additional bookkeeping around chip->{irq_ack, irq_eoi}() calls. Define wrappers around those chip callbacks to drive the IRQD_IRQ_FLOW_MASKED state of an IRQ when the chip has the IRQCHIP_AUTOMASKS_FLOW flag. Signed-off-by: Valentin Schneider --- kernel/irq/chip.c | 16 ++++++++++++++++ kernel/irq/internals.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 21a21baa1366..793dbd8307b9 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -408,6 +408,22 @@ void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu) cpumask_clear_cpu(cpu, desc->percpu_enabled); } +void ack_irq(struct irq_desc *desc) +{ + desc->irq_data.chip->irq_ack(&desc->irq_data); + + if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW) + irq_state_set_flow_masked(desc); +} + +void eoi_irq(struct irq_desc *desc) +{ + desc->irq_data.chip->irq_eoi(&desc->irq_data); + + if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW) + irq_state_clr_flow_masked(desc); +} + static inline void mask_ack_irq(struct irq_desc *desc) { if (desc->irq_data.chip->irq_mask_ack) { diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index b6c1cceddec0..6d6a621dc74c 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -87,6 +87,8 @@ extern void irq_enable(struct irq_desc *desc); extern void irq_disable(struct irq_desc *desc); extern void irq_percpu_enable(struct irq_desc *desc, unsigned int cpu); extern void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu); +extern void ack_irq(struct irq_desc *desc); +extern void eoi_irq(struct irq_desc *desc); extern void mask_irq(struct irq_desc *desc); extern void unmask_irq(struct irq_desc *desc); extern void unmask_threaded_irq(struct irq_desc *desc); -- 2.25.1