From mboxrd@z Thu Jan 1 00:00:00 1970 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 3C8461272C6 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=cXrvvr06oLryJPe6wQPBY1dJGfuDFDakZt2mHSt9fzJtV2FaZwZIyr/+RQCG9q03pcojL8Cu5eZ3vkIdkb7Qu2XmXodHUV04oshvo8gpL5NiULzrylJzZOxzUzHGZXGn9wIoJPB4zsaFL0yv6PoWa3gU8917wRQe9Qk053hnPOs= 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=ZhA8TGwL; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="ZhA8TGwL" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1e4266673bbso60763175ad.2 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=lists.linux.dev; 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=ZhA8TGwLFjbxzGrVMnl64aQ0Tx/Ydh9xyaKn1zRprm0kZOt2OYACbBdKc+VoOuh5kV suV6jYTBstHCX+ZxLZPLjF/iFFclt5kJZ+wXeALaIxzs+HNLyjqYKCKJQkQ8io2TVy9D gTT3syykUIGkaz6O8EzeCQb6pilXVdRdA/piJ846Y6t/nymKMhs90XFCuOLXuEj8oNIV OBRk3602Mdi8OJZ+JOQUhrJIxPsiyYABQA70l9NhNchzOn/eDeYtIAuxObj91lPNRUcY +k9VhmCcD1Gkeu+OYJghdduU46eacaeRZr/C21zd9OoxZin3kdIOT2kI2Z63nhJ/rv9D 4AgA== 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=QpgLiEh8kXg1lx5Mc/sIU0m8ImhudKJX/TwrkhQVo6bYnPaIQphH721RT3OBXk6zVh gkpWjacvsJesSK/HB5jjQQ0ieRJiIenBxnjlQxrerbraOfQDnvBTjvfSTZGiehF0hbZK 8Klv8fXxvaBvVXoJfMKUd5mu45uqyK8MZ0xX266/ifn75PEMOhsG7VRG2fLPpRxEVsHR izbKWVcDcevTo8LkXN39QSCbJ5XUdjF3Nv9VEB9FiTIicPYpEsQTgbiB2+e7qqGxSuYk baQC3ae+KmrhdwRxLdFe1aUd91U14wEaBAlwpsYW38UA0YwD5VKWtv5zjs87yG8QaHCV 6gKw== X-Forwarded-Encrypted: i=1; AJvYcCWqAnNmdJ0z87in7tqc9qr+QzAOUhBQdf0F9q4ZlYCGa2KoaNBvXyvLB4mPNoCNRbjrUNeXJAlcACRhsim8f5sd+S0928rF8Lb/RElb X-Gm-Message-State: AOJu0YymsegjGGpt1qRayEH1xx9A7M6cDEwMxKo1rTph4E3rWOpJzF4U CUua8XMlxdxqzTpuyrG/4QqBukm1X2XPHCulMQb1XWa5+Ei+jbOEyXEi35NKYk8= 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> Precedence: bulk X-Mailing-List: acpica-devel@lists.linux.dev 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 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 416CEC25B10 for ; Wed, 1 May 2024 13:46:01 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tZyIOEYkrXWPi2ctsuW47+6h7pDCZiWMvFbTfGjunfg=; b=DAhznYpH2A6Ox1 4mFyFTvCIisRr+j6obaQ1pBLlkPh8I63hLrl2jLZtYax0gzGAPJEMcevOs5lccmvwoIS1Xb3NdouM 05x2GjmSODklqugQSom2pZgsGoLJX0t2G6oNu20icuhJ9se9o0VkCwZM+WeCqTl4VJ9u1ZGOIl1FD muWv0pxTltDmTmKZyr/ZWZ76zfyfgjc9EX9F5NOX0quN05ZUTUE5fU1dgQ6KIEhD0S10sb8daO2cN +mn9xAFhx6a9QbUursTagcghmo7oD1Tf9BFMp6xD6OvA5W5P+sZd9E8KLgxZYVkbPNh3mwo6SEt0r inkhBtgMH35pMcZUZcZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2AHR-00000009iVH-2pLd; Wed, 01 May 2024 13:45:53 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s28vD-00000009Mmn-1UxH for linux-riscv@lists.infradead.org; Wed, 01 May 2024 12:18:52 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1e4266673bbso60763195ad.2 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=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=Aw7PB1z9ioG1fusI21FxDXYerDwJFE4utqNNPApjeO9+LXnXfDRiLiHUaXer/1/b1b fldzDgJ5QAylxPn8hr6sW1sRL76wNjESaUwYB82FHv46d1dk+yiAqNjOi5fcFMF9neB9 8bAtRcRBMcD0O0QhW1n6BOkN4H1NtNV1xbFFDYsZ6vief/ZbwCbbsaGWaagODK7iohMZ SIHwIynu9GQBqib94osqvtBIt4sTvUs3KzYB+6GEH+NEqLOF4nE/73fBwkE4QSD/Oezy 5rPG6qmyxobPjjRmy9cRis60aoCInaaeU7S8lweFMy/McLI4QmLOmGjOS6sz0EhvXfLY kKbg== X-Forwarded-Encrypted: i=1; AJvYcCUNrsT5ZgaC6ZAxQi00d4C8ZTNLEFAH1kqzlSo+cscxgY8u1wsC7NFOT45zUEW7k8Me4PuHunOhVHEb73CDD5Aq2Zib87WY0HVWF0hpenDY X-Gm-Message-State: AOJu0YzJlXM8mJQ5KA+oWw0N8NfcyMb140l5tPf1Cy0IG9HcQmYA2A5N JtYtShBylDqevvhiovAGQUODAaZZw8+iTFvK62N+z1+j/c0QxdEH5U85Ok89SVE= 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 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_051851_434005_2C0A6070 X-CRM114-Status: GOOD ( 13.28 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rafael J . Wysocki" , Catalin Marinas , Atish Kumar Patra , Conor Dooley , Jiri Slaby , Haibo1 Xu , Marc Zyngier , Robert Moore , Andrei Warkentin , Andrew Jones , Albert Ou , Will Deacon , Paul Walmsley , Bjorn Helgaas , Thomas Gleixner , Andy Shevchenko , Greg Kroah-Hartman , Samuel Holland , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Anup Patel , Len Brown Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=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-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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