From patchwork Mon Aug 12 00:59:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 13759942 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 2391FC3DA4A for ; Mon, 12 Aug 2024 01:01:09 +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=XeBR6a4fARGb+Tt7ZRQG0e0quZGS87vOfNdRRdyuU+E=; b=LuIW0BdFCdk2bn WlSr/T79HISonARBB1Ud1OTr4SOWUJdEaykPGhM2NFYb5nTWCwgWQS6qpAn6KZ2K6mHDvefmL5Qys QjV5w+vFKHQoVF687NXvkl2agbH4RGgfWWSmcFrytMLFQHy59Phl9utbrINp0/qbREq2lx6arpUZv DDiK/F3wXy3e5NZO+p13nkkOXHz6LDbXM2mFvT8fmyxSQM4QiTiB0aKOr9vUPlQ12XuCPQ8OIuYTK ZB0Gg4kT8EYmz+DQt5uxgtwvRdRTbUJP3o+OsNSG66kxk3P5shCO18BGwDQfUeazSKf8AxU2pVKQl /aJjj5Qfl55b0CRJdIJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdJQn-0000000GaM4-45FV; Mon, 12 Aug 2024 01:01:05 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdJPe-0000000GZsx-4BB7 for linux-riscv@lists.infradead.org; Mon, 12 Aug 2024 00:59:56 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3db1657c0fdso2718060b6e.1 for ; Sun, 11 Aug 2024 17:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1723424394; x=1724029194; 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=cDiQZULOrmkIQ76w8p/0qXlEheAvD+F8k2bdCW40Dj8=; b=FO4zhSiEB0cd//oKILZUydXn1L11s25NgiVYcL9GLqu0tFQzVjODQ2W1k2cfS1vXrd gJDYydX33lrMLNhFzN/Ne/HClaY+h99tXmr1UyP/mBDtIyTUKjkQlbzcqNdeCVXnD/VL hSC1bNWYqxyiTXqlpNcxoJJ12dYhnJzBLOMMhm9580sdFkqOkMPxqZN0rFmgDZQAfRD1 TThZNwG1/hqCwyQa7oS/nj8JYrV6KOtVTUNqv8wCtOJkZbytDEQXrPUICjL1MKnhJxlT 45WzTYKNiXsNaJwkLe8EIEerBgzrMmqP4+HP+zyYCk+mY4prUuZ4WkSF7zwhqIxokRIJ EZag== 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=urMRWS3z6N+HgmSxjR00x/bYkZ1oCTFoCAexLvICAHkas/bUhDyEEerbUR644Lv7X8 XM5y0l77kVoZYZAnkT45mAOCUaP60YtpasAzHdbchvOqCCrBr9usle/OJtoTMC+cRHQe TZ/EpQG2YAphrY9JryOjR5oOZ8pxZxFLxR3pviAR5bxXXCQf3Am2esUg0UXVoa1fN1rW BxlPSe/CExoD5moqwr+iZuDCE2oC0NymG9y1kAdftOfqWZLjfDXoQ69uv8R1/V/95SQ2 msmuRx/jpaiB6JSU3IiF5bZw0U80TwizBx1dMqwSN8rUua86xiDCNg58ZK7GiI8n0U2U KviA== X-Forwarded-Encrypted: i=1; AJvYcCV0VWTkXfio3oWSGAHi47M3XwnbOEQ69RsIthxH4kuRftwFVIG/u/nMKn1T1rjXCjnhLJ+cSKCHZPWF8oYM8KdbRPBbzzyYSHM5uJHyq9Lr X-Gm-Message-State: AOJu0YzHWQ1ibRuSaZ7Vll99lSdxVD7cJO85kc2716q6zduwxOB+yN6g HwF6IcMmtmsKcIb945rSM6IbU98wdMHCr2MTobUFGlHefmVFfHc2+cJmwpQtEvM= 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 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240811_175955_057105_7B8E4061 X-CRM114-Status: GOOD ( 13.63 ) 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: Albert Ou , Haibo Xu , "Rafael J . Wysocki" , Anup Patel , Atish Kumar Patra , Robert Moore , Samuel Holland , Conor Dooley , Palmer Dabbelt , Drew Fustini , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Paul Walmsley , Bjorn Helgaas , Thomas Gleixner , Andrew Jones , Will Deacon , Len Brown 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 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örn Töpel --- 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; } +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; @@ -2763,6 +2765,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 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; }; +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 \