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 64B2CC25B76 for ; Sat, 1 Jun 2024 15:05:41 +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=OuFRSlAFxe9gUv+o5jLC3lIvbqvhFkcUY2ju+g2s4PI=; b=ruatEQmh2EGQSC 2H35ywKokU8Q0YaEAk1gI2LR7+JYUoBqAX31GkssxYWA34VsjgaCIxDv+5Gvwb9LbC2DNKEZUNFMZ w/bAtk3aB26QVcV6OlQFsH/sHZEQlD6q+y5g/xQPNiwH6lh5MH14sdyLVruUP8fFCpNNdcrZZmDR+ TirT/JOyI2cX6nCmEEnRFsAGLsCpWS/vsOqpvnyZyB3MUV2yK5ClLaplpCOK/NRUdrLunAOPW8exJ xPecauJIxhvV4nDw0qDoE5r0EQ3XLAE6mTz6BkL73i8VAwylMG7eWEXFVDfzplUMFbLa6IMzFncBt flXDE2NiZL5mVNeR6ytg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDQIN-0000000Cp7C-1qjS; Sat, 01 Jun 2024 15:05:23 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sDQI7-0000000CosT-0DgL for linux-arm-kernel@lists.infradead.org; Sat, 01 Jun 2024 15:05:16 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-3748d68b713so5531745ab.1 for ; Sat, 01 Jun 2024 08:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1717254304; x=1717859104; 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=Z/CsLBy86VnyNo2isQPCT1WZPGBpvem+xh2ISHmLXVs=; b=KOOoMZxD4hXaZxIikTlth29RBu/2RWasdlHrhp2lii1+ml+8PgBDsJd1ejvLCRCcr8 2QdE463biQ+6ES36h3FQGDtl7oKzV1Ac0Z3A+9J4kZGKmwkcu4JGglCebIbZZZXJVbHg PEnMPK0To1hx5Xv5aFpQC/VcUmxP+Hct0/vV7iOfHth3iTEOAnrCmGHThGrE5qHcEkl+ RtI+GzxVE5+eZZs+he2Wt0VW38E12ZpPiurV4LXbnMcxexlcqQ4bJA3oOGQM6bl9S5hv W1BQbsboh1rRgodUhZh8piiCHdkrkqVMYh5TPd7+NUANCjtauu9/JcnDISXxSUDMg8F2 VlOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717254304; x=1717859104; 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=Z/CsLBy86VnyNo2isQPCT1WZPGBpvem+xh2ISHmLXVs=; b=WqgNVqMic2eCyB/rL3hMpHtETJiz6prh5mTPeGf5HV6LpugiNAoYehlqaI8yoWytdq Agf1hAlOgWb5mxamyvaB1FyNQqcWGXVN0tM0KSj1BIHfImviZ0vPYOksOAjSe8Gzcr5O 3ZDsvjp23dXr1TdF49q6KCNGrYoOygHU8oMNLgEiMQ6RTQIsQxl6gqmirCyIjkgf6eYs P9gLn84c8yLbSjlhzIQ4B+dchdLxjjhofCeV3PDudvhwFDQ6TXpbLFFj1uajIcwY6iup I1RM+hfu/T9zMeFL9CRauxYHeBf1PbNZU246UG35YUYZfyXT4mh+WmwdBe5HJ1WSSKQG KLbw== X-Gm-Message-State: AOJu0YwrDWaGvEVa5vNCWNpEgYOr4UfVr3TGXokEeqf9whzG1PEqTboV N/Erf4UWMCuaWLhNHOfj0THWtvRQzj63Qij1JL0Si9fEh7guNCgu1JhdqPDskZ/wVOals0466dl cCRk= X-Google-Smtp-Source: AGHT+IF3OVauvlGO1nxR3XDABScTnbIuW6VxwtguVbngDcxS9MthKKzwc9GQNZ47KhPfz+utEVmKGg== X-Received: by 2002:a05:6e02:1a63:b0:374:5672:6791 with SMTP id e9e14a558f8ab-3748b97ee00mr54534805ab.8.1717254303897; Sat, 01 Jun 2024 08:05:03 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.187.237]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6c35a4ba741sm2559410a12.85.2024.06.01.08.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 08:05:03 -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, acpica-devel@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Samuel Holland , Robert Moore , Conor Dooley , Andrew Jones , Andy Shevchenko , Marc Zyngier , Atish Kumar Patra , Haibo1 Xu , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Sunil V L Subject: [PATCH v6 06/17] ACPI: scan: Define weak function to populate dependencies Date: Sat, 1 Jun 2024 20:34:00 +0530 Message-Id: <20240601150411.1929783-7-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240601150411.1929783-1-sunilvl@ventanamicro.com> References: <20240601150411.1929783-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240601_080507_233912_4F31C9D3 X-CRM114-Status: GOOD ( 14.22 ) 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 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 6f3152170084..918e71fc54cb 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2068,11 +2068,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 28a9b87c23fa..5fba4075d764 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; } -- 2.40.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel