From patchwork Tue Dec 19 17:45:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 181157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2110034dyi; Tue, 19 Dec 2023 09:48:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEo2vdIS3sGQqxmFXDRpHlr6CA5wijQJ+e86J6k+92VvorXrx37sAFoXja2XXGg54UdD9eh X-Received: by 2002:a17:906:73c1:b0:a23:1d:20b3 with SMTP id n1-20020a17090673c100b00a23001d20b3mr3546187ejl.100.1703008115674; Tue, 19 Dec 2023 09:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703008115; cv=none; d=google.com; s=arc-20160816; b=rYrQxNLfWYCXgvlcmHV26St30lg1izxJLuPTTkTSwr9nY+Xr5QSSH3KzNVr6xurKqk eE9hdSW97Otzi4uUSJW/SjnPMmpxVSNhX/neMIJH4pGt/gdoa40iAHssr/WXd7QgEFRo kc02+Bs4tUObFmL6AhU1VfSCUltbDKbbJkWufsxJqH1gFIy6YCiBl9D7R2gDzsVtOEFs aINJ1y9eTln0dWqc9AAtLkIh4YyNSkAQcQb2agNh8/69bdLduiUu/rb3lHHY28oOqfXW x+05vWRv1tJDNLqdSZUpKV4ddAUd1M8lxqmUdigd9b8DRwxNXKjT6N9L/Wh4ctNCRw6D sakw== ARC-Message-Signature: i=1; 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=wXn1vXDcIcY9aE9ZluWKdogaSHoQIJLjYHgL6fRVi5k=; fh=G3MkS2cP7FkeH+7kxy0LRzNpJgfwnUWZciURRBohxGI=; b=go/fMvhxqnbsOG35uUoL4bc3CX4nC0zfiyksB7E2/te9yB1sMk1FzrjEI1YlSFzE11 1AVOQkeHD8mZwEINw8slqWUnCmfCUXU+6njwvgwJnlnlE10RKhsqirRDWQro3T8Mo82k 3Cz1OQ5Rqn70G9nFky3qtQ3DulJc7vyy6uXulC87RyPgsQw30xRMxrHOihxOM8irtibN /rrJKo9pZuZjEgXZUDoP3PYzDbSHlZDc39L/SazmeKbzrAETq1PKZV8grBxvFFsekIFZ ECdgOOFPg7PjcK6SdaUYNUyKDDIODcQFo8K72zTucNJSgtA9ZIHGj3xRPS+HTX49Sh8O v/XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=fN0YXFY+; spf=pass (google.com: domain of linux-kernel+bounces-5719-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5719-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l14-20020a170906078e00b00a2354a0447asi2049729ejc.494.2023.12.19.09.48.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:48:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5719-ouuuleilei=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=fN0YXFY+; spf=pass (google.com: domain of linux-kernel+bounces-5719-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5719-ouuuleilei=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 23B781F2128D for ; Tue, 19 Dec 2023 17:48:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F01239FE5; Tue, 19 Dec 2023 17:46:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="fN0YXFY+" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 0746B39ADE for ; Tue, 19 Dec 2023 17:46:14 +0000 (UTC) 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-f179.google.com with SMTP id d2e1a72fcca58-6d87eadc43fso1494423b3a.1 for ; Tue, 19 Dec 2023 09:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1703007974; x=1703612774; 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=wXn1vXDcIcY9aE9ZluWKdogaSHoQIJLjYHgL6fRVi5k=; b=fN0YXFY+gKPhiZ28irmQajOEihnMc2/x/Tb8coMkWVkhcvzCYaAqElbcdFrydToIxB jhtUFiv9wKlfT3L/g+An+Sb3ZKwLSCGcQ8PsFoSVeV0C81+XtOgdMCIvXUHph8l8FOxI IncCGyZZXZGpDL/lqgeYBq6ubejtYR8AceNniMAXBjJZwExKxlXKzHsTuK6RapdIHJD0 K/bU14mD+vslgXgse2YkFiexegHQN/rVX7JzNSf8lTVqC576BMG4/St5tKzeBNTd9Ary Nf9LN9e60ksjQNs0viggAeb+KmhubBlOvim677CS8cALprD6z3xcv63WX/3EFkUROwMS lFHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703007974; x=1703612774; 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=wXn1vXDcIcY9aE9ZluWKdogaSHoQIJLjYHgL6fRVi5k=; b=FAhqX+Em4HISop6YrTZ8IgR6VCeq8GBNoD4LAhf/4XZ78KtBTM4wCPISaV91iZw/ey 2K5LOAjyEYCs2tg/bG0Ew+8eVSYQDPqxWbEQ6LpSF6QXRJxWRwUbzG08T8KGhaKEP++Q IOrJvUJbjBTrmkmWOHuvOxXU2n+LYKuftPJaHSxK2v1NqXBmo3MRl9E96FLFrq1uAXDx I6c45tmjXdqG2X42OD+U3VYMclEBoSKIxNihVCcCbI4KUNTKTQxHYehSL8HCYRW9Umae oTdmyid34ayvVUyeeDSLwmSakF1wJ/e7CRPMBuuZWQz/TgVCLpd7tXMZsCTUCLy9iNnm 2wZg== X-Gm-Message-State: AOJu0Yxztxlv3hI4f5TDD4m4XTTgfvhweas09kfbmYi7fF5+1su0QK2P 48mv8wUXi/Dbkd+R7RVrVo5+0Q== X-Received: by 2002:a17:902:ab84:b0:1d0:6ffe:1e6d with SMTP id f4-20020a170902ab8400b001d06ffe1e6dmr8678824plr.80.1703007974481; Tue, 19 Dec 2023 09:46:14 -0800 (PST) Received: from sunil-pc.Dlink ([106.51.188.200]) by smtp.gmail.com with ESMTPSA id n16-20020a170903111000b001d3320f6143sm14453015plh.269.2023.12.19.09.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:46:14 -0800 (PST) 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 Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Anup Patel , Thomas Gleixner , Bjorn Helgaas , Haibo Xu , Conor Dooley , Andrew Jones , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Marc Zyngier , Sunil V L Subject: [RFC PATCH v3 07/17] ACPI: scan.c: Add weak arch specific function to reorder the IRQCHIP probe Date: Tue, 19 Dec 2023 23:15:16 +0530 Message-Id: <20231219174526.2235150-8-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231219174526.2235150-1-sunilvl@ventanamicro.com> References: <20231219174526.2235150-1-sunilvl@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785733437625223120 X-GMAIL-MSGID: 1785733437625223120 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 e9a9659314f2..ae045e14126b 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 \