Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp333225rdb; Sat, 27 Jan 2024 08:18:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrW0jjh9pomXLNAXL8Kp9eWenhZuzo/8Bx0dSR2c0ru6NeQziIHyAksCK+WgAXUXLtvG4M X-Received: by 2002:a17:906:4541:b0:a35:62a9:a659 with SMTP id s1-20020a170906454100b00a3562a9a659mr411125ejq.72.1706372330738; Sat, 27 Jan 2024 08:18:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706372330; cv=pass; d=google.com; s=arc-20160816; b=OKjaqhqUulk+9VuyZ+2Om8LTy6OxlrxiRERZ6UmEA8fIYkGZCHifw+3lPfWwtZnInJ YWNINuj1QgxOvCvqr8ImIhN09FDYxJPepnwO4Zjbtfmu+1VhsCKQM7SUMoQCGPPHfMtD dbKSzftZx46Szh/xSQMP02gZ2ADa0An7RO557DVIV+TKTuio5tHtAFoQ3tsNcGKDXZX+ Er9KUqNzY2U24aR0ObM5qkDdM/YDhlILJwBg2kIE2F4w1jHf8C1HOYDwvrz2YdCeZB0S 4WUXURKdxoxHmgJUVveNGMIU94GXIFMVAMOJgZJ2PfHBJsj4GT1cYW6mXZal6iex1RPM EGJg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zu7qmaFKtSQTHBWmN1WZersC14c4aifFLlwgdgw14DA=; fh=706cnY5t7hpwBXQypCTGH3HYLPe+/lcVAB5kbpxvl24=; b=BC6Tr68RN+ql+1HZO4DWOFKDlkhDcxXtQA+I8vyq0Cp2G/mSNEwGrlpusRIMWcFg7g 1LFBMw7bYJUwbCVhHQfcHagw8R8ubg54qPyBQD0zSB8ISCFxf1pY5irBuWHM6dFjmau7 qbcbTLDboMhTD4M3PeMsmJZtxGrnCdVcp857aX5js2Eg/+ugLtE2zmnCpwQrBSe+Ad6S WzuUKYMgmgo0X4H1CERbowPwe8IScWebaUqNN5i6tZRVp4WBLGzkbEcNUTDSKo6PPyiT YoEYvqPb2sWePF7au10Qym7a7bfkzibFgUQS/OHUGUpUT0IIfWjoszF9yvmjxBBXiPkG YT4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=geP1o5ph; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-41274-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41274-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h23-20020a17090619d700b00a35352f128dsi818387ejd.622.2024.01.27.08.18.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 08:18:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41274-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=geP1o5ph; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-41274-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41274-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7E9081F22D44 for ; Sat, 27 Jan 2024 16:18:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88B962C6BD; Sat, 27 Jan 2024 16:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="geP1o5ph" Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FCDA2C6B5 for ; Sat, 27 Jan 2024 16:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706372305; cv=none; b=p4Bprt0errRT/E2fJneMc6WJSgt/ZKMsWsCQo6/EhmFQ/GpdI6xw0TZySCHM6SwkA6G9EdIsUMUYT0Rl2PjMBHQUeN54T39t4vo4vTjhoMHPPSLyU6zVDRtIqLdZ1B+GeYvGGKLdDzQmTxdhv+sOgzcjSVlswZ+36PthItqKskU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706372305; c=relaxed/simple; bh=EDsrArkwDhq7KC2LZOeZEyPp5+AA3ka6aMI74l1LCfA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u9W/RDF/H/x1VZQqg7vn6L7cK3GPtBiGudEvFPexvAW53eQRxgWmrT3KXt0dfDAdONE5XuRu+cd0oUb1+TfIb8PJr8ihnfKBIWMJjVjUNVvFtvy5TgYCClS/L6mHYAGrrDODgZOlANtJRk8RlR16GtREqqaE/ow0hOauRZr7nhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=geP1o5ph; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6db0fdd2b8fso663361b3a.2 for ; Sat, 27 Jan 2024 08:18:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1706372303; x=1706977103; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zu7qmaFKtSQTHBWmN1WZersC14c4aifFLlwgdgw14DA=; b=geP1o5ph7ZITJhi0zygGsGl5t+fa/vxYrUbPpJvAUjLkVsZA4C6cJbg1QDrbyMBQai afYuRzSWerQWn83RRriR1qUGp6ZsnCT9GROQk4G1XGUDZ4Yo01Rpq4N3TUS9VdFPAnJG B7O6dhugmZPQsk7dZPnQHx3uWdRUpq3/sBTkSEkoeMMXlegkfZmAEqudFDGDxJvt0iL6 zA4Pi9aqC4t26Pvn7ZGzCj3AGqz67b/PLWPvb3tXszyk+D5Hplb9suwJtmE6Qd/zxOLo YRaFziypOLNcQQKnRQXfrwFtQkDPC9J9liow3vLoDjcVrNy4w5cJkL2LfwHCS10Kk2uE lQQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706372303; x=1706977103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zu7qmaFKtSQTHBWmN1WZersC14c4aifFLlwgdgw14DA=; b=QZhR92+K8ln81pNW8yic0b2K5EaeZvV0zHI8tklwZawhJXyGeQnyaXf0pGYrzy2UJs f1moomXy+cWgl/2PGkq/dUzTpi/785C3ggWxJk1qCU1GsFJV92bAovZLQimxrrZdV4e+ ypsTqDpZgBzIclAKDC509pUkkbw5Jy2utFWuhNZjqjo1HFGeT8dGa6lyUP25vHJ+vW3N ZBjLYHf2fX2JEyZavVYI4c2AqbNaqEeA77i17I+USDzCtzvd1kiqpNZeLlTxipXkER9R af+pId040nysq8l/cIwS9nFAbpRTeaIzxPukkLWqf27SyXvpx5pnAp7WUmk+2vpFuv8G HKMQ== X-Gm-Message-State: AOJu0YyhP0cyUppxomodWAB8uP1grFhJ5bW8S7h/TkeukR9XTuNSPZEF DOpR8MNmyDKzM2Ad9th7jo8xS9ACaEO49NdEi57GwFAK1jKUSj+1gHutxkMZ7zY= X-Received: by 2002:a17:902:bb85:b0:1d7:56c3:75f1 with SMTP id m5-20020a170902bb8500b001d756c375f1mr1352934pls.122.1706372303005; Sat, 27 Jan 2024 08:18:23 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([171.76.86.17]) by smtp.gmail.com with ESMTPSA id d11-20020a17090ac24b00b00290f8c708d0sm5091620pjx.57.2024.01.27.08.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 08:18:22 -0800 (PST) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley Cc: Marc Zyngier , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Atish Patra , Andrew Jones , Sunil V L , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [PATCH v12 01/25] irqchip/gic-v3: Make gic_irq_domain_select() robust for zero parameter count Date: Sat, 27 Jan 2024 21:47:29 +0530 Message-Id: <20240127161753.114685-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240127161753.114685-1-apatel@ventanamicro.com> References: <20240127161753.114685-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Thomas Gleixner Currently the irqdomain select callback is only invoked when the parameter count of the fwspec arguments is not zero. That makes sense because then the match is on the firmware node and eventually on the bus_token, which is already handled in the core code. The upcoming support for per device MSI domains requires to do real bus token specific checks in the MSI parent domains with a zero parameter count. Make the gic-v3 select() callback handle that case. Signed-off-by: Thomas Gleixner Signed-off-by: Anup Patel Cc: Thomas Gleixner Cc: Marc Zyngier --- drivers/irqchip/irq-gic-v3.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 98b0329b7154..35b9362d178f 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1702,9 +1702,13 @@ static int gic_irq_domain_select(struct irq_domain *d, irq_hw_number_t hwirq; /* Not for us */ - if (fwspec->fwnode != d->fwnode) + if (fwspec->fwnode != d->fwnode) return 0; + /* Handle pure domain searches */ + if (!fwspec->param_count) + return d->bus_token == bus_token; + /* If this is not DT, then we have a single domain */ if (!is_of_node(fwspec->fwnode)) return 1; -- 2.34.1