Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp429324lqm; Wed, 1 May 2024 05:20:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVgVkN8OJyB2jozTgN+ud18Ui4SDJ0zJdfVTfC1w6VCO2DdpbZygkuAdfD1qnIpXdFx2Mi0vDuHKMXoyy3MgTpT4lZyRSgu54t4GH/JVg== X-Google-Smtp-Source: AGHT+IHb/lk8sMeRx8T4hz7EgxVBnCuXg7FEERhMORa5WFAV23vNaTMI5L3mE6AXIAIERAoQaV1b X-Received: by 2002:a05:6a00:139f:b0:6ec:ee7c:141c with SMTP id t31-20020a056a00139f00b006ecee7c141cmr2524155pfg.16.1714566013424; Wed, 01 May 2024 05:20:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714566013; cv=pass; d=google.com; s=arc-20160816; b=DCud+ebywz3Q8H7nVpMJ4qUtMje6Bwnbktrr7O9ugRCyHuyvRyRHwbYGsrpkZsUdd4 lI/22sHqXDBVjjGr1cbSjnDpKrjxzOFxO6HCUM+wIP/NS3KOuPagdPCRTM8jAAk6/q05 rfgtOUxWWok95NviLMwjBk4BJOVDNSjL/vT+bwZEM6OaIBEExEZqOcDowQUcTD0QGOW9 y+h/N10CPO3L/GFDqOKludLAiPuZNlDbHVLS5A6slr2c4KiAPldLNeyM/9E/UDrNzac4 vgZQitlKN3GE3OzS3tyWiaO6qK2MJRJyIOumJ3MTZ8hkRKOSZHoe9A4OxJcS29y0oMOJ /wpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NJK7HUkOtgooa4XBRIgNv++I9VXVR1Nc/x5AlB9DEr4=; fh=eAQnkjtp23FtaTCI1kNeMlw7I7AiaqSfIBEGeo5WFVU=; b=HMK7PAWiROzIg+oR6pybRp8TNy4xM8I1a7QD2UJ+GduYLQnh29oINGX9JIPhl+1j3t bBTS9UVRhijr+rIC6wkIdCJoT9SUf63dc7Pr0WXSnUECIK3wn7igdVxCx2i07YcdFWI0 CVjATcf6fc2atY7rFQQRaVleQz7EbVexo+6OG3o6YUb2Mnq4oPGBo7Wce1mxlvM8dXeO tdxD0oJHoqSc2jdRAsoHAF3Q2LzAfHKYwpYqLyFsC8O/IUJqG5faHSZ9v7jJ7ixHP9OK KaEb4v4S6MzYOs9YIH5hmwh2YdGgDn3CwDeZ0RAYa82z/KbjDg69DZOxA1ylgtQD2+15 daFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Z9lae5WB; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-165221-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165221-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w27-20020aa79a1b000000b006ee2557baecsi23790598pfj.282.2024.05.01.05.20.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 05:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165221-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Z9lae5WB; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-165221-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165221-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1594A28581A for ; Wed, 1 May 2024 12:20:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8773112880A; Wed, 1 May 2024 12:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="Z9lae5WB" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E2F5127B45 for ; Wed, 1 May 2024 12:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714565932; cv=none; b=GMSN842J8Y8m79ZnggMCbF+5uc7jcZlKivniNzMr+s+6OUymwPkJLAJddgTEOttUZkWDx8ktcs3VMN85ietSj9i6acQ3MCemLdScLNBaYSwMdfsMWUhtnt564iJe9IbbALy/L+dWC460tyhQX6dHshQ+ffpn6d+Tgb3iumnblPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714565932; c=relaxed/simple; bh=p3PlpHNinxzAsGkdtYqlBifL18TCbYSIHjqjLs8QrEI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IzYtvxqfdwdMsZUdM3bzzMGkxvxX0pL645E/e4mG8stLYKv+6YKTXX9nGchLN9NSAP7sllpAJf10g225953iohzdSecq609WV6vJ+P7bZHtoX/LD1oAH2wxq7EoWao8Hi52KgdfEJoc2iowV5L8lSRe3xyeWpOoQP6yy7oc7C6Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=Z9lae5WB; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1e3c3aa8938so44173905ad.1 for ; Wed, 01 May 2024 05:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1714565931; x=1715170731; darn=vger.kernel.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=Z9lae5WB3xIDPGD4UJhZYx7Qa/W0uxMoyHxCTitfqGzsHl2aJUGf3YvceYTTv2YjG4 kY8HlmtlOO+jywWivI8kbB3H/WJxg6LqKzl/YRzxE6+V9B4lz1alJyBwdlosPiEPr7o+ i7U3BW8h8CeKjERd2hVcY8imTPpFNzLftu1faBTkTEjlXLWX2ULgDa9jtmXCS8h8A0ON Tzyvl9P7NHf/0F0ASvNoODm84DCosmG1pkbS+WYB2qzw1jhLhjmeEFdClKKrXwDnsJGP F9Vqy46FGobUcgLQK4QffJB4mqIABnx6LUU04HtMJBJj7zPF1dalE44NApU2CXV6Dp6O uZVA== 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=Bm7E6xBRSQFINcN1z9vhG/8/UBAalqFLzZNF2YDma46LvUAqBdcPXaic5RlaTSw6Ix J3MRYtXUyI0+fFp9XqOpPx8WzQ0KuqhAWCoeZEwV+tMn3vcvwRH9Mhrj+Iydlr/nx+2i jC0kgBlwYURJNg7Xd3eZaVaEQyrtq5im8UQSimJXzg70Vy3wOVaeHhSV9U1kVvj63qAC 5yKgIAeq4JePuDWqX7OnS+l9ixd+7+upIFkLcd9XbJ37PyanDujHZFNosWj3bFoEPROa Nw/0XP1dp1Ivx6TYJ66YStbPWArhazmv03VOFYEXIzjbGO3QiiwLAfqOrDOZdSLt44YX oMww== X-Forwarded-Encrypted: i=1; AJvYcCXLVmIu9uDKkoP57Bem0GW0k9EbdOJcOa6n8NQplYNF4IGlbJRFg+2MdRkXdWkDKitmJoBPMqIxUiv8qAI7iddcgeTznvc9WzqBt2vJ X-Gm-Message-State: AOJu0YxpbFhLtE1nuIIYJKiDcxMDQE8kh/2kyy+v+1adWTRy3hM6xBeH 90hQd5urUbWdUiS6CKMG3S/XDbh8CvGiP2osRTs04Y8Z+GbT8GMCUCv0G++BURs= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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