From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 0DB1615F402 for ; Mon, 29 Jul 2024 14:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722262988; cv=none; b=kdwlz8sdpBw1hKKlA6/Djcg8q9x8CD8lNA5Tt33Ma2muC/BniyPrnnIqlgiaZMpcB9ZGKQvhTnTHx2TsjqiE3hpipPj4pKX6FHSbG8peRDeVrMMBR4m3UWkfc4/kJlIA+zR5E6wmi5u9VB64uK8d5Vsz7b+rlmjRysM5yf7ZL6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722262988; c=relaxed/simple; bh=dIAC5ACjszKWc4p8Ai+3npuM+9XIxGXpMSvp0kw9aIs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cEg/nZjuo4MaU4Qvn3wPBwUratj+QfDbp6qUL3x4u5yiHhWBxjLsXBH6V7Uau2HT3arrHtpQCU8H8q6DbEGJjf294HkyFv0itXg5ops0jbnnHUqZjge636Nx/bCgqUMU18PRTsPauqB179odeozI/TIlLbWhr9nRrDH381qFYLE= 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=O3hMCUdp; arc=none smtp.client-ip=209.85.214.170 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="O3hMCUdp" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1fc66fc35f2so19359665ad.0 for ; Mon, 29 Jul 2024 07:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1722262986; x=1722867786; 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=1v7P8DgVWEOiQraKJZCp7Th7levU77nqOCGgGfYFy3k=; b=O3hMCUdp+5sEdNHT6tV4YjWbFZN93Ltj3VUd0YhCVu6egiGxVaaWNKV/+S76CeyAiJ uNQQWz0SBQO8wkk/C5moGSSQP6m1862sjIvMqJE0kwHvJtWV88AVTm/WemL1c62vEsC3 MGzQtWvw8mFMSN0H7sUuFxHOSZQX7fRGOPHhk4vLFFtfyTn5Cjx/7UHKfH0GS0xSighV mjE2JL1Iq2csGdMuyMwSxIkjYWiPE/KCpezECmqNDm3UvXEVzqAKC69LixadXpYrIWC5 9zmEei+V0TBxNc9QiVF+oYrSBlda2cF5mN9NVv8aPBWeVR5UT4ypj4EYR4WRdrPlaGZq +0bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722262986; x=1722867786; 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=1v7P8DgVWEOiQraKJZCp7Th7levU77nqOCGgGfYFy3k=; b=nmTyZFF8qlBYQ6JLCoFxNTizXM9DziS9k90FQHWdD2DiGEmj4S3uQTtcfi4zHOjJcS vDXALwP2qsXi12e/YDtF4uyxHPgNXwihK525G9gUvlQ+7K+tByEsmtpYGtC0BThZ/ha7 cfdcQkhAlsQzOw5zJhc7M0Bs5BjKkPsVf15H2ned3R1whgCmKoyfjrQ0zc8EcpEM3XPX Iyak/hB4lakv+OT4JX5KvGT4ocHjxpknsofFGkI2SNZaLUa+p09ebsWhXhixlQ8LKLqh 5Q5TrcvSLbUsz89BzzDv2AInN06EGE6Uqn/S8oBjq4plLophFfvOsM+FeJ6PIEnv/Sv7 nEQg== X-Forwarded-Encrypted: i=1; AJvYcCXsFl2/6z+VcaRiqiGdi28VNADOIXfq6u3SlStwlngNfTDwt6F0tn8THqFQprV+ueZW7aC0FzpOKeSUBOz2STn1hokqXHM4lXUU X-Gm-Message-State: AOJu0Yz8OWPxWYwFhZml06IBwFTSmMWyYSXlLWwLPw4PlGT+qPern4zz W8tcUQIL4BDYahvFcM4Io8KYuObsOV6PncM0Ayivpa4LXvyGVa4wlxEKRYxa4jU= X-Google-Smtp-Source: AGHT+IH0i4SJoksic7K7uCsgqP3M+9IpULgJ5o8eJTMb+FKn2Lo8UBe751+qjL2E7UCdZzZIpyOlyw== X-Received: by 2002:a17:902:d4c8:b0:1fd:6f24:efad with SMTP id d9443c01a7336-1ff04b01aebmr124703345ad.26.1722262986279; Mon, 29 Jul 2024 07:23:06 -0700 (PDT) Received: from sunil-pc.tail07344b.ts.net ([106.51.198.16]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7fa988dsm83512965ad.263.2024.07.29.07.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 07:23:05 -0700 (PDT) From: Sunil V L To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Samuel Holland , Robert Moore , Conor Dooley , Andrew Jones , Haibo Xu , Atish Kumar Patra , Drew Fustini , Sunil V L Subject: [PATCH v7 02/17] ACPI: scan: Add a weak function to reorder the IRQCHIP probe Date: Mon, 29 Jul 2024 19:52:24 +0530 Message-ID: <20240729142241.733357-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240729142241.733357-1-sunilvl@ventanamicro.com> References: <20240729142241.733357-1-sunilvl@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-pci@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 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 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 \ -- 2.43.0 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 E6AAAC3DA4A for ; Mon, 29 Jul 2024 14:39:15 +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=VY7LyOLW+S99EgIV764DXtWByZSYjwLOlGDemtluiLg=; b=GRsP4tqvmRASdg F1HVdYA47kLpDXHmwKyY97wxDSffxzTticjD7Fmy4osF8CURxmBpsLWqf0HjboUOpx9DndjLwJ90R f3//FfGyxmNSkkCoTZDq7vzZllZMNgFpIXmqxjDjuDaPwIQJKU6gERuna33VEUuDOoRcvljkjYL0B tBVnGz2kwy8cBtVgTug+euXaOnZNp3KwB0qKSJ1QkKrg6QkiaseI9+y+m1VTZ5oNDu0ufmIwHEIub 5SynR34sqcDrSjo20LPuU9gyHlgK/qnSXvjpQUmkj6Sgugz1fJ4aImrSezq98kkLF5BfzHrlruosi BcwH5YGoUPStWrAcPV2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYRWr-0000000BfdI-0y66; Mon, 29 Jul 2024 14:39:13 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYRHH-0000000BYWC-2UgC for linux-riscv@lists.infradead.org; Mon, 29 Jul 2024 14:23:09 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1fd65aaac27so19278945ad.1 for ; Mon, 29 Jul 2024 07:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1722262986; x=1722867786; 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=1v7P8DgVWEOiQraKJZCp7Th7levU77nqOCGgGfYFy3k=; b=PkoDwsu0vP8cpQRm4FgQpLnjY5tj1+0BEIEn0RfnY6T/Lv+o5MeygjY0/0+Nzzu+h4 bsZmsoca49OgM3MoRiJrmfA7KpG67FwzcBfsm36IfwSNWh1c3NcSMfjWE3ffCgt3xrAY LqrbMGQ7zwq3yscoefTf9+uOcnmPq1DxYvwkOTn9EMUkMpgpaKLntppb94d+5bc7c3wc gTeycSYBOUJAuZIqcCccesObqHgt9tF2GajYeoQg4R97UD4A48sc2tBIYpgs6dLCll9B BxKHAhKCOX6EXn+ZAFui7B6hQgo6FDi3ihtNpFpOCbwvIFCd5KowYqNmW8qWlb3IJirM 2tIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722262986; x=1722867786; 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=1v7P8DgVWEOiQraKJZCp7Th7levU77nqOCGgGfYFy3k=; b=iVASTejcwg8RUjG1bW0z5s37/cGw+GvkLK2ag8SVS+j7+q8z1OKJBmKNfDIA1p2/Fa w2jP/jdld2pQzQKOgsbHRSk+WzT1JVMe0htnwnfP6N1wjOtj8yrwsYXsYIkEYxOdtP0q H2vAWCDIHaX6FhxOuDPJQxFxDrOiUMFJHB1I+IBaFoiAZ7fNv4a5AOefcm3PtB0vy7Dy 5Efdupxuzw8gSMdn3sZ71e7sm3T1i8x5OQiAkhyN+gOnrOVr9ImZGhyZpxYyckeDRiKw WdMOxRd0jsZa3ZqLzHZ2HEFn3IZKwqBuLaGp3qMLsXe9rKncMnXhw9PT5xYWGGqGZwkK oDwQ== X-Forwarded-Encrypted: i=1; AJvYcCXFa6UbRGEDYsO4txdbjRJhJGy0cqZ9qNFx7VLJHmc3V8KJTE6xp5+Hu58OTk5GQxfdOhMWT3O+uQCha6EqYMN7FkXXEU+CayoptkyonZnn X-Gm-Message-State: AOJu0YxqckREJP1k0srE7rkolrK7yvja5Kmdv9l7RampKIzBXAXKmmzy ArzbN94vSETaa+ZZmdyybqQ0BMUZBbLCMqSnEg9JIsRTQYMhflumdG2pHisdSxc= X-Google-Smtp-Source: AGHT+IH0i4SJoksic7K7uCsgqP3M+9IpULgJ5o8eJTMb+FKn2Lo8UBe751+qjL2E7UCdZzZIpyOlyw== X-Received: by 2002:a17:902:d4c8:b0:1fd:6f24:efad with SMTP id d9443c01a7336-1ff04b01aebmr124703345ad.26.1722262986279; Mon, 29 Jul 2024 07:23:06 -0700 (PDT) Received: from sunil-pc.tail07344b.ts.net ([106.51.198.16]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7fa988dsm83512965ad.263.2024.07.29.07.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 07:23:05 -0700 (PDT) From: Sunil V L To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org Subject: [PATCH v7 02/17] ACPI: scan: Add a weak function to reorder the IRQCHIP probe Date: Mon, 29 Jul 2024 19:52:24 +0530 Message-ID: <20240729142241.733357-3-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240729142241.733357-1-sunilvl@ventanamicro.com> References: <20240729142241.733357-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240729_072307_659942_851FD566 X-CRM114-Status: GOOD ( 13.58 ) 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" , Catalin Marinas , Atish Kumar Patra , Robert Moore , Samuel Holland , Conor Dooley , Palmer Dabbelt , Drew Fustini , Anup Patel , Bjorn Helgaas , Thomas Gleixner , Andrew Jones , Will Deacon , 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 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 \ -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv