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 3E4F6C4345F for ; Wed, 1 May 2024 12:37:42 +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=DfB3ubE44bHxO+NQyZxUI9CNhXM3AateURuE1jKZVC0=; b=c3p2j2j7/Te1qj K0/cZj3YtHwuGLmkOnCQSz72wRCFMgO08YMRnNWJazo/zdLuIoYoCGZ3Qlao+PtoL6lWYyVroTdk5 2C3XxMailq+Uw6dA6qwnPhzgt/AJhE2dXWe5tI/hp82OHlXKSKbCErrSzqw6352kBju3b+S2DX/Zf hUB/gL4WN2ZPUGQQchIePGi1j9ZEz9CFcMbrNDqfby5gp6IlJsFQDzpcB7qsxAnexv0ovUcH6iq6B k7tYCUYA72qIjRGZXdIFPTtFvWwWMoF+Hh1YR52AetTKNjfXi3XplPcdmIE6IMZdUTlg7hpES1A5X pTazEgjrgsazKGNhGKQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29DH-00000009Ubu-15Se; Wed, 01 May 2024 12:37:31 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s28uj-00000009MV1-37bd for linux-arm-kernel@lists.infradead.org; Wed, 01 May 2024 12:18:23 +0000 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1eab699fcddso52714805ad.0 for ; Wed, 01 May 2024 05:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1714565900; x=1715170700; 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=2U21IbVpVYWuDXnfpPitFjz/aLJhntW1ExhoP7hEzCc=; b=pR9bxwsq9Zmon7c2d1rrCGADzjiNkbJ7NJEM4wWVC9pUscHpgokcSF5Eo6U58AdMAl GR90Qno8S/poFKemvPhsF8eIAyGjPviYj4hQzIdvgSxls5QzNHaD2+gWPNUsOwMJyc4k FWl0eNavbENwn9MnyslODVdB9aZye1zUMBIZZyAMSz0PI7wY49N4N7RExWG2l9I0tj1T QILS54coW7EGcU6+WTlZ+7EuFQRrlwiFt6fmqC4ptuPl3aHnTpDeb6hOomsLG7nF8gGI LV3HzQMy/eNnc40HzcLqTFt6UzOyU3s+tvSB3fkW6zgfHecgG37CHe+WwZNaSzDyfjZP J81Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714565900; x=1715170700; 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=2U21IbVpVYWuDXnfpPitFjz/aLJhntW1ExhoP7hEzCc=; b=LC8bP4mb4NH2PtrCKd4pfO8zPAwfwXvmcYwdDATYxVk0Ei16OhVcX1hyO0U90HD9sy PNXjF9evzE4GI7zHA1qF/HqOAO/KZhaSKyB/3iPEQPzlZqSyOGMqr9heUks68ZHghkvq hZClvQpBb5RtkQuqvd8B4Xi833ITRmWwgGoxjcFjqC8Y7cBzqGBH/4o8KGL7HR/SrXlk 4lPMTWI7M3fTwUlcPq8SAiZGYQ354Lca6X+OoSC03JEuAMemZSoa6pKzSHkcZNGQ0G55 oiyTAYonhG/uCNtlEjq8eAbR9o8xT8SRo6aa2z1sStaTXgh7H+DACPPAp5P3ie/fFjrl NO4Q== X-Gm-Message-State: AOJu0YzX5xf2oXOuPKCGR/gYgPVxHpZfFBGN+xBqWsw4vyGwBfr0KE/c wVb6CjkcQYypOHbGdlPsyMJV1THn1MyxZ4MJMLdykbj1f2FXQGegX5lDpbp0+IIRSGDi/BQpiEi Qzx8= X-Google-Smtp-Source: AGHT+IEhKN1Gue1zmrkCOUBSqcJjzhxCt/OVWXcOEWxant109xhmvof+8Br6KhAL2UNxeD7n9gvBjw== X-Received: by 2002:a17:903:11ce:b0:1e4:9c2f:d343 with SMTP id q14-20020a17090311ce00b001e49c2fd343mr2700552plh.7.1714565899631; Wed, 01 May 2024 05:18:19 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.188.106]) by smtp.gmail.com with ESMTPSA id im15-20020a170902bb0f00b001ec8888b22esm1336900plb.65.2024.05.01.05.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 05:18:19 -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, acpica-devel@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Samuel Holland , Greg Kroah-Hartman , Jiri Slaby , Robert Moore , Conor Dooley , Andrew Jones , Andy Shevchenko , Marc Zyngier , Atish Kumar Patra , Andrei Warkentin , Haibo1 Xu , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Sunil V L Subject: [PATCH v5 02/17] ACPI: scan: Add a weak function to reorder the IRQCHIP probe Date: Wed, 1 May 2024 17:47:27 +0530 Message-Id: <20240501121742.1215792-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501121742.1215792-1-sunilvl@ventanamicro.com> References: <20240501121742.1215792-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240501_051821_797031_C72F9350 X-CRM114-Status: GOOD ( 15.62 ) 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 4804a2ad1578..837b8fc89dfb 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 c2ae33b8dbb6..1afa289f1f4e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1339,6 +1339,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