Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp501351ybz; Fri, 17 Apr 2020 05:12:27 -0700 (PDT) X-Google-Smtp-Source: APiQypJCWXeiK9IL6v6vOMreYPEpgdXqwZoZ7huFJO4yNmKdoVqkOLJgAiI7IT9IRWW1Da4cM/VX X-Received: by 2002:a17:907:2049:: with SMTP id pg9mr2766775ejb.248.1587125547621; Fri, 17 Apr 2020 05:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587125547; cv=none; d=google.com; s=arc-20160816; b=kvzUI9IJHQAHoMbntXuTrMqAZS2nWzm38jtV+lrB4bqplEdkiFhZUz97R1m4tpxZgk Gf+eC3czAm5P6Rebr/MDPLCJyAkxYB130DWkjNRllhoDiKbaEZ+Hka4E3q3sNFprf1Ty zdEWvNDIY9+2flk7fYZoLAXuZ9Vj15ULE2jZK3EtcURJMww361LhS9P6pg38YujBMMxa WVieUtRiXHrSnUwWTJTYv4dF/h/e7lKugM+vFyGtlRtvDN8cAbl1AyNd54t4IYJefI8I udom+x/1wccVQDVhryJqyLftY++fnsj/ubkYgm3TIjSCzYdG9TQ0EXs518G9o/95GtCv YMHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OW/veivYz8ZKWPuu2zYUbg/pdGGB7HhUQV0WhWZdFOc=; b=zkEJLJauxvDdM+YMXwSCvvhj2DrAMfn1/Sk3KZ1ZkKK6q89OlXdvJGEDbiVgibKpgl PkDMt28sajSkO8kZG+uDr8gUwFlpF9dDnsvCC4ZcdY5OiqXeotoQXTBhpIq4y+A16pGb fVW+g9J9p3cd8sa+IFvg141E/HQqmL4i+8ADyRJU0U8Fa6HbzjtOJqbevJoADMlw99Q6 PjQQuvaohjnBH2T4JY8xQAGxixT2K5QHmeqma4RaNPNN0uQd7X7c7WK9PwBPh31pul7H CA3zVB/grC27MzJoE4SHWbdmUytTiQn1/IgHbXUH2om0YsXESh8w3DRHZDsmd34gdCFB kJUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r28si9412289edi.545.2020.04.17.05.12.03; Fri, 17 Apr 2020 05:12:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728349AbgDQMKs (ORCPT + 99 others); Fri, 17 Apr 2020 08:10:48 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2352 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727824AbgDQMKq (ORCPT ); Fri, 17 Apr 2020 08:10:46 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 95E8E8E4E9CB12F4DE12; Fri, 17 Apr 2020 20:10:44 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 17 Apr 2020 20:10:37 +0800 From: Kefeng Wang To: , Paul Walmsley , "Palmer Dabbelt" , Albert Ou , , CC: Kefeng Wang Subject: [PATCH 3/3] riscv: sbi: Fix undefined reference to sbi_shutdown Date: Fri, 17 Apr 2020 20:12:22 +0800 Message-ID: <20200417121222.156422-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200417121222.156422-1-wangkefeng.wang@huawei.com> References: <20200417121222.156422-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no shutdown call in SBI v0.2, only set pm_power_off when RISCV_SBI_V01 enabled to fix following build error, riscv64-linux-ld: arch/riscv/kernel/sbi.o: in function `sbi_power_off': sbi.c:(.text+0xe): undefined reference to `sbi_shutdown Fixes: efca13989250 ("RISC-V: Introduce a new config for SBI v0.1") Signed-off-by: Kefeng Wang --- arch/riscv/kernel/sbi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c index 62b10a16c8d7..f383ef5672b2 100644 --- a/arch/riscv/kernel/sbi.c +++ b/arch/riscv/kernel/sbi.c @@ -167,6 +167,11 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask, return result; } + +static void sbi_set_power_off(void) +{ + pm_power_off = sbi_shutdown; +} #else static void __sbi_set_timer_v01(uint64_t stime_value) { @@ -191,6 +196,8 @@ static int __sbi_rfence_v01(int fid, const unsigned long *hart_mask, return 0; } + +static void sbi_set_power_off(void) {} #endif /* CONFIG_RISCV_SBI_V01 */ static void __sbi_set_timer_v02(uint64_t stime_value) @@ -540,16 +547,12 @@ static inline long sbi_get_firmware_version(void) return __sbi_base_ecall(SBI_EXT_BASE_GET_IMP_VERSION); } -static void sbi_power_off(void) -{ - sbi_shutdown(); -} int __init sbi_init(void) { int ret; - pm_power_off = sbi_power_off; + sbi_set_power_off(); ret = sbi_get_spec_version(); if (ret > 0) sbi_spec_version = ret; -- 2.20.1