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 DC23FC25B74 for ; Wed, 1 May 2024 13:46:03 +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=epmmgyueRelqbCMY7L1Ir/De00KSEjYGCKLTD1zYb+s=; b=XCtJZaNefDdxae DXMS7jqNtf2Wlms0gJHUiO4Xzmq2AiCoDfICZBSTlq8rnJBTC86HwwV0nRYtZnUc+yz/u1ZwsTx2D p46Oal6jEVZIFVY5jwD5ywmNSpj+BKLOAJfEdTlpHGBoeaCkW9q8jlG7ZikqLmL4JekI1TDVH7p7p TSsf50neODPZUeGVKTxOFaRgA/9sraI4VSZXfrWt4XX7h0+StvenfDTVLtFIEIYCTxAEdIX2zA3jo y08vTXChB0VccpURzLr/8tBLCrmO+OeXjvGbSYEJuQh9BHw4UAeS33h28sroCpZ9YC6CE4JIf7k4/ DweCqe4dtVkAJWy/ReJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2AHS-00000009iVW-1jgc; Wed, 01 May 2024 13:45:54 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s28vE-00000009MnI-0QrB for linux-arm-kernel@lists.infradead.org; Wed, 01 May 2024 12:18:54 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1ec5387aed9so13692365ad.3 for ; Wed, 01 May 2024 05:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1714565931; x=1715170731; 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=NJK7HUkOtgooa4XBRIgNv++I9VXVR1Nc/x5AlB9DEr4=; b=nf8fiv7sYaqw1rnr92A69dSp4C6CzpWnDfaHV6+3ZP5VGsdQhzSDy5UxWQJhw8MnEQ 35wfCZPxSyrUTybRvOGTSjv5sFMx2OPp1/3gEMFHEouYk+HxDs4mgVrtKXH9WN8Q7/XL JaQ9jtRtx0aAtd8YWZDuUHRQHBf3jYM51UDMeSi8F49ax6RW1qJVY+6nSYPrBtkrql9u T5LomZwhXLonyxxVtaKItue47MTSy5+WqVtR7/V63chvjaZ4wX/DRbyhjHkLDYIbXFne s8yVQn92r8IYieHgie644zZ1qCgdQGUP4Bs3pbGr2Ffonpvyk5QYeTszvh5syFyblvHp kMXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714565931; x=1715170731; 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=NJK7HUkOtgooa4XBRIgNv++I9VXVR1Nc/x5AlB9DEr4=; b=KCbpyFj4htwTo1eXATPIMH67P8KEyeHklJx7dnyTAN4mcCG9tZOgM4WEssgxQMVpUG lLzoVr2m4SFLyqJ1/UZU9tXv81QXjkF4+oULLdA8mzpCNcKNN+0Cb8S9auzRApX80GjG komHA5Z/3jagvFK8potLW2E8W60jk2O2Ng2lpiU/qHd8fYRBi9GC2llCwPa8gyvTktaN MlpFlF5deQz31Lgyp7Xy0z26NTnjTudVcHTVrNSfZbHYRwaJleSglF9pcfBcDcMeDH4T NCl8eoNYexEtvbADrwkTYbXpw1/mVsnhSt4zSll6+cPQcYnsPrfO+7gPGp3rLMrgrReX qp8A== X-Gm-Message-State: AOJu0YyadpjyRt+4NbnyP57jDP4KPw5JYHkh20WYHiOOqKv3EbwHprSp 3Ppx5CT0gokpf93mST/kc+v0LvupL4juHYK2NiSxL/jnSfKcSzdCB4bzLZl3kpZSUHjS1vdkuXl wVio= X-Google-Smtp-Source: AGHT+IHqQHwdtyucv9ZMhP/dVbiOcapAJDdX24SUfAiXrmEd3YjBfB6sjT+VYhoitv18fuYmxMjC0Q== X-Received: by 2002:a17:902:eb4a:b0:1e9:470:87e6 with SMTP id i10-20020a170902eb4a00b001e9047087e6mr2178199pli.23.1714565930746; Wed, 01 May 2024 05:18:50 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.188.106]) by smtp.gmail.com with ESMTPSA id im15-20020a170902bb0f00b001ec8888b22esm1336900plb.65.2024.05.01.05.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 05:18:50 -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, linux-serial@vger.kernel.org, acpica-devel@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Samuel Holland , Greg Kroah-Hartman , Jiri Slaby , Robert Moore , Conor Dooley , Andrew Jones , Andy Shevchenko , Marc Zyngier , Atish Kumar Patra , Andrei Warkentin , Haibo1 Xu , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Sunil V L Subject: [PATCH v5 06/17] ACPI: scan: Define weak function to populate dependencies Date: Wed, 1 May 2024 17:47:31 +0530 Message-Id: <20240501121742.1215792-7-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501121742.1215792-1-sunilvl@ventanamicro.com> References: <20240501121742.1215792-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240501_051852_163693_2069FC66 X-CRM114-Status: GOOD ( 14.79 ) 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 beded069cb0a..3eeb4ce39fcc 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2068,11 +2068,22 @@ int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices) return count; } +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