From nobody Thu Sep 11 15:06:51 2025 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (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 A8CEBD272 for ; Mon, 12 Aug 2024 00:59:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723424397; cv=none; b=X0eLHVG5vSF3bYSvryWxEIQml+dld3uQUbU6pXWmW8NVPkBmKbQDxg+IrPZpkae029vEdNZUo8UOqRlT/QRnFAcV55hE4Ug5Joo5A7lB+Bd8ANN8UCWsMj63X02x+wO8pK0Idu4DIpFPLTNIaJyVr8QYCS+TYs2lDjaEdeziO18= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723424397; c=relaxed/simple; bh=nknKRePYpstHJXNT0D7LVZ4HEWBMbMCFh+6ycmonEIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Eq2z1/zLE3Cl3q7yv4HWF+9q6oloUSyjx1R1zjgYRsV+iNUwGHFLl43/Qq57KGG3RWG1S1Snk1qEguOGyoQCw6xXkKK0J8SYknAfP0A44TRh4GGrvZ6eUqUmfFiBtz1jz4vaFHDmbD7FbBiFdsJI5yzAQ/ttSVpRw5ZUhztw8LI= 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=MMGNp8/d; arc=none smtp.client-ip=209.85.167.180 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="MMGNp8/d" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-3db1e21b0e4so2817312b6e.2 for ; Sun, 11 Aug 2024 17:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1723424394; x=1724029194; 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=cDiQZULOrmkIQ76w8p/0qXlEheAvD+F8k2bdCW40Dj8=; b=MMGNp8/dEZHz8D5kZ8z2Hz0TfkLDcuWmIXTjiCNqi8epkJ42bmpNeyv3WUVS1cFEa0 9aGgjK+vErnROmR6V6MDkgf0Wcn/nh0zq8Qfj2dAFAnLzFOPw9GicZWvrFL8nvZ0ecNj Fgs+8fk4ooBbymzCfWPme/REfRRMlp+NXYwbYL33hUwZIuR0VjLh8N7Cb7kG5anzjPbx yhlncVaPecmtBjOklGzwDXv5ZKG2s6PZQ0P9m1tUMzywp7lMX+2XrNp/W8HuuDrEP4Tl 4PC5DpFduJCPq5Yfhvvb0PJXCFbGvzyWdwHWhqbpGTG9NLR6GGumxlmsmY20CTCw5Iyh Vajw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723424394; x=1724029194; 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=cDiQZULOrmkIQ76w8p/0qXlEheAvD+F8k2bdCW40Dj8=; b=hy3mEOfnxeoKBkD6CIfxrL0qW9itMZjEyZU9NdklzZytfECyc7O/vCYl6CIy4FySWW PFcMLNYB4XJW6zGOgWcLr0vLhZt/nxWtzujE1PCKP7NCday26QBAw5ky5spxF9TmvnJ4 /FHNWD1RFF17v7/wRCyfAZKqtAVJQJ72ixrKE0llsQD1UQk807+q93z8QZ6KKQclE7Sa /DVYasIReXgxszxJjg74XOCMouoRms637nPh43VJOLAmU/6JA0t5rHycY+5+RjbC4LWd pQ8hxEJZiBgLlkwQ0tmUPvDoZLD6bUKYaVWYTe3UZ2G9X+6RaaLUNEAt81fqJllQU4Ui Zlrw== X-Gm-Message-State: AOJu0Yw5UZ475CexZoY2m5DnawwAXYGbpNZriuMaS8ort2XyzOjsC+lV XnrxWiNs48PLtFrY/M4TNrO4nyFdDAylmrgd9mYkxrXwdxbLZdKEjw56S6bqwMQyENNKMxbPxPD IsVm8Ng== X-Google-Smtp-Source: AGHT+IFZ+1tDJ3142HVFsLE4ya3SPYZxnEcsV+61Xh8a+xb4OPG7zVmGoKf++d88AMIRm4sWlhcOOQ== X-Received: by 2002:a05:6808:2185:b0:3db:fe8:f744 with SMTP id 5614622812f47-3dc4168aac0mr9047447b6e.24.1723424393786; Sun, 11 Aug 2024 17:59:53 -0700 (PDT) Received: from sunil-pc.tail07344b.ts.net ([106.51.198.16]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7c3dbe8cbdcsm3074062a12.61.2024.08.11.17.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Aug 2024 17:59:53 -0700 (PDT) From: Sunil V L To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev Cc: 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 , Haibo Xu , Andrew Jones , Atish Kumar Patra , Drew Fustini , Sunil V L , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= Subject: [PATCH v8 02/17] ACPI: scan: Add a weak arch_sort_irqchip_probe() to order the IRQCHIP probe Date: Mon, 12 Aug 2024 06:29:14 +0530 Message-ID: <20240812005929.113499-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240812005929.113499-1-sunilvl@ventanamicro.com> References: <20240812005929.113499-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 an architecture specific weak function arch_sort_irqchip_probe() 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 Tested-by: Bj=C3=83=C2=B6rn T=C3=83=C2=B6pel --- 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 59771412686b..52a9dfc8e18c 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2755,6 +2755,8 @@ static int __init acpi_match_madt(union acpi_subtable= _headers *header, return 0; } =20 +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 =3D 0; @@ -2763,6 +2765,7 @@ int __init __acpi_probe_device_table(struct acpi_prob= e_entry *ap_head, int nr) return 0; =20 mutex_lock(&acpi_probe_mutex); + arch_sort_irqchip_probe(ap_head, nr); for (ape =3D ap_head; nr; ape++, nr--) { if (ACPI_COMPARE_NAMESEG(ACPI_SIG_MADT, ape->id)) { acpi_probe_count =3D 0; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 0687a442fec7..3fff86f95c2f 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1343,6 +1343,8 @@ struct acpi_probe_entry { kernel_ulong_t driver_data; }; =20 +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 \ --=20 2.43.0