Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp621890pxb; Wed, 18 Aug 2021 10:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYjZUY8eLY7nJaV604FOOD/88WmZe0rV3Pa7cgKp9/ISKlIsw8o3HsUvIFkYgUKwrWlmyw X-Received: by 2002:a05:6402:375:: with SMTP id s21mr11563596edw.318.1629306169966; Wed, 18 Aug 2021 10:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629306169; cv=none; d=google.com; s=arc-20160816; b=EM+CoEVa78PKProLP+TUMjw1slPionPZtNXCpLcgF3paUBElYf3pLSeLA48RMX+xY3 tv9OvK+TJv70UfEOA0ZtGLwHjV5U313Wojeuq/c4z9U7NORjki9YZZErQtdWmtbVmtll 1VijWmIqQGP46QctV/d/gECEab/7RqJ9PRPcEGmM1FNay/A6sE2CHoRNiWbUGN/SlDyY DiaREHT6EK1l/07xALkMl3MuV3gtiXZJme0KXkE59hn/l0wo2sR5pOWBM6aYxAlm88pq ujXiINF4yGIed/GdqAt17A8+ZAHyGIuzKygfzXgwIZoh9kOEQBu4kvas8RqqmZn1xKse 9TUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=t8Qh8wDqFteJzPVzmSpQkEJ2kABIEBMzqpCRv1gAdvI=; b=RND/zHrwsOMioAVgl1p8zWlPiFKAQZBxVMFlpg+bV1ynt/4xCXgZvQDTkWoj9zaKqW baW2udPq+qZhWdUprtgWEEtM2h8v3caJthGL3WX8CmP29bdn7dOUYj9rcDIGbV5KKN+A V2qdBWsZuWwz87sqsV92RmDgJDyU9SFruz99zpUFmkTY4dWnYCtfLt0FfycTIkuCEtnN aZwNrrjG5aBQ3FOZpRqWcJMIs3cGEHIO9NxIG2/MjjNXLxBa+Zsg91YY4qNwJTNTOPal WJU7sooG9dGO1TvIzcVR7FmjqCqlfCZ1c4hC0WCpI6WBOVsQ4AeZSx1TWqvsEwQzRfYq d+ZA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si430170ejd.404.2021.08.18.10.02.12; Wed, 18 Aug 2021 10:02:49 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231800AbhHRQ67 (ORCPT + 99 others); Wed, 18 Aug 2021 12:58:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:55008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231402AbhHRQ66 (ORCPT ); Wed, 18 Aug 2021 12:58:58 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9BF0F60E09; Wed, 18 Aug 2021 16:58:23 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mGOtR-005ntG-EA; Wed, 18 Aug 2021 17:58:21 +0100 Date: Wed, 18 Aug 2021 17:58:21 +0100 Message-ID: <87czqasn9u.wl-maz@kernel.org> From: Marc Zyngier To: Valentin Schneider Cc: Guenter Roeck , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] irqchip/gic: Convert to handle_strict_flow_irq() In-Reply-To: <87k0kk7w0c.mognet@arm.com> References: <20210814194737.GA3951530@roeck-us.net> <87sfzb7jeo.mognet@arm.com> <87eeav19mc.wl-maz@kernel.org> <87k0kk7w0c.mognet@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: valentin.schneider@arm.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Aug 2021 01:30:43 +0100, Valentin Schneider wrote: > > On 15/08/21 07:54, Marc Zyngier wrote: > > This is going and-up in a wack-a-mole game. There is probably a bunch > > of these all over the place. I'd rather squash it at the root, > > i.e. with something like this (untested): > > > > diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c > > index 099bc7e13d1b..601ad3fc47cd 100644 > > --- a/kernel/irq/chip.c > > +++ b/kernel/irq/chip.c > > @@ -410,7 +410,12 @@ void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu) > > > > void ack_irq(struct irq_desc *desc) > > { > > - desc->irq_data.chip->irq_ack(&desc->irq_data); > > + struct irq_data *data = &desc->irq_data; > > + > > + while (!data->chip->irq_ack) > > + data = data->parent_data; > > + > > + data->chip->irq_ack(&desc->irq_data); > > > > if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW) > > irq_state_set_flow_masked(desc); > > > > We probably need something similar for irq_eoi(). > > > > This however shows a more fundamental problem, I'm afraid. We set > > IRQCHIP_AUTOMASKS_FLOW in the GIC drivers (i.e. at the root), but test > > for it at the top of the hierarchy. As soon as we have more than a > > single layer of irqchip, this will do the wrong thing (or at least > > miss the masking optimisation). > > > > Yup. > > > This probably advocates for moving the flag into the descriptor. This > > really makes sense, as the flow is global to the whole stack, not just > > to the localised irqchip. > > > > Are we guaranteed to have > > .irq_ack \in {NULL, irq_chip_ack_parent} > > for all intermediate (!root) irqchips? I don't see why that wouldn't > be the case, and with that in mind what you described makes sense to > me. An intermediate layer is allowed to implement its own irq_ack that is not irq_chip_ack_parent, but it then has to call irq_chip_ack_parent itself. There is the bizarre case of drivers/gpio/gpio-thunderx.c that changes the irqchip flow to use either handle_fasteoi_ack_irq or handle_fasteoi_mask_irq, which won't play very nicely with this. Someone said Cavium? > > > In order to restore -next into a working state, I'm temporarily > > dropping this series. Hopefully, we can sort this out before the merge > > window and reinstate it. > > > > I'm away from any keyboard for most of this week, but I'll get to it by the > weekend. No worries, enjoy your break! M. -- Without deviation from the norm, progress is not possible.