Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1674316rdb; Tue, 20 Feb 2024 03:47:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUm6PMRUowP6GdSah01h6ZMMOLcNgXgHcZ2pPl1RIB3+8TA1ZlEOfF86NHByD+j7NpL9qcyK6ojMhHZ5qjVJT//MdCRpam9/tQySVTOTw== X-Google-Smtp-Source: AGHT+IG6vFtcff2KfPfTl6+yFH2G94Rj+3JG/KjP7Mp6eOENiVh/jJ0bVCHIV33+UzS4Qig1iuzn X-Received: by 2002:a05:620a:b4d:b0:785:c0b4:d740 with SMTP id x13-20020a05620a0b4d00b00785c0b4d740mr16195683qkg.27.1708429661998; Tue, 20 Feb 2024 03:47:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708429661; cv=pass; d=google.com; s=arc-20160816; b=bHk+U3pP+aNE+XXOdm4swgv45Mj/ZvwOIi65jWZsuICeqXMsBvTt9VhRPK+OyGClhH bkqLm0O1WOeK8tGHXGmPWDfpGQ7lQutsiq0kCUIa9AsPDfogRPYjQvgg/Ff7gS++w1DD 0B1xpqb9AYraf5r0Mj689NezLRe8Vjhxg4cS5RGXFvNeAsPXDUx3PAyD0/Ht9B53k4T0 FFTNsY7zBWGFcsOJ8vz7GzO+Rvh5H5KOANfjgd3O1lhgBz8R03YQQA7iEZ5dLAbV2W4Z 0j4FwZ7XOJPJYLgQo5aTUo2U+NZkPDZ7aWs/5vXp2v+sH0rCwIjUbZy3t6/YVgOD8prH RuRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=VR+ATNUidqRJmis0z+yPk03ZgdyLO9CC5Nfy435Y+zw=; fh=YmfvYmEotLY3LTf4cq6Cw1pjPYhdYNh9k24XYw6W/xc=; b=hDd0urUBXV0xDh+AvAIZke9BTEqRTOD/vhKVWo/r+SbRJj0Btyubd30c1k8NUe7V5/ 2NdO9Sh5mCu1PKJqc0ejTvKqM3SRvZSIbKpX/NeuUGV4HTucFvMS4jV79xa5vfr9ewI/ N0mtBiuUFYH3Vx+5dVPePRtbRA1hFqD6EnRgDJT+5+sOxbYx/0S5C4sY7BNi2E7lozFx 7q/nfiZNOoF9m2RVGCbGkXg0jdedHxogAcRExGiY3v+Q999dVP7ugWPYSJvjswwHaGlW 2ZK3s5YaqRY4XyJi+5Toor6lN148zy6r7hceUqsRph03JJCANd4pQgCAVKkHdzR6jqBS 4ScQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RwjJmyhd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e11-20020a05620a208b00b0078763f9bde7si4758857qka.642.2024.02.20.03.47.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 03:47:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RwjJmyhd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-72938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B95321C247FB for ; Tue, 20 Feb 2024 11:47:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6939767A10; Tue, 20 Feb 2024 11:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RwjJmyhd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 51EFF6775E for ; Tue, 20 Feb 2024 11:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708429657; cv=none; b=WS5eGW3PyuUvE/lQTJf+OP5BIZk+zqor0pzNK5wl7iYuUEi7QTmUkRhEQB1U4+MkH0mzb6hdtqaX9BH9vTwFSDVCdW/UYcptX+HjMH/fOK0RI+OQb8q8XCT14Uc8tht6Y0XJtXAPUoVcLezb0Nk/DGY/wH1SIuUISUCz1j82Qco= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708429657; c=relaxed/simple; bh=X+ZqMf3IK+JD8CFxWrUuIKFK5IZbu0of21KCXRE6D6E=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=RpO9dNMgvoATohoTHoBAjVzKtkMQn7JtNwtO26gCUdLEsg61xA4TekN5/Svmp26ZvLZTUh5FKAtiT/VfkDaW8zeuTGV7rhVTxmw+vjGGWw/YcTZIefXuLBJ1yyvUCWqwOCsw6WT4o2hX8BlYoEqA8jTE6LTROEqpTGQgCSXbLK4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RwjJmyhd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1E44C433F1; Tue, 20 Feb 2024 11:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708429656; bh=X+ZqMf3IK+JD8CFxWrUuIKFK5IZbu0of21KCXRE6D6E=; h=From:To:Cc:Subject:Date:From; b=RwjJmyhd5MtZxLjlIfA020w2JgutNuOVi8JavflhXQNUkW0ASaEuMKPPVU2U3bT/u 8R1bvicYO0Neszs6orB53+I4QoLqgl+6HBZqi7+FgNLMh8C6FEwIc2b+R5wsPBTZQ+ HkJgcOeUBQxNE4q4cfnmKCLdNx2Opo++bTU+XwEGp/AwmP8Tk5QDzE4Ytpt8DtBK0E ccL11a69TCSM+WO4jpotUS/hGns6oRHhd7q3WkkJaT//VOcI50khmBT8ZcdFIZwcPX GyOtLEVbBHD+FJQR+8BYnMAEkA+ZHM9kIjJcEI7fk90gdhm33w+EF2FTwtYRN4B+Wr HyK7x+FjSb5gA== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rcOb0-004u3X-H5; Tue, 20 Feb 2024 11:47:34 +0000 From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Thomas Gleixner , Dmitry Baryshkov , Biju Das Subject: [PATCH] genirq/irqdomain: Don't call ops->select for DOMAIN_BUS_ANY tokens Date: Tue, 20 Feb 2024 11:47:31 +0000 Message-Id: <20240220114731.1898534-1-maz@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, dmitry.baryshkov@linaro.org, biju.das.jz@bp.renesas.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 --- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index aeb41655d6de..3dd1c871e091 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -449,7 +449,7 @@ struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec, */ mutex_lock(&irq_domain_mutex); list_for_each_entry(h, &irq_domain_list, link) { - if (h->ops->select) + if (h->ops->select && bus_token != DOMAIN_BUS_ANY) rc = h->ops->select(h, fwspec, bus_token); else if (h->ops->match) rc = h->ops->match(h, to_of_node(fwnode), bus_token); -- 2.39.2