Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1482936pxb; Fri, 20 Aug 2021 06:37:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrgKrA471SLrQtGnTszs3yTQm0EV/u1mk1z5vnhaXjV2hYjeRzrKhS5nr/3d6fSXn5IA+k X-Received: by 2002:a5d:83c4:: with SMTP id u4mr16262823ior.21.1629466672143; Fri, 20 Aug 2021 06:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629466672; cv=none; d=google.com; s=arc-20160816; b=FURoUqnd/tQAgcNmouQbO1T/aaAHV5am2fJAP0VB2Ol/l1QYsV6+t2jRLyL9Ao+1HH zlsmeZsb8QkW/Fljeknj/s8AkjOmft8+KtcSkkSykl5qBb0i3MrwQPu8u2Ck79S59I2G 6bEHgZZBpMEGAmonKOw7KjVODw946c1DpVcv+BBiQBeWQptoKl0pR4bswlVZGK8Nsikj JMlBFi0dKjfXmQlfTX5PJJXsf6rU8jzd8un0sRpm6YA031+s7y9YDuacY6HmaWhwAxud +8NpgU1+9phg7XNqKLJj4wy/Bsab91TZMhFyYtxFBODJFbSHyUlmHs31s8D96L6lpgWx HM9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=b0s3bahhvH4Mry2JfJKxiDVBMWk8q8usPOxiMSkcYTE=; b=LHySxG0Lafgdn4YUQd23hJy1RI8yQDMy0/3Sr3T8l/8zYD+9z1NcOa814C2Nmg3A1n GoI7QNIkcJlIEWTEueg9062TPQ0b1q1LK5YIDh4gciiXD+/6aUwNdXOME2dsXf12syB7 oacxLYdSs53ic3RUkaqY5iv61Qf6++v3P+RRgj2ob/jd3yB0XhJX9OqIxbdn0j2YCK5G +Ls/icG/eLM50kGrfQZ3iG9jB6snTsOS/C3D8CETBOVJlnRjeKFXWOoX88oH0ynYvgVL EIfgo6A7Hn/4qITjpukoS9FhFjSRfJGgLe3imQtq8sJrZq6ht+xsvtouMLjc8vZ2DQI4 mtkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=j5tsGFYJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si152937ilu.26.2021.08.20.06.37.40; Fri, 20 Aug 2021 06:37:52 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=j5tsGFYJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240739AbhHTNfZ (ORCPT + 99 others); Fri, 20 Aug 2021 09:35:25 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:53582 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233028AbhHTNfX (ORCPT ); Fri, 20 Aug 2021 09:35:23 -0400 Date: Fri, 20 Aug 2021 13:34:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1629466485; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b0s3bahhvH4Mry2JfJKxiDVBMWk8q8usPOxiMSkcYTE=; b=j5tsGFYJhE4dv0BahW0Pz8aE0xcaoayXyqZLWKZkG3PZYIi3fQyVekQ4frf2nP7aa9Mqul sR+sGhZwv42i3v4oC4X4UgBCsZBeI0E2LfJZpkqlCB9XBlOMrBw4Zq3wo6/JeOauFoahVE CLM5S6aqocFoIAmG5n1e2dpJrxmpFxG2f53Q1q4E9ucOY/vzW55AviIeKMu/36MqZQ+Tdr YP89+hLzUn+PUdcYUASrbR/jXEgsu3T3ckZlAwNY7HD+F3pms1H99NDKyFGAQmYJQped8Q JrWRubKI9xCu0zJyArLpvRypjkvNAnE0xFTqxWA5b/qG/SZEvxujDxifVXKYpg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1629466485; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b0s3bahhvH4Mry2JfJKxiDVBMWk8q8usPOxiMSkcYTE=; b=febQrq0Ugna9g4XHFvvdUbeaxarnN9uFgOMSDyx1FvpxaH7PaEo1qLvKot6uEixhfGoxaQ RHiQbQ5Ithn87DDQ== From: "irqchip-bot for Sven Peter" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/apple-aic: Fix irq_disable from within irq handlers Cc: Sven Peter , Hector Martin , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20210812100942.17206-1-sven@svenpeter.dev> References: <20210812100942.17206-1-sven@svenpeter.dev> MIME-Version: 1.0 Message-ID: <162946648413.25758.10370643723543390409.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 60a1cd10b222e004f860d14651e80089c77e8e6b Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/60a1cd10b222e004f860d14651e80089c77e8e6b Author: Sven Peter AuthorDate: Thu, 12 Aug 2021 12:09:42 +02:00 Committer: Marc Zyngier CommitterDate: Fri, 20 Aug 2021 14:32:33 +01:00 irqchip/apple-aic: Fix irq_disable from within irq handlers When disable_irq_nosync for an interrupt is called from within its interrupt handler, this interrupt is only marked as disabled with the intention to mask it when it triggers again. The AIC hardware however automatically masks the interrupt when it is read. aic_irq_eoi then unmasks it again if it's not disabled *and* not masked. This results in a state mismatch between the hardware state and the state kept in irq_data: The hardware interrupt is masked but IRQD_IRQ_MASKED is not set. Any further calls to unmask_irq will directly return and the interrupt can never be enabled again. Fix this by keeping the hardware and irq_data state in sync by unmasking in aic_irq_eoi if and only if the irq_data state also assumes the interrupt to be unmasked. Fixes: 76cde2639411 ("irqchip/apple-aic: Add support for the Apple Interrupt Controller") Signed-off-by: Sven Peter Acked-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210812100942.17206-1-sven@svenpeter.dev --- drivers/irqchip/irq-apple-aic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c index b8c06bd..6fc145a 100644 --- a/drivers/irqchip/irq-apple-aic.c +++ b/drivers/irqchip/irq-apple-aic.c @@ -226,7 +226,7 @@ static void aic_irq_eoi(struct irq_data *d) * Reading the interrupt reason automatically acknowledges and masks * the IRQ, so we just unmask it here if needed. */ - if (!irqd_irq_disabled(d) && !irqd_irq_masked(d)) + if (!irqd_irq_masked(d)) aic_irq_unmask(d); }