Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1570400lqp; Mon, 15 Apr 2024 10:04:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVT3UhPNYT3buKZGUjKYXUdeKw7cwVs51LEQPFVmwip2q6zh54AMo8eU51eZJEeeQXzWtW3bPmd5cAzKoCzQ45fXbmumgxA9Owg68+Aeg== X-Google-Smtp-Source: AGHT+IFuJfgc/G4apLSDB2yUjmcQpI1p6DNxrICxf5yeAgEA62nPBAWw4sYLfAvPBtnfZzjaPCot X-Received: by 2002:a17:903:24e:b0:1e2:7aba:6d0f with SMTP id j14-20020a170903024e00b001e27aba6d0fmr14032244plh.36.1713200693028; Mon, 15 Apr 2024 10:04:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713200693; cv=pass; d=google.com; s=arc-20160816; b=S06WTd6F4OJiN07s1hWAc43XqejUVgTq9nETyKbuqWFXyS0B0gBfXDcdDD37QtAiiF 4d//h7XfYXEPC88y76CrlIUcflQyIGh+T1BQCX9n2mwPPZQLtKG6KvpeR3cJRG6WQJIn uD6HkW+Y/txn4URvhTxOhW3IKjATvAd6pSgcuAaoZHf8dSS3SlBaNamMaJw6UArwVrUE c8QU1rqy/EJX5OmrEsYQx0rRAg/oM0jshvyLNQrLOoBNi4bzmtpaptCnMC54ESJb0iO5 WPsyCKaaYEgy4e32WSy32yd/6iavYiRUhqghCtkrTQvUIXpGLAcO7ff5Mk8UadduY413 rDdg== 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=c1X7evQ35uoewh1RNAGJwcs/iaU3rzDK4qB90vlKVhs=; fh=rgCIdslFkGxMVkuFDJ4aiWA16NgxxOk7uWowdDpKPMQ=; b=r4TCwlt1lnmUIAO29PXc03lfXFciFQr53g3nZJXGNhHeI9d3V9zrJZ76zrrj1RNw6Q Z3Lz5+zHZYEz9SvWchY/nkh1Tx0o2u6a0lf+9J/5epqw9Sw6ULGmWG6NuxkB37jV/keQ uKtKSs+xV0bG7/dT15l1RuZSCqaIbkMa2UcT4hwk8jDoYwWs5kkyK4S64vaGKxl8ybes BXtMmORauZSwA+6WpJmmUZHo3nKH0X0oCx1/EzQEXDcSWytMIVSoWlcrHOBPnFtgQbEp aSHSVocmnF33EmjqKZskyPYsGjrxP1kwPG50Hg4KKy6p5i9BHwy/H9Qh5JLMMhxdKTXx 6RsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=jkpX6yBs; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-145611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145611-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y1-20020a17090a16c100b002a244f3f90bsi7966480pje.107.2024.04.15.10.04.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 10:04:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=jkpX6yBs; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-145611-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145611-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 8DACC281E9C for ; Mon, 15 Apr 2024 17:04:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBC8684E1C; Mon, 15 Apr 2024 17:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="jkpX6yBs" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 C94981272AF for ; Mon, 15 Apr 2024 17:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713200560; cv=none; b=cL27JjAGLzYb10LB380BqnCkwXED2T2yvxAWEowsEIUlBj2nYj/GULpXHAYGWg0W153J2EPLVizMFjgcNRiuoCkTcPV2ePwm64vI/0ROZElF2Wnt3uj9Rq5xplEJA+TJtMiRbthvGxqWauQT6RBJCD5KD7l3s0MDs6k51P9oE14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713200560; c=relaxed/simple; bh=LYtUv6qDwrcBtr8K6aN25hN45uuc46R4wBZ+hNYpcAk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QRDaPkYNS/m9OBTQVUY8j7/yt3SxP9RdE01pvaCBFyZAR9fNj29bBpkE0Msh+19CQkLXED5gXh3FCUl6xHiKZKInVSItOry8e+PY627nY2pYulCf4FHN27HQTzjG5pAGQjoLnoYMvtdV3XLmSTpQUgjnjTXNWKmnpV61Hz+DNL4= 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=jkpX6yBs; arc=none smtp.client-ip=209.85.210.173 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-pf1-f173.google.com with SMTP id d2e1a72fcca58-6ed627829e6so3793132b3a.1 for ; Mon, 15 Apr 2024 10:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713200558; x=1713805358; 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=c1X7evQ35uoewh1RNAGJwcs/iaU3rzDK4qB90vlKVhs=; b=jkpX6yBsDW7onPzCFAsKKcOMByACBD8XrIKYAhwQhMZR9kRXkw0YcTdqLkecL9gsIl 1iMrioEqkRlgVQ1B395y5gLmXpuH/dlRPyNddKUCZiSMgisGVjWFD1XV0vujsNJuC37Y ssPJBPXAS9oldXT4YCKxSyEQKrKVFWSoerQwR9ZaEQO4BMmn30eWIj5/6iWQ2dKn+FoU FsVHFjxm6SgMLyyJHs45PbaYl65N27FlmU5aqVLMJM5t2YP8SIkT03C6EHHgFO1he6tQ MeMzRcSpJCoCI5N9wWUhDmowv1fiYVgqNGkD62YFy4JCedoEdbmz8fBiQ/hTryCiEZcu yuzw== 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=Dh5mYhaRP09TvpVr0SE5XlLAd4VX6ECkSAuLm+oC+ECb8F43Xknd0jlI2ugpDRvr7E yvQcKoQzLsREjKg5VmDwcJsP/04ORcgu8msiAZmmiBQ5x7OsP4w63RbXRnyIAmhdkdkv oXANV16nAewdFaWG7UawU1iuCmysT+NicnJnuY2qerV3ra6+B7+2pgwCSdUXGgusoA3m 3rAt/As4OjAzsx5cJpJBVTY1PCiZGb/31ZjhMXtrJMfszNcM5BPlbmrR37dFxCsWWFuK 3D8dAwnRH7x3DXm1mkYXAb8usXB7zOO5z92W6VIGAMry6rFFfoF7qc2iha4xFw+nEMz8 xHDg== X-Forwarded-Encrypted: i=1; AJvYcCXN2FRmhJklP9OjOKZY841tVjtj4m0Nooy4nklbZ3ped8Kc4ErcfIVBLAhDB2BIJ9mOir1jHRke23on4BL+lX7yiPT8snHtyG8a9nPy X-Gm-Message-State: AOJu0YxZPkpN/C1IzTRxzWwUGIHd9hHX0JTxcGdX3mhmTdwOFNyJGCE/ 5QQfvx/AqPNfaPJeyHzRfb9RjYz/qmv22TLwRdcxtPMLKc/pYrC+esPILYluvOE= 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> 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 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