From patchwork Sat Jan 27 16:17:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13534126 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 7A9ECC47DA9 for ; Sat, 27 Jan 2024 16:18:44 +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:References:In-Reply-To: Message-Id:Date: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=bA1Rk8yMqXHZfz3F6kg7ncMi4XPw++gORYS9ZTuWUcc=; b=0KGtgLbtbI309c EKh4Vlhe9ou04B8T7LYdsE0ZwhVD/LcSUg//EkoDoLBGgEWIqtQAs8kgUDPVEiuCs+sYGq7/HenHs XvPPZUsyjjeoJ05I6FpltRID1Lta+vggBwBdphQsk5G8+sQSeY4jfv3ATpunkfQrr8jLE606x+5Uz v2WRDH+dqxrELRYdZ/18etBCMljzcF9o2ia/hpkwHrYUEUgUOU+Wm0StrG5AQ9k40s/ZsNOvv7q4P flELaz3V7jm+pNZZMXsbsDufR15QL1Bq2bIEtVbmv47N4EZZvcBbLkH6AzmwJxDXi1X2bNjqGKaha db9zRrrW4h/j6/HLPfUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTlO3-00000007jzs-1aSA; Sat, 27 Jan 2024 16:18:31 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTlNw-00000007jvF-1dcO for linux-arm-kernel@lists.infradead.org; Sat, 27 Jan 2024 16:18:25 +0000 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5c229dabbb6so738379a12.0 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=lists.infradead.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=TnIAmTG+H+py+MCuGG30xyen9yJ1xeHP89kRhypmQutg01zYx2FUqSBRorAVMmxlYl hu9SPjzDO+9KuKtANjjOzKJxwW//Ls2QU0KWS+f9DjzpODZ6VO4cd1zn5ZvXjGc22+bV gNU6GjB7yNS7W7lBGTmrocSkuixbZvQw6NzYEdVj4+MqgGklhmy9XPlQP228YBFJWD6k OfEXzk+SJi3yCED7PFCN/zwbNp8XGeROFzMlLpKDDcxsxaxF8zZm5ickXrQb6QmrLHze /Q5k/8ckRTOjc+6AAwpu3rPPqkl2pTHhMAlj+ZjSzyf5pyIXoZ5/jtYyIfC2BnLD8FcG US+w== 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=WFR9GWRplQttmULNbt/BUFK436Y6/eClpwDnNz6nrODLGrwZ3uKsakEa31I7nVo5ta GqyIQ7bXJyhpxUcv9MiUaQqbHg+J9wy9bRS7wsLedduUS6dt35J1LhjmQxBBYdUxHmmh aZOxKSdv4egmkOTs4IHVsKWAPNS49jhzQUAz8PNMkgCs3WlrmfN3FbDT0vg6FPHSmYNR n3sbFzlsMc0LSMtPOU4esrwhJaNAg728J0FaESxgHT1cCZTQ2qEOi4l7LloC4+JR62a/ Voq1u9qBSMpRnW+F9i0d6OjdIE3TtWdX6mydAEoqCZUWpx2VystYqBb7CW6Eo4Rnek10 9q7w== X-Gm-Message-State: AOJu0YyfLy28C0xEWSDN5iBzt29cZ3yNyTccHgt5kK6aN/XT0xo3jwWz CgfxAfuvKvDVvn/8J2SOSf7OACLEaP/t/FynmVKR7mczdj+PU/7xdNjvUqd3FwY= X-Google-Smtp-Source: AGHT+IGWNqCuHvim94RTzZCaCZxexRf+vALBBKbirBhqFCZBtNghT5AvXpTXfThJR+s7xqJCGSZFFw== 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?b?QmrDtnJuIFTDtnBlbA==?= , 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240127_081824_468711_47C95B18 X-CRM114-Status: GOOD ( 16.87 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: 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;