From patchwork Mon Aug 12 00:59:18 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: 13759959 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 7BD41C52D7C for ; Mon, 12 Aug 2024 01:04:14 +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=xDSdXT+/25tukKINeWiVwbEFy6E/k8M9nvWNTGOKbLk=; b=meVTCQlJGwvWOe mZWuCVGiiZyp7ac57qPSgjix1iYqJxws6gGz/Sq46bH5rAXTN5GXayASQ7eBN8nbVI5mmw/bK3ANI vXU8ZWF5h/Zx0G7EJRf1bN/D5q46879CM4qF3YuhGrZk/fK9JTiLZ/szrC0KIu1d1itewZXCmrLvH wT6OvbumDAipzKCfrwkTyEEkOjiU3lMznDW1lxAqVTQ1TSevV1nolzzmGDrCu/EZJ1i7XqCa3tnlh Ta5Wew6DJhH+HTO+RJS5b1FQN+j3T/YKXbRi+xoR49EOTte21PfTJUE2WsLHBTCM89diQvXm61fi+ fHTQcuixW5iI8hP20PGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdJTn-0000000GbZi-1hVU; Mon, 12 Aug 2024 01:04:11 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdJQ4-0000000Ga1K-06Kv for linux-riscv@lists.infradead.org; Mon, 12 Aug 2024 01:00:21 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3db12a2f530so2893741b6e.1 for ; Sun, 11 Aug 2024 18:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1723424419; x=1724029219; 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=iVnO8D9tH0sab/WeUvbej3ReIYXoTsQSEaRkiw5yKWo=; b=PDGh1BxxbdIhHoHT8s4NUda0rTY8E+SdvytRhN4M1FBwhU/n03jhrjA7JvQ6JwZbb5 FaBhNqGdvYnpvDSA2CemxWuOfRwAv5kP9XDyHe/thasgje4hkPl+zSwvxANhCPrGGi43 pgIAXWg3zNt4nZ3TKzP/lTcCSqChAfsvqtT8OVvrYjqzK+4t6UsHSRqmhs7JxeitIOl0 /Qm5d9oJI7GxyPgpyRgJAvguCdYuaPSKI+MnfsJQfcssbpKh6Iem8jJ2eZBZA0gB0s3T icwO+3nER61Wmy8rh7KQD2OOTXWl0LNhcAJIT9MZv0TDwDe2TIFmbjQEWp1V+jegCddh lTuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723424419; x=1724029219; 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=iVnO8D9tH0sab/WeUvbej3ReIYXoTsQSEaRkiw5yKWo=; b=i5r2NG53W7g4C/2EHa82dHPQHyowermHt/84fXxFFfQBCGtWJQPV6V+mpbMgrj0sRl tE8CZgdgF1UQVodgwSqW0MiR8Ussb+Z2IYHbxF5NPXKqEYdGgptmmymHO/wo5YhHiQEt d/biae5xZoSfsUiStxX7GIRp9Lip+zjKGc4pg1t5abjYDmh5ZrMb6gMkdIW6cpd/HXks Ab6sGige/ylXPseQMNMWiQHkfSbJClL4nRfDt3Oqm//LqJB+p6RgHavzoQTEQ0zrhqdi 3KxrRLxfPyPslFotzqbxkhNMYPAov4eH1vvYzHzWHiG9n6L2ZGPrb7upFiAgATdfcjPI eGDA== X-Forwarded-Encrypted: i=1; AJvYcCWFAVwcSwWXtVEb/5JtE1ErdGmvlp8mUT2evlh1kpVBekn1vXOTL77/IyYK4NdXcHreSxXBR0u+p0Ya3Yr8tW6KRRQRtDNUTobCXq0PWA+a X-Gm-Message-State: AOJu0YxHMgkllox0Euow2Gma30BEaRRGFwrwvQtyTMjVBEQNy0TKARsa f1hy14Mu3TewycuMkSOqO4yWwF/+HDEdSwWBMCXSW2gQuHNwM8VqFhBQDaIXeiE= X-Google-Smtp-Source: AGHT+IGgnQrX14dxOj3yn291622Lxvm1iCgbP6yN6u9XpX8bxmUnRZf2Nt8a7HJ6YawHB1+ioO6EHA== X-Received: by 2002:a05:6808:1513:b0:3dc:299d:c4fb with SMTP id 5614622812f47-3dc416ec02cmr12205900b6e.40.1723424418770; Sun, 11 Aug 2024 18:00:18 -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.18.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Aug 2024 18:00:18 -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 06/17] ACPI: scan: Define weak function to populate dependencies Date: Mon, 12 Aug 2024 06:29:18 +0530 Message-ID: <20240812005929.113499-7-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_180020_088929_DEFC4AFD X-CRM114-Status: GOOD ( 13.05 ) 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 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 Tested-by: Björn Töpel --- 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; }