From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D594C47DD9 for ; Sun, 25 Feb 2024 16:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fxxsPCbxqc+ukdKbK1jOT2ckQL+UedFXRQtzvxIWvQk=; b=Giz/hh18HTmrw1 FLgXuvaQ7FICuvMlgi5yqmV1soBpNEL1HL66ZiyW/9xRpTkI4e/59IRQlcOT5S5hY3j7/nT18yckS cVZkZElmNr8ChAP0g76cmggtUZhlEgBz+5HmWBLRcEvOpuae+SBEqW3bSZB5bZaiH6EHCc+pH4USJ DOmwAdX1/kSnfZ8LKsseaLKoafkhWqpvbophEeP9xynknagMKPwuOl+k8xkpeHxJQVqDZPz3fRqWF fDuA/4BG+NOSH3Vb35oc8+cafnY04kKDO7RT9f7r0j0ZzGHczoe8sOHjLUOfZuGLHHzb8V4b+Y8K1 61W74UK0bxVEzJX3A6Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1reHEf-0000000FHzU-0c71; Sun, 25 Feb 2024 16:20:17 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1reHEO-0000000FHvM-2fiI for linux-arm-kernel@lists.infradead.org; Sun, 25 Feb 2024 16:20:15 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708877993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PlSwHlYyP4A1LQLM6WxxKKT7h2/VeDpm0ciAvRcDloc=; b=Ci6fGVPi67dsuI+pA8wRiO25XadBUbZBt36zP0dmEbN50AKebM2LZjqtdgtn2s4HVcC1mR MMwPatCc0oWsi3WlxwYxsSsoj47FmlcBW/W+g92RCrbSTmkNCIWn973Bxtwp+jOT0LkcxK MQifHIbvnnbzOCRfvhXL+yEBgHqptfpp1Vipvw5BoYSP+n3ZlESRq6oqJzXTuiaqHg2iZg GN3E906V0ld40MNo8+sr8C6MGyU9vW0O/EliL6k9dhk2zTMss97TiUk1dKai91bfHqI3sz Q6kN5Aa6GVvR1wHCSCp2i7agqbcf0w9oC/h3Z1hzjmv5EOjuUfLWkr3qybt6WQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708877993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PlSwHlYyP4A1LQLM6WxxKKT7h2/VeDpm0ciAvRcDloc=; b=OTbLn3FOnEx7pXryJfAuqowgc2oH0s2w7hymW0tm0P9Gisl4Db/QiKQv6gJqvVYOjzE595 6AW0Tuq8RIG6EIDw== To: Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Dmitry Baryshkov , Biju Das , x86@kernel.org Subject: Re: [PATCH] genirq/irqdomain: Don't call ops->select for DOMAIN_BUS_ANY tokens In-Reply-To: <20240220114731.1898534-1-maz@kernel.org> References: <20240220114731.1898534-1-maz@kernel.org> Date: Sun, 25 Feb 2024 17:19:52 +0100 Message-ID: <878r38cy8n.ffs@tglx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240225_082000_847636_15819A03 X-CRM114-Status: GOOD ( 18.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Feb 20 2024 at 11:47, Marc Zyngier wrote: > Users of the IRQCHIP_PLATFORM_DRIVER_{BEGIN,END} helpers rely > on a fwspec containing only the fwnode (and crucially a number > of parameters set to 0) together with a DOMAIN_BUS_ANY token > to check whether a parent irqchip has probed and registered > a domain. > > Since de1ff306dcf4 ("genirq/irqdomain: Remove the param count > restriction from select()"), we call ops->select unconditionally, > meaning that irqchips implementing select now need to handle > ANY as a match. > > Instead of adding more esoteric checks to the individual drivers, > add that condition to irq_find_matching_fwspec(), and let it > handle the corner case, as per the comment in the function. > > This restores the functionnality of the above helpers. > > Reported-by: Dmitry Baryshkov > Tested-by: Dmitry Baryshkov > Reported-by: Biju Das > Fixes: de1ff306dcf4 ("genirq/irqdomain: Remove the param count restriction from select()") > Signed-off-by: Marc Zyngier > Link: https://lore.kernel.org/r/20240219-gic-fix-child-domain-v1-1-09f8fd2d9a8f@linaro.org Bah. That breaks x86 because it uses DOMAIN_BUS_ANY to find the MSI parent for a fwspec (IOAPIC and HPET) which gets either picked up by the interrupt remapping or by the root vector domain. Fix below. Thanks, tglx --- Subject: x86/apic/msi: Use DOMAIN_BUS_GENERIC_MSI for HPET/IO-APIC domain search From: Thomas Gleixner Date: Sun, 25 Feb 2024 16:56:12 +0100 The recent restriction to invoke irqdomain_ops::select() only when the domain bus toke is DOMAIN_BUS_ANY breaks the search for the parent MSI domain of HPET and IO-APIC. The latter causes a full boot fail. The restriction itself makes sense to avoid adding DOMAIN_BUS_ANY matches into the various ARM specific select() callbacks. Reverting this change would obviously break ARM platforms again and require DOMAIN_BUS_ANY matches added to various places. A simpler solution is to use the DOMAIN_BUS_GENERIC_MSI token for the HPET and IO-APIC parent domain search. This works out of the box because the affected parent domains check only for the firmware specification content and not for the bus token. Fixes: 5aa3c0cf5bba ("genirq/irqdomain: Don't call ops->select for DOMAIN_BUS_ANY tokens") Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/kernel/hpet.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2354,7 +2354,7 @@ static int mp_irqdomain_create(int ioapi fwspec.param_count = 1; fwspec.param[0] = mpc_ioapic_id(ioapic); - parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY); + parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_GENERIC_MSI); if (!parent) { if (!cfg->dev) irq_domain_free_fwnode(fn); --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -568,7 +568,7 @@ static struct irq_domain *hpet_create_ir fwspec.param_count = 1; fwspec.param[0] = hpet_id; - parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY); + parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_GENERIC_MSI); if (!parent) { irq_domain_free_fwnode(fn); kfree(domain_info); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel