Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1572680lqp; Mon, 15 Apr 2024 10:07:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDnb+Rjs+Uw//aIj8uSgxSgZkq5VXfkLBXUYsjsinn2ZZrqtqPPpXk2AuhrkwNkzK9pL3hPp86rUDk8tjk1lTvQXWVmk965a4WKWTuYA== X-Google-Smtp-Source: AGHT+IF5a61/DSQfuzeV2Eet2nFgm+KwF+nob9ha/i72Ww0NOvQuMusC5AmPDqBQ14Sue72OPi82 X-Received: by 2002:a05:6a20:9704:b0:1a3:e2c4:956e with SMTP id hr4-20020a056a20970400b001a3e2c4956emr11237231pzc.25.1713200878375; Mon, 15 Apr 2024 10:07:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713200878; cv=pass; d=google.com; s=arc-20160816; b=OiBOGa++fFmP6UHshFw0qs/oSLMbJUQRrpRVVMUwsdIZ5cWJt7qRLwlyt6qgMS2AeD ks3ligVbv+ykc593MtIjyleTGMy+jZLv5v8HR9OmCFDrME/AhtV2SU3FB9PM0L2RDvUf NDRSO3xwtL7pn3gkKt9enlL/cjodVvl95FB53MBGSBqnjUntiuvvRVNdVm5oYhkaAe5n WT6iheFQi25U6X0TxvQFAfcFyzzm2UQPGoWsfiFkha/jwS9KSASQ9QDYDZ6Xipl3TAB+ 0Kcw61qA14k5mnpaJsJtn8PhbxsSZlSPw9YRpkfX7erNL4MSz8CVVnzi5heeLV5zGzBI jBcg== ARC-Message-Signature: i=2; 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=NV0OeA3LqOjcEQwVzmEUb3l+O0qMWG2Q7MAVkkjj25w=; fh=ELCDIdbYSt0caLeBY0mkOc6tEr1/StHXWuPwau5NIfc=; b=pgGuJQTVrDtzHQJ97nIbsz5OCR5vLYN57Jq/O8Gwb0jZzAoNzeq++duC2NgiBRHVrx hBPru0TaTN+zMjPxkNiHtEnToS9pDdoP/t2vjrJs0eDkD+vDfW34YZeZG6YVbcKlYc9F 8RQxC/8gE7KDDGFuloOr4s5sJMUZK4P7X+cayf4ZVyGxFEGq25hSH3u46JJujdeeVnik z6z8Z0gsPkkGpyjtqtELvaEjD49WcB/DSc/1AT6CGJOQiIHyARocI1RN8pQXhJoEM2WG ZUQTBgFMDlpFhshG4dC2npFqdM/Cg4xHhweQ1ZJYOWr0wynv/M5PdMA1lzj1zK5/4cks zyxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=YHush3tG; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-145604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145604-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y10-20020a056a00190a00b006ea81489146si8278391pfi.155.2024.04.15.10.07.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 10:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=YHush3tG; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-145604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145604-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E3908B23987 for ; Mon, 15 Apr 2024 17:03:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F04BE85945; Mon, 15 Apr 2024 17:01:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="YHush3tG" Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 DD6648062B for ; Mon, 15 Apr 2024 17:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713200512; cv=none; b=kUzQv/7WyK90QOx0HyaUX6ZcbojzJIglOrjrURV4hGeMewEbtaJY6PQ18G0OjvBdqG3FPa+wrdqAlrIkpR+26RoCsCUoWPVl+3/Y0K9udzAPLbZXAvJNi95nF7NGQn4QnN8Lhp8xj2g2GpjzXYpXSf1qS7VIKUnCJUrirShWiD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713200512; c=relaxed/simple; bh=dDrKFILdmWkoGj6OkVS37yIsnuHW0WzK5+l8GvebI1Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GxKvj4QZYq5CKY/iA1T7OzHd+Wxg/IPKHLTj8SyddUlH9d1Klv8CIOKI+gEz6jZrajUPfSBXOBW9KJJYrPdSBhJNPOHlKRxP2+EFd70fGnsf0aiY9lTKjV3ESmviCPMmykzAby9//o9TJP2MtTUmwsimqZcuKt0SXG1IJdCULPo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=YHush3tG; arc=none smtp.client-ip=209.85.210.176 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-f176.google.com with SMTP id d2e1a72fcca58-6ed04c91c46so3648736b3a.0 for ; Mon, 15 Apr 2024 10:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713200510; x=1713805310; 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=NV0OeA3LqOjcEQwVzmEUb3l+O0qMWG2Q7MAVkkjj25w=; b=YHush3tGWr4Hec4PFk5UeTWH2DN08a1TFuMnEGU8wZjSVYhfTmuBVu7ggj3M+XFOgx pf0SsscYHV/TcXhngqnFOlKmpBGbho4aWRmaxDwMQkyn8VEqlIkp8SnKUU7zkLeY9nUQ vfQgO4fRFZtscFwPgDdkEVmyRUYRtxjaLiuu8R9T1Bh3MoNfmpNWFHnWp8bdPRcLptm6 PcFpGREG0Z2TfOYm+vnMbKXEbxN0TBAgXa3CkfnMgrhloMHMl+b/G5z7dxvCQiuS7jcJ kxOXiRLdYWvAaptgYFbdFw1tZTNsg1fA43SGBOa77bTyhGoHwjp9E7p3eNrihl9SK85n RDFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713200510; x=1713805310; 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=NV0OeA3LqOjcEQwVzmEUb3l+O0qMWG2Q7MAVkkjj25w=; b=dF9+6/kc8/mpNL/R8ihN4SQZqNNQK24yFsM35yCxWmiBn/n0ZUj4Fe+3j/TlCeYDpI X/Di8VcCqQikC5iU7mQr9xWdLQsQh7WR6EHp11Y4E0XFtM7FyHpmvb9NBMAWYRFZ7be+ Weig095hnWRs6OK5dixhEfrNBYo9oI+0tiBPmWKG7pFCHlrhRcmhShlYkZ/SDXc6jhU0 hDpqA+1FJhgspTnbFgNueF4XASHRhK3gd8cR3SJK8f5++glF3Sgse+9XGqg6FV39YvUg MIzM+yjczoQ9pqEcVzsB5Mo2PX3tDNJ1aoXElU4eC8XuWIahLc7UdxWzkD8p2rkpu8Ti G+1g== X-Forwarded-Encrypted: i=1; AJvYcCVB922qwPAzdseE+MJ8MxGH0wKnR6j3OooOyUK+/xEZYFRr+FZ21eWPaf9d3jLjc7zDX5NWqXQDcxlJ58Rd0dd8GGklsK2/LthYdFuo X-Gm-Message-State: AOJu0YwltULJ2Kjk/okpsxR3aEm8aYNJzdBK6KCHkQCi67B4LcdocP5t ZA5XoZLjPwkhzeZZRAtcBPFa/2zwn4Sa2n1dywZGzG9AbQeK+cyqCexBIwTx9oY= X-Received: by 2002:a05:6a00:21d0:b0:6ed:de6f:d738 with SMTP id t16-20020a056a0021d000b006edde6fd738mr13801645pfj.9.1713200510295; Mon, 15 Apr 2024 10:01:50 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.187.230]) by smtp.gmail.com with ESMTPSA id 1-20020a056a00072100b006ed045e3a70sm7433158pfm.25.2024.04.15.10.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 10:01:49 -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 , Haibo1 Xu , Conor Dooley , Andrew Jones , Atish Kumar Patra , Andrei Warkentin , Marc Zyngier , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Sunil V L Subject: [RFC PATCH v4 04/20] ACPI: scan.c: Add weak arch specific function to reorder the IRQCHIP probe Date: Mon, 15 Apr 2024 22:30:57 +0530 Message-Id: <20240415170113.662318-5-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415170113.662318-1-sunilvl@ventanamicro.com> References: <20240415170113.662318-1-sunilvl@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 68f101323f53..de30a0af7a2f 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2749,6 +2749,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; @@ -2757,6 +2759,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 168201e4c782..914ecd22ba64 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1337,6 +1337,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