Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp886839rbb; Sun, 25 Feb 2024 08:20:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUrArUULXkYHHf+j5gQ9zG0u2BYJglLl4FIL29vAfk8BbpQvw7VE2gU6HgUcoj8v7Kxf1dyQWxss6C2oLLhs+cB2sP911ryebz5iD2ALw== X-Google-Smtp-Source: AGHT+IGA7l3ZGPYIADxEwfa8tPnBSwaMgIUzgDx0fzKLle/pp5mLZr4oXWulq2OW+x8lJpLUk+f7 X-Received: by 2002:a05:6e02:c69:b0:364:ff72:fa5b with SMTP id f9-20020a056e020c6900b00364ff72fa5bmr5524873ilj.13.1708878058206; Sun, 25 Feb 2024 08:20:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708878058; cv=pass; d=google.com; s=arc-20160816; b=noqoGnPcTQYkxFxkhja3MO74WaAdQPn0baJweAVD6GMzeNtLLQDIf7N8rFk+2MpGTO Rae2aZWUzh+VbItcF3RObFtWtvfw/EMWFpeMTQNhncoec3EjJVpgHI6+HxIaGFw/SS1q HsJ5807bxwcWNtl4T/ItHR6hFqS9yLbaPS7eepxPITzqJ0u2AaFL4a1j02LSrSM6ryXv eAxZG0wKEDhhfM7vUiN/FvCSc/rGpMIV/msNOvjR1Ue3sXX6+EFAF1ulvjj0E8hqP2Au AazWrMTTTKn+uOzFNxANd2HyGu4RZ9eh/kukJ7ln5gjD3KIRQTsXBDeC4J2+dk8DGYaa rQvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=PlSwHlYyP4A1LQLM6WxxKKT7h2/VeDpm0ciAvRcDloc=; fh=m43NSFu/mt4R5BVwzHiaRWZR6+IGw08xGbMJGZ2Sgcw=; b=xuEu0onhREejcKc/vh8Cj124Fl5RLSKluQXaqpwrHXWPUqVFOGtq5I1T5mo2E4qoup M09WM6JOAp0ZDaZ7HrkBJE6iNxpivRh/sTl+yQQ7/f0VxqUqs4XZwYM0lziC2ICZq7sm Uof5y8Uzv/VCreqrRaQjN897pjRDDC0QcMDqh357u4WcbGLAAx7VOAR4I4z9lYZs8N7D PbTfBkYZFXmbLOlsVwXQk9kvR6mQwjrO759xpJh2OnnG9CShopYrUVkE8rsaqTUfPVhJ jBRH+Q+UveFaKUTtNLdfGfYRjlT4FPhnH78NoOKe0yn4I2/rFSAhTT2W9DIOrXRW85O2 CUBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ci6fGVPi; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-80197-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h13-20020a63df4d000000b005dc8372020esi2357857pgj.580.2024.02.25.08.20.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 08:20:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80197-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ci6fGVPi; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-80197-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 90D30B20E67 for ; Sun, 25 Feb 2024 16:20:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F16E317BC5; Sun, 25 Feb 2024 16:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ci6fGVPi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OTbLn3FO" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DE8C17BA3 for ; Sun, 25 Feb 2024 16:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708877997; cv=none; b=DgxM3qtCtZ5ToDdWofilzOF+xnLn89IgrHPy57XI5ypWVuCIWMpqdnr6ys+Y3PJzJLgkqVHrgqdjPfbOdTobaDUfeXMqmhr0pSckqj9jDZ4WrB83LGOSPLxAP/DPkWU/aZHpqRiIC37kqqLtbZunuw1YV/mg1FHU+f1HM207GEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708877997; c=relaxed/simple; bh=xj3WOVgz3/BYLzvoZp63A8tXW4n/dMlOHyItQ2nC/rc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=IfYSSKzuySg33zKe69SkMJLfO4lKHFH8UQ5CEUeU71Wz1Az6kKuNqogFN2LnQVHsyz9HIQIXyImGWxEfZjqntWzA50KVXebGiEkT8rvUOgpfjifl4+zItzgzs6B9KQgkOQRwyAqm9UgErYO5Ut+k45XKQBzscemDLSZbq0vYt9o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Ci6fGVPi; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OTbLn3FO; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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);