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 3E938C0032E for ; Wed, 25 Oct 2023 20:25:53 +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=wqER+TbSPccyKpkfgALJtI9Du75z7oT8sun5XbSbx3c=; b=1ea8iXsOlbLpB4 N9YWAsAJLtGAEwRVv5ks3ftHCyWTPvVPU3mhMDGkL+mEnCiYvpYIzKHDWlv2uh9maDw2RI3R3/Dad BDA5A3yJMvQQ7jNp9Qe/kgDBPXOM5WCouiSO4I7fN02odwEz2jmHaTJSazKfawkrnCXruAMZAO7mr 8cC8WF5O4PO03VdXsAnPrFIcfxI6v1acSSgJhAb/lDvoe8a0yHWDthMj9rYQ4WZPvTm8W7iteXzPr PNUzP/sNcak8A7JoxvNOMhc1pTaqz7TUpTiwfD+3kPXugGdzI9HUaGNjTpJ3JVVT4My3hnKVl/og2 xHnuOGgjREDMM0eRQ0aA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvkRQ-00D3Dy-0x; Wed, 25 Oct 2023 20:25:24 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvkR3-00D2xB-35 for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2023 20:25:03 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6bd96cfb99cso127203b3a.2 for ; Wed, 25 Oct 2023 13:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698265501; x=1698870301; 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=rTitWHvbkwllUIYzM7TBpB/hreitIS32ztyb9Cf5EZw=; b=QXiH+HBdXGIuTZzwTcDHVhJpgCSYl/WFMXosmOQEJZQHw8REUx/xYML70KmfYE0rXS wuzsZGPmXe7RHDnNY//HWCvHdBaTendtiNvMJl1lt6KDQ34QE/X8VAdvDBGFsScdwq43 nm0oEBY+b+1pudlS746gkBZagMGpfdaI5U38d6d/FuLBwM1xS6hoDp6UQRNIM5rDl/sb +LqnJtclZR4P/hs/ZFAWzHn2WdxvYJMdWUpdV+eHIQZsKoaMlTSAO/70ssFiL3euqBrS VzUYQLsfIFhjKaVlyjjGdbPxjHFIiWvSdKzeCP9P47aNCi04JLm2BPGv25MOVopV8oRI Jy3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698265501; x=1698870301; 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=rTitWHvbkwllUIYzM7TBpB/hreitIS32ztyb9Cf5EZw=; b=N1RM6Nm0aqPfBucuXvPm0Yt8aeDUfPwU7A4vop0wF/csTBvFPapCf8uXyfihkaBe41 d/MyiD2UJuElfSNW6bVCzfJd+qGLVosbUfPDnz146ucXCo9i0txL4jYFqTW5GysbnTEN Bw0G20jAIvem5TAxCIjMkhamX5FFE3WrYu7hggPNU8D2B2dDr+M+WuPiowVIC/6MmB0I Gb+ln7B5grw1QUaIlYW4SjMBYV1mMOpcKifZ24Mp1jKsds8yxsvFUEAjQBDgicJXbRL8 j2XwZfF8zE4COh7PuG0h35aZzjeYbFFkv/E0otuSEoAAWGd1e6GE+S0sc4BIBhQabZV2 MrMg== X-Gm-Message-State: AOJu0YzY8e7E07lTHffUJpbjmOKDAy9Qi5SWjfZz+z3jFPPUkyMZsX5X ZSjsQHYagkoEJR0wYM/Y9bENrPo79nPXA0PLtphJVQ== X-Google-Smtp-Source: AGHT+IFxa1VnMrjTGhwV07IKwl5LjRCiwN2wledHcfI6/uXGW7IWW0Iy/XFASuJINb+BuyvT7MzlLA== X-Received: by 2002:a05:6a20:244d:b0:17a:d560:5d13 with SMTP id t13-20020a056a20244d00b0017ad5605d13mr7578124pzc.22.1698265501053; Wed, 25 Oct 2023 13:25:01 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.188.78]) by smtp.gmail.com with ESMTPSA id y3-20020aa79423000000b006b84ed9371esm10079590pfo.177.2023.10.25.13.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:25:00 -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, linux-serial@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Conor Dooley , Andrew Jones , Atish Kumar Patra , Haibo Xu , Sunil V L Subject: [RFC PATCH v2 09/21] ACPI: scan.c: Add weak arch specific function to reorder the IRQCHIP probe Date: Thu, 26 Oct 2023 01:53:32 +0530 Message-Id: <20231025202344.581132-10-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231025202344.581132-1-sunilvl@ventanamicro.com> References: <20231025202344.581132-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231025_132502_005570_C6A491EE X-CRM114-Status: GOOD ( 15.25 ) 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 driver 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 691d4b7686ee..87f4baebd497 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2685,6 +2685,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; @@ -2693,6 +2695,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 afd94c9b8b8a..4ad256a0039c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1338,6 +1338,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.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel