From patchwork Mon May 8 11:52:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 91102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2115671vqo; Mon, 8 May 2023 05:28:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jjbjxqx5ie82Oif0HeE6UfUQ8TFs6i8M1E3kIUDTKxrPoX/Vdkz7QdbFP49Rp57xrWlVw X-Received: by 2002:a05:6a20:7347:b0:d6:7264:f44e with SMTP id v7-20020a056a20734700b000d67264f44emr13507240pzc.3.1683548887693; Mon, 08 May 2023 05:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683548887; cv=none; d=google.com; s=arc-20160816; b=M38bKs74HsNJi+qQcTiCkp0G6tLomVyO/jBOhIwvkuUJYRiEQ0lPzv7e8u/SG5GEyz T1BFs21iBh7lFkWCrmIvhOCWaqNaPaQxZJtszJY7C9c7/eVl5nVzWJA/vZPzV1fZ9PFq PNifYUH5mymB0EdkXIIrEfu8d9VlKrGjokE658X+4g/mvuPJiTV1bq/J6LY8iWqXppOB 0bTalWwe5ZgIDm6Ysr3M1spbfq7Xs/cOLxkkW9NB1IHFgrMWmS5HLpUm5eLcaKcKii8n Np01IBWT+K8sxO+9mGhKwg0iGtLquFrOeytdIJbtxFvFu/h4Fpq0MBfx84X6XYG6BXcP PcNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yNB5noEZPasx/OngqcP7wy15OXtx85aYSDWecQ1qX3I=; b=PKq4+UMZK4hsXNnUrJgPCu/cjhYqfq0iILizACnEzS2v0H0clIRpqY2H/nEJoRMKfu yuF+YZygkRyFUlDhrDySqe+1YhDSq+6l1j/flt4jiaRxY0n+SZmqBec6Z3W++beziIxV XtJCoyTYxGDE9/XrjuzdZb9oaVzP9N89FOPuIhqLDY2LnX63XWBgjlURoXKjiwDC6WjH Gn35/4T+TmRQc7NUTyXBxNoBMbWj5Lv+kJQ2TwcWlhoWjnXexMkP7Fm7T4WpUegG7swi sG6DR/8tKVTN/C9KZs0/fQy4qmYu39RNv2fRYOM56kVFmf9Wf++BwX1alO2jueQMEALr wSRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=bdUOpEXd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nu18-20020a17090b1b1200b0023d3fad2294si26480181pjb.10.2023.05.08.05.27.52; Mon, 08 May 2023 05:28:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=bdUOpEXd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235921AbjEHL4G (ORCPT + 99 others); Mon, 8 May 2023 07:56:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236534AbjEHLzH (ORCPT ); Mon, 8 May 2023 07:55:07 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2D43431C4 for ; Mon, 8 May 2023 04:54:19 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1aae46e62e9so31020375ad.2 for ; Mon, 08 May 2023 04:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1683546858; x=1686138858; 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=yNB5noEZPasx/OngqcP7wy15OXtx85aYSDWecQ1qX3I=; b=bdUOpEXd7GBDCNnXUsvG3ckYwryUiZjYQOSav9QR4GUG/8ayaYYTDJbjXmtRT0zXHg +eV9YbxhRW91B0jQB9sWuZdtdciKI6upjJ8I4udwA4rx3uxaZH3/cHQQIYX/BwmUfzpq NsqTsFR3sE7Sw5k7La5uhu2K1GfIJvVKlyUsE9CInG6jxddpYqF2680jb/sf33vgVttu fcjUSpTZANBOqnqT1fW/y+mY7OP8uyDjndoX8ITOfZTo5j6GWdLzl5yLKDZo9yepSUTZ j7MCN0w4HtF1A7pQPYPkQoqB1NHg8jHylF85r+oebUh2luVMl3g79mLXG0a54WpOSPgX TqFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683546858; x=1686138858; 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=yNB5noEZPasx/OngqcP7wy15OXtx85aYSDWecQ1qX3I=; b=FIVZ5ABVPrSEmJ8C5ZnbHna5auhEx+AtqtzEu+zNRM2e3BiyricY+cefXrSQVcUNdS 18OoocyP4Ja1DnB1o8O3gnol7Ah1jqb7qYZqDFJYO/i30yFTCcQtXFPCMZ6NfzgYfLFo q5YGvkxReRAc/PjIqGVxXIqOk3Xnk4UIlAg01h7zIxLkULfKzWoxNJoTelXOIPf4eUBt 6DJ6ceJ9OgZ+LkGR8V6T8Ryhv0up6sPtqOVISGuYEQfVOiMUGnvEfl3qOjytAc3grSwb cxQ6C61H2JTKjYC2navoXjeR/9Qj/AqWkwr89P9u7ag+WbJJfnAWQNCwDJW+1UtWWQwP 3sIg== X-Gm-Message-State: AC+VfDzKNv2z5htzGkLIPtZxCUH37s9bai37E78+SGMAyNcfQ3cWuyU5 Mo1zgEfaVYhX7BKI1uOq+7j+yA== X-Received: by 2002:a17:902:c40b:b0:1aa:fd48:f5e2 with SMTP id k11-20020a170902c40b00b001aafd48f5e2mr13594721plk.32.1683546858666; Mon, 08 May 2023 04:54:18 -0700 (PDT) Received: from sunil-laptop.. ([106.51.189.144]) by smtp.gmail.com with ESMTPSA id w9-20020a170902904900b001aaed524541sm7015149plz.227.2023.05.08.04.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 May 2023 04:54:18 -0700 (PDT) From: Sunil V L To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-crypto@vger.kernel.org, platform-driver-x86@vger.kernel.org, llvm@lists.linux.dev Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Daniel Lezcano , Thomas Gleixner , Weili Qian , Zhou Wang , Herbert Xu , "David S . Miller" , Marc Zyngier , Maximilian Luz , Hans de Goede , Mark Gross , Nathan Chancellor , Nick Desaulniers , Tom Rix , Sunil V L , "Rafael J . Wysocki" , Conor Dooley , Andrew Jones , Palmer Dabbelt Subject: [PATCH V5 10/21] RISC-V: smpboot: Create wrapper setup_smp() Date: Mon, 8 May 2023 17:22:26 +0530 Message-Id: <20230508115237.216337-11-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230508115237.216337-1-sunilvl@ventanamicro.com> References: <20230508115237.216337-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765328958424265395?= X-GMAIL-MSGID: =?utf-8?q?1765328958424265395?= setup_smp() currently assumes DT-based platforms. To enable ACPI, first make this a wrapper function and move existing code to a separate DT-specific function. Signed-off-by: Sunil V L Acked-by: Rafael J. Wysocki Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Reviewed-by: Palmer Dabbelt --- arch/riscv/kernel/smpboot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 445a4efee267..a2e66126b733 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -70,7 +70,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) } } -void __init setup_smp(void) +static void __init of_parse_and_init_cpus(void) { struct device_node *dn; unsigned long hart; @@ -116,6 +116,11 @@ void __init setup_smp(void) } } +void __init setup_smp(void) +{ + of_parse_and_init_cpus(); +} + static int start_secondary_cpu(int cpu, struct task_struct *tidle) { if (cpu_ops[cpu]->cpu_start)