From patchwork Mon Jul 29 14:22:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 13745127 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 8F2E3C3DA4A for ; Mon, 29 Jul 2024 14:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ivFx7Eb2KNlJll+d2W+eJ7NSuljATLtswxxJxue4OO4=; b=qzt0r83Px6JjnLF//ZR58DAAWw wE4FixevJrdbhrItq1VhA5UDQYv6GHUCwqFySOljkce0edi5OXL9BneMNuwWf7ByQBOded3xUdywq PyVCtgtH+VPFaT5dPRqb92vZDcTl2crLLTZGtoHfYlnRKoOwh8Cc6LJYrfZKuRH4LaSkB7vPdmFWA YgtZ0wN3WZ1PXxiLJGm8BLT/qHg/ACphXpFQa3wGpjKP9SjouXfBZ7fo9pr8W3f6/XrfaeyUrNbCu wDXeyh90XyzIpcgXD9mstCn7X/QsvYl5Lv+lKCsi3oiPBnYGH8W5PqJr0ZJ1Vg8y/uflqJ+zk9N3l 2N3T/G4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYRdb-0000000BiWH-0wvx; Mon, 29 Jul 2024 14:46:11 +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 1sYRHd-0000000BYj9-3iaV for linux-arm-kernel@lists.infradead.org; Mon, 29 Jul 2024 14:23:31 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1fd6ed7688cso21056235ad.3 for ; Mon, 29 Jul 2024 07:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1722263009; x=1722867809; 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=ivFx7Eb2KNlJll+d2W+eJ7NSuljATLtswxxJxue4OO4=; b=L1aZ2ElKlKULsCwMek1A2Q1ZQ7mCoeE2sV1nfx7hmxXbI1zRd1t5+GEGP6KI7jKCm/ RAZwD7X4W9143cjGnhqTONVKHXXR49FE8grOee27NYcbQlSC/GQxOHU8XvHP72Xf4kWK l0XlbZ+K7d8LKnwj1otNEaSUtTw0yncbAJ1Vv8dvEcWD/X5y9zZz7V9usAOAewhDPNW+ BVNg3azE4ZyxqPj3t4wvkVOXRxO2RVLybSWQBOE7/qntwx5Zq3SNYXBFQyNRfunGL1Y/ Kxnd9yIVtMTB8y5zwf3x5HboUy1NRdoClGmLeShgpKlInckIZmTQHGxVOKSf7BNiaeUM eGFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722263009; x=1722867809; 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=ivFx7Eb2KNlJll+d2W+eJ7NSuljATLtswxxJxue4OO4=; b=O186pXIzyclkvzkYFTWFV4oFpXKWlxYw08C3tC17oEdW/+0cIC1a4zY1OuWZxHMTxP mCXEE+cctBd/uR6u/sQPCSOJ7U1l6UQN5ilGmMvq4gfT50iV6mQmBDYVJ7pI0fCgfmS0 QSvS+V0AsFPf741QzxpgbkvOiQszODdfl6tFHfbPeTgDXYF8WMP6qFEEvTwuy2Q8a5Ic JkHBIjk74KobjcqMbBGVRpy3dPZh0n5FdcgN+Wd/CpcmxL3sRNJlTebnSiDOWKRYmXLT qg2mt6yPHOVQSAmbEn6ucnTd03vrapxL5dCAfMfdV9Ysah1AOo6zFpD+ECLZfmTmgVpr bPpQ== X-Forwarded-Encrypted: i=1; AJvYcCVpAcg1Q8BI/s6zJcl2DOUKXmPsOTmkkmGGAMYPTUCWjwDIDXBuR7dhG80Trsk9Nt8oOh2AIMvagV5fMprogFvyj3gGX++rtkdKCNiEyDqQ7SJ2gZI= X-Gm-Message-State: AOJu0Yy9qnWeWuUyseslyf9cLd+Rku9q7/AlXHLvy5kz+LvLg1lC7LTF 4SdPHc2Q9RI2p50uCOSDZE9icE6bgmgHWgjGVyt/WaliRZhTFRQVYcKJVcQ2UUM= X-Google-Smtp-Source: AGHT+IE8RqsmNLGZwn4UKGI9HbMHE+3KC0OV1lt+Ckv1MptlwMQ/WvrHjQX+XujtO97bjUDIb+rzyA== X-Received: by 2002:a17:903:234a:b0:1fc:369b:c1de with SMTP id d9443c01a7336-1ff04805ab4mr61618075ad.5.1722263009198; Mon, 29 Jul 2024 07:23:29 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 07:23:28 -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 06/17] ACPI: scan: Define weak function to populate dependencies Date: Mon, 29 Jul 2024 19:52:28 +0530 Message-ID: <20240729142241.733357-7-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_072329_949830_59D6D7DB X-CRM114-Status: GOOD ( 14.17 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some architectures like RISC-V need to add dependencies without explicit _DEP. Define a weak function which can be implemented by the architecture. Signed-off-by: Sunil V L --- drivers/acpi/scan.c | 11 +++++++++++ include/acpi/acpi_bus.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 39b3ccae9f79..28a221f956d7 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2077,11 +2077,22 @@ static void acpi_scan_init_hotplug(struct acpi_device *adev) } } +u32 __weak arch_acpi_add_auto_dep(acpi_handle handle) { return 0; } + static u32 acpi_scan_check_dep(acpi_handle handle) { struct acpi_handle_list dep_devices; u32 count = 0; + /* + * Some architectures like RISC-V need to add dependencies for + * all devices which use GSI to the interrupt controller so that + * interrupt controller is probed before any of those devices. + * Instead of mandating _DEP on all the devices, detect the + * dependency and add automatically. + */ + count += arch_acpi_add_auto_dep(handle); + /* * Check for _HID here to avoid deferring the enumeration of: * 1. PCI devices. diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index d6a4dd58e36f..af72a5d9de99 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -994,6 +994,7 @@ static inline void acpi_put_acpi_dev(struct acpi_device *adev) int acpi_wait_for_acpi_ipmi(void); int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices); +u32 arch_acpi_add_auto_dep(acpi_handle handle); #else /* CONFIG_ACPI */ static inline int register_acpi_bus_type(void *bus) { return 0; }