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 D1EB3C27C50 for ; Sat, 1 Jun 2024 15:04:54 +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=vK3J93rt8KBMW5a5RChVYZV0RoAemy4XLrS2UBwiAdc=; b=bQdDdSYMDbD0QL 76tlR/eDvuoVrcWIaM3QJ+yhyCqmZAB3f2O4+xPVBezFi4FXQPFrOpLvUtrEAnoE8MDk1MGYEmEwN Xt6TtZLvmDyEvSo06Svx57EBRbQxkAyV5SoLmOPLrguKZ17T7Xm4ahWIZ88FtyGo0wSiuBIIHZK41 iR+jhPnFdPajWGfEjliihfdLUCGb7NLp5DhRzKFFbvJruO4SEpfrGBccnJ+xoFeRBY/L9qhL4elrB Uz8sBHh8UxeQVREuCQ0oqgyQCiQrf1NEvDnOQlnN0sDzZVIwjIB1UKviJ4H3Mqm8IdHRyIaXXSCMd 9KJ7d4ADrn+kb04v4Mwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDQHh-0000000CoZ5-1zkr; Sat, 01 Jun 2024 15:04:41 +0000 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDQHe-0000000CoW9-2y5y for linux-arm-kernel@lists.infradead.org; Sat, 01 Jun 2024 15:04:40 +0000 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-5b3241373adso2056405eaf.2 for ; Sat, 01 Jun 2024 08:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1717254276; x=1717859076; 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=W2w7EI3TeN2iCf/DRtg4G2EgwNqxdEr1hmfQbDfWRcM=; b=X1mJtZL2mwL99dIZ+q+tQbFLLM3omKTgoL6TJQvmAwMA5o5SQNAVdhi82OmJvT52zX YvB9LxmH1wRT2wsQjBLpbyANh70Xx9IFjzdaGANhdXTwO73wK7A+pw0v/57hcvpWyVdO rDG0cAazwY76iEkWspgKtC8XKZakVnehrDSP8+A1uXfOjZrsecRdU8ARpEluK8Pq7ljJ c5KpknzX8v9aGA6frP/pw+kRx6Xtr/tgiBwMRVZMP4OINv/B8DXSvWy5el+nDUFLIz4U nglsWjJcdANm+TFANjadH8M8a6ZPH0DqBk85NZdpoyhUm5pgJH+khFoiz6I4r7Bmdl/o DFTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717254276; x=1717859076; 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=W2w7EI3TeN2iCf/DRtg4G2EgwNqxdEr1hmfQbDfWRcM=; b=ONXtBmtiQeAWw8OZCesW9643T4yw+KLDDEQds8hrlaOo4aLnL2Ts3ElSdvrGPItkTc PUfYXghlb0VH2coU8iI1Y41yfs2ko9/1FshKM1KSbIEeQYnhq15RUxSE9P7NS2hCycE3 0w4T7WCj2VzOLJ9EBG5R5n45yiNPP3UXVRd6jfg9M7PvEwf8lSOBA/i777LtYVlaxeWQ 3/1ZMvjMzAslbrJhE2fj0C7zEU1eb0DgXMa8kYpIf6F01H+JuDslAPSRvWNebzmMhrBV 34vHwA0vi08m5UuS8TAuT3H2AdGcieUitWR+r1c74dn8Myf0B+Z5mljmJRGmvrdMoD5C Z+Zg== X-Gm-Message-State: AOJu0YwuEfijmw1pR8pn5o6SKEO+S094VJuHxW2PC8fS+G1JmF/Mkrtl deeSBPDSs9dOhjzqe7bZAB17v6TDxnYOBjgn5de3bk1rQ4yhorWBIDUMbhkYzDRv4UVfeJo73JQ AGQ0= X-Google-Smtp-Source: AGHT+IGJwcsK8POtH2BMJmphYPRD+c46tpmn1qQdcpXrg0lGYUhORZGvMPcRjxjR7R/vaRNToWclfw== X-Received: by 2002:a05:6358:7601:b0:19b:8988:4f48 with SMTP id e5c5f4694b2df-19b898851f3mr287174455d.21.1717254275702; Sat, 01 Jun 2024 08:04:35 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.187.237]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6c35a4ba741sm2559410a12.85.2024.06.01.08.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 08:04:35 -0700 (PDT) From: Sunil V L To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, acpica-devel@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Samuel Holland , Robert Moore , Conor Dooley , Andrew Jones , Andy Shevchenko , Marc Zyngier , Atish Kumar Patra , Haibo1 Xu , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Sunil V L Subject: [PATCH v6 02/17] ACPI: scan: Add a weak function to reorder the IRQCHIP probe Date: Sat, 1 Jun 2024 20:33:56 +0530 Message-Id: <20240601150411.1929783-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240601150411.1929783-1-sunilvl@ventanamicro.com> References: <20240601150411.1929783-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240601_080438_756665_F65DCB21 X-CRM114-Status: GOOD ( 14.82 ) 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 Unlike OF framework, the irqchip probe using IRQCHIP_ACPI_DECLARE has no order defined. Depending on the Makefile is not a good idea. So, usually it is worked around by mandating only root interrupt controller probed using IRQCHIP_ACPI_DECLARE and other interrupt controllers are probed via cascade mechanism. However, this is also not a clean solution because if there are multiple root controllers (ex: RINTC in RISC-V which is per CPU) which need to be probed first, then the cascade will happen for every root controller. So, introduce a architecture specific weak function to order the probing of the interrupt controllers which can be implemented by different architectures as per their interrupt controller hierarchy. Signed-off-by: Sunil V L --- drivers/acpi/scan.c | 3 +++ include/linux/acpi.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 503773707e01..b325b297bf77 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2744,6 +2744,8 @@ static int __init acpi_match_madt(union acpi_subtable_headers *header, return 0; } +void __weak arch_sort_irqchip_probe(struct acpi_probe_entry *ap_head, int nr) { } + int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr) { int count = 0; @@ -2752,6 +2754,7 @@ int __init __acpi_probe_device_table(struct acpi_probe_entry *ap_head, int nr) return 0; mutex_lock(&acpi_probe_mutex); + arch_sort_irqchip_probe(ap_head, nr); for (ape = ap_head; nr; ape++, nr--) { if (ACPI_COMPARE_NAMESEG(ACPI_SIG_MADT, ape->id)) { acpi_probe_count = 0; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 28c3fb2bef0d..ab3f2880d209 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1332,6 +1332,8 @@ struct acpi_probe_entry { kernel_ulong_t driver_data; }; +void arch_sort_irqchip_probe(struct acpi_probe_entry *ap_head, int nr); + #define ACPI_DECLARE_PROBE_ENTRY(table, name, table_id, subtable, \ valid, data, fn) \ static const struct acpi_probe_entry __acpi_probe_##name \ -- 2.40.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel