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 E7E63C4345F for ; Mon, 15 Apr 2024 17:04:43 +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=SOUFYUx/3Z+qwoIPgpqZ10W5mKfs6nG7VMOW2uf2JwM=; b=zDhiynAXZwldaB bsMj6/w7b4xah62xKdH78adtVUcU/cF6iziVXsAuvYUaiIy6tCRJlIbEfWum4NSRCPyw5wYHHHZZD KMYCgyMp7YEHHbhs7fKRs9/EiwbYDlUDH3fi3IGLyUe0sC4Bq3lWvfG/12yJAhrbOAkpNrZ1KQr0v iay7bkbT/xPkUhA5ClIgwsAecT9idMA8+uPWQdWC0S4jExCiuHTYPFNVsFrnsf0fLOFnuN8zbO9ZS lx6mwJF6x5piqcndtqx/BKF0LMLz8wejNcB2M33iwfezpdtagMJDR/OGJvPlnwGu77LzzZJS8ZoU9 AuKk5cr+Jnfdhg7ccLBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwPkn-00000009DIF-0Aht; Mon, 15 Apr 2024 17:04:25 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwPj5-00000009Bvq-2c4L for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 17:02:48 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6ed04c91c46so3650169b3a.0 for ; Mon, 15 Apr 2024 10:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713200558; x=1713805358; 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=c1X7evQ35uoewh1RNAGJwcs/iaU3rzDK4qB90vlKVhs=; b=TVAvIrfMtQduvk8zQ40e/OYjUGhMHJKGQ2zUVoNQVPGbvqTUBCTa+WQAv3nXzOMqtj Af7MQ0ElKh/vJfTdwMo6ppGoVSJ5bFFU+s6bOA7ym+MYLgDJEjk4vGMHQxvroSWeQQAj aufJUtspWr/lYWGgYuzEY1go+yUG/UNG6S6dgn76rNFEME49K7kbSxUC2aXLFF+hYhkw uQtBy/yBRPMk8/nNjF81v+HbkPa1Y3GFKs5+ijF7meQtD8duDHL+S5dXEWVwmB7QUlSx b0kcXnxZ4jK/PDajEyE8FKzJu18Hrb2Tif9sMrioNOdPjUQCsTi06uPz0r8Q2bd0BuCb dWCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713200558; x=1713805358; 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=c1X7evQ35uoewh1RNAGJwcs/iaU3rzDK4qB90vlKVhs=; b=qDmUF0pkTxb32QvXb0Mf6pNl3sm+5+3tfcJUp8cXTUXJ3b+9a6/2omUcFcZ3NaNq+1 PonI+PeLYNKnJmUl0rXzptuEwb68BxQNfkwDjC1DemeuifCTb1wbo+S30ZUsDtOkiOX9 qIA+o9qoEApuQOCX+W90iLjL95uvMW5wkMVqTdfm+H5mqnIOJ75XR1BuoGnFYyh0n2Hi mDqmK/i+8/szXF1xdcK8MNK+6KwoaXMJ8sOYrab+R2P3YM8WkxN3vlhM7VSpVLOe4cFs Cz3IwN+AtxdiM99HiwGfSNAMyBI4A/YOkGpq95GIq2yFskHj71UtLSgapjgLWZt0uCYt nSiQ== X-Gm-Message-State: AOJu0Yx59N6+D0QBx1Ip67ytqdTH+Mo+v7E8kKUiur97FWHVgrYasrVL 6iLocsl31PBUOfP6M38Kcv+IdNwc4Qo4BWX9cSCmlCFKHI5pfMBjJ8168Vqdvbj5HFSDiYjel7J s4/Y= X-Google-Smtp-Source: AGHT+IHP5Rv0C3YxWinnwyj54lMdddb7BaD0yQpP0Yg8Qswii7cMjohW9Wcp53K9v1it+Ov4jHo51g== X-Received: by 2002:a05:6a00:181d:b0:6ec:fe26:4ec1 with SMTP id y29-20020a056a00181d00b006ecfe264ec1mr12412388pfa.22.1713200558011; Mon, 15 Apr 2024 10:02:38 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.187.230]) by smtp.gmail.com with ESMTPSA id 1-20020a056a00072100b006ed045e3a70sm7433158pfm.25.2024.04.15.10.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 10:02:36 -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 , Haibo1 Xu , Conor Dooley , Andrew Jones , Atish Kumar Patra , Andrei Warkentin , Marc Zyngier , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Sunil V L Subject: [RFC PATCH v4 11/20] ACPI: scan.c: Define weak function to populate dependencies Date: Mon, 15 Apr 2024 22:31:04 +0530 Message-Id: <20240415170113.662318-12-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415170113.662318-1-sunilvl@ventanamicro.com> References: <20240415170113.662318-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240415_100239_914650_C125B5C8 X-CRM114-Status: GOOD ( 14.44 ) 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 07e91616b7d4..8e23b9508716 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2073,11 +2073,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