From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 5A271127E0C for ; Wed, 1 May 2024 12:18:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714565902; cv=none; b=esD62xXmj9KS6DCuCg2rr6DOf0iRzjVPvbaL+p6DzU/qVlF+7hHnqYBEu+r/DcB5UekTIcUCwPCh3a5Su/YwQZNUBSBRlPV7QDhB4MlmZKQ1S4JyGcJIK3xboEK+3Zb+N6x4kv33KD1xKh31aziEsHTd9US8/pnXOX2VG+6tY1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714565902; c=relaxed/simple; bh=F85RREqd/8SNFxuf3cR7FkJMyzMuMjsdvVkhYC6pOzM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DJCWpT3jJJqdvKVfBlUqQtc+IuZDi0yjx8fRquPuNkrtwOu1HwxKSDIFF8jyB1FoK97IFK36eTg83vWE0AdyoMnVVAM0gVhmg47heL5Iwto60wfZ6j2KAkiAvdtXhQHDjYOTrNgIaEs7TH3rFlVmavmAk7ohl2oYb1wem/4Kcg0= 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=T4u9PLld; arc=none smtp.client-ip=209.85.214.169 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="T4u9PLld" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1e3c3aa8938so44171065ad.1 for ; Wed, 01 May 2024 05:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1714565900; x=1715170700; darn=lists.linux.dev; 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=T4u9PLldGuD8AMLs96tUS9KQqw3KxkfqJkkBMz+d1YDTp6FgzmT4IA+lUQjqTgjBD9 rWnvgyOe5amzd0HWPL9G7VJZP9IXpvBex/OjLYgCcZ1YinKG430UjHjTucrVGNIvuMMc a5WPZsprijA1Pv7tzSd3VJtJodfD8fed7v+Ljt+Veta4k8yQbfI5y97wYRKPA+iI+ywM ImCGY9D4CbMN4gNXP+xa2LFO1Z1l5JLAHJ/Gl3bM2AXZ+KlIUM4ReGKLqJtAnkJByY9e 1VDTjKStZ16WHRn20f15mlP7lOq1Op5y7FONf2ud6GV0C+kI2vrNKJbC1C70xuy1O5VV N9Jg== 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=CsfaOFODIPHwiLuZsWg+z0tagqEjAm3BXgTLPzVr5W0ZjuVkR9sgG/spBxa1A1vT2N BK4OfG8CSEHLmKkxBQhChSh3/9ZABNAKhBlZ+FJDU8q2tI+92IeKee6IElnDs3ugGYx5 XbumnxFEvx6UZLoD8ilTPuBGi1aaefSxeyVuEAS3hf9yqn5ngNKbxV4AGTcVLzDo9lFW cNc04VHJWTWOO1UuPjZABCaYTxOURcBVRn+x7EKtGPdXl8Y5AeT5u/fAS8ZKF0/qryoo Pdrl7/brEj2JRKhDrnFovokMQpUGkFNU/8zMd6X0UDN5sz9FTYnpBPWMmWeWssNCyWUg IyIA== X-Forwarded-Encrypted: i=1; AJvYcCWIWh3e9BTu66wRJaM/B7tgRGBecv4z9h5J6iuXh0XJoBlKnVQceAR5YkUapH3ZnxVmK1y56F9sDwHHFnRMurmqZQWS6Rddfjkh139U X-Gm-Message-State: AOJu0YwHX7cMQUbtWKPlbC4eOLv+uT44Du5uze8JXFt6rvM3ZFFFBKyq 5VB2iys/LBp3HVcgYUzwHwC6rFf3Uqlo3rQjjNB2JegkNv3m3lLqvbTS7emwGxU= 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> Precedence: bulk X-Mailing-List: acpica-devel@lists.linux.dev 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 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 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 DAEBAC4345F for ; Wed, 1 May 2024 12:37:33 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LBlHHNxIG9BTbuG47kGOc9x+5hj9u+ZkueAMfBbTfUk=; b=srZ9HCMRAL9J6C RZ7j4L5n4afROrCo5y1KXmVg54OrWSxNqIC1F+9QsqvBH6mJUubaqShUuWMW+djutQG5EqRf/7dFF 1rdZJaQLGaeNwnhKLxUlkXhvC1JaIHLk5FfsR9d1AsQRzBNRCib6ZzPk5gRVjrWzO0SZVkeXnAIJH idMeBvWHXrV3zcU0nMCgKCRcURg1tZpT9Dz6vzJ2eews7ky9GKGSLmjZ8AL08N9cWNQVBnhF/Obr9 B5L50vwLGnLQ9SYh+AL37b9j6ZVaVdJTJjtgL3KlF7NATuyZU0iTKXMUNaiAoXkQWWffsC93jVw6B f7teujVCVeXyRSEaB0SQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s29DE-00000009UaL-2YH0; Wed, 01 May 2024 12:37:28 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s28ui-00000009MUE-3PaB for linux-riscv@lists.infradead.org; Wed, 01 May 2024 12:18:22 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1ec5387aed9so13688085ad.3 for ; Wed, 01 May 2024 05:18:20 -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=YOacFZlhpWAnimk0DOfou3a1xtebE0pU1DPfksYSUChiryp5J3tZJL4bVQVj3sPsg7 4Mu5sMGf5u+4GmJ1uXg1GG/0jHXnVZc8+Fyl3kla5ASpCtTU5JAY2r1wOC7mUeqhcYDU ArmTQqqJo+M4R+KAQl23cRIPkT0WCd1MhK2bW+jSfKtRy81aJbTVnXRWdZ9HZFbZ1sGb FlO5olQWJj/Brq58JjCiJIgaOZeTsbaKkeCqi2Ak8Nc8o5p8TmPXEYrSJXGl+QJAmxwU tQfKbPrzPr6jDmuAFrhmzGjzwfnip3DBZ3E3f3q8/MlGMvi3aGZs53QbIuRwO74UWdH6 8yjg== X-Forwarded-Encrypted: i=1; AJvYcCV5GT11UpUdz5QCJFg3vXKFfTLwPlZSHVOsBTNYzQLyPvUluJ+Gg/TqVQ9+6sCnEfA4IHQQA0U942dYJGqk5OHgAUc4CdTUrnHwi+ODha9j X-Gm-Message-State: AOJu0YxZNO37Bz+MOqt4oIzuSC92p/k6m+vFd/KsNRuSAKq4n4NXIlOW sWr8kktgsYcOn9cBG2vYcEOLZWeR4QCkZPrx3PSb3K+2D0GBv4G9r2l4bar2y80= 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 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_051820_888477_F15F648F X-CRM114-Status: GOOD ( 14.01 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J . Wysocki" , Catalin Marinas , Atish Kumar Patra , Conor Dooley , Jiri Slaby , Haibo1 Xu , Marc Zyngier , Robert Moore , Andrei Warkentin , Andrew Jones , Albert Ou , Will Deacon , Paul Walmsley , Bjorn Helgaas , Thomas Gleixner , Andy Shevchenko , Greg Kroah-Hartman , Samuel Holland , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Anup Patel , Len Brown Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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