Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp532805ybz; Fri, 17 Apr 2020 05:44:43 -0700 (PDT) X-Google-Smtp-Source: APiQypJSbxdGbjACwTtoy1Ou0px8eRZ0MSv4IZqrh6dvyDgtv4gBLIIwvPZr2FAhwcxH8ZnRFAqz X-Received: by 2002:a17:906:c9ce:: with SMTP id hk14mr2747710ejb.314.1587127483332; Fri, 17 Apr 2020 05:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587127483; cv=none; d=google.com; s=arc-20160816; b=hbALUUo7mndMEc4k6OVABbh8doxdJRWsXq16nDJoZ1iNj0scK5jWkNMl30xSNJxzE1 DcpCiSn2gAUml0hxwLbq7z+O7Vke4BC6Yf7NEfwCYZxBdOm8sUjpMzTeiD9lgk0+JctK W4Q5cZp0zq+tkbkRTvyuquOPIuMtbPZNh9JxiqylPSpurrOnvIpHf1AkmyhHnip40UPN QW5xh5qMrTYAHhgsTORWCI5ne/4dO9awZjz2IgdeDTtiLHJrb2iLwz5+Sv4SimBMYT16 25Ykw4Hikf+h+OMyA/q6CJ4SLHFsmm4gush1zcLg7g7b/v0e4Bu+bp2s51mOrIUsgBzH Sytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=h5uGvUBBK13xiGM08N0Ar0f5rTAFRwfmSByaivnK03A=; b=MrzYKev4YQ4OOW+cfpaq3aKXyvmA+T8QP/DFKRd3iCKL4m4z8DJ+ek1tzl03z8AU3o qEh2W8UljlnMN/3QOLasTWa9JUjRA9PtQ84KA9JTGHygFn2P2HcJ41ImSg2HiuXKPUjO 0WpygKn7qQnl+0RFp/PCiMc5eC6+yyvl+Owxe9h6KqFBvDCg2Txf901y4f+QCG/KcAJf LgPYWiofx3ecUP3wzisSy8NpNZQKdkPsMRbf9sH+/SuQcGpFucRG8U0bPr3LhQrTWaNe hmHwwm66icaRBkUPa5hi8CcYGsForj5fBAWGRM1FoXjClzk3ufWY0hkr89knL7t1En1k 9w+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=lW7Cq00O; 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 jz18si13839981ejb.112.2020.04.17.05.44.19; Fri, 17 Apr 2020 05:44:43 -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; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=lW7Cq00O; 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 S1729640AbgDQMnR (ORCPT + 99 others); Fri, 17 Apr 2020 08:43:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729053AbgDQMnR (ORCPT ); Fri, 17 Apr 2020 08:43:17 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8C3BC061A0C for ; Fri, 17 Apr 2020 05:43:16 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id j2so2862785wrs.9 for ; Fri, 17 Apr 2020 05:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h5uGvUBBK13xiGM08N0Ar0f5rTAFRwfmSByaivnK03A=; b=lW7Cq00OBPIgaU4boC2NWhBfA/bsU8/tgZ1luVaWA85xijqr+QRcCxBHtn39IQUBcj OFSsXpby/C0JSeaqXBR6kqmZyYcAP7kJkDsL4l1OOe3rXkTpmHNpyyCIohBUMjie/xVP hUuVSymNynjQw3FMf6ITpkubTII7Y1VKk3GFMUwiYmdOlE3+yjH5lJ1liHB97jqZWbyq tgy8/e6Z1erE56HG0eznmdLvtS8YPEh4W7lhkwR5X0PtD/aLwSJUmH7Lm5cLcTklrs6e NkjVNQcxZAYKWJymi5N+NlvKRJxhEuSsJ701USslsxbsiCOb6mIiNigLVlXZG7ykeeH0 nJOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h5uGvUBBK13xiGM08N0Ar0f5rTAFRwfmSByaivnK03A=; b=k/RUQ/Ls3HJjcQ2XgKMJ1T8390dDtIHaV7P6f4JbvFsXY01PpbBGf3O0lv0YGiutvH nevJ31qPGnAmnuy6OIq4UJlKtrsz63w2FpNDsKAWafduv2Ox3yyWOb6aSlfltM2lKR7E 1w7+o0K1Z9vpwM9jSt8B5O4TRCPRBHU9wlIUeNWCH3fIGVsmvrTbxkcKOFIL01D6CWT7 POQYtAYGpRvIDS0pFSfOv97OYStL7DwJBr5KXQ7WX+PF6Pcx+DPV1ha7Niz2Ume+RvHA J9Mt8aVfnQRtHThkOnvFdv1BmR7yndsQ0JRmB8h3xxYYC1FC/bjBcvQ28ebbTxiXZvrI O+nw== X-Gm-Message-State: AGi0Pub1GakzhAEthN52L9EzCRTqYa+Fr8xwrbHfruVAgDMTkaHILXOJ UNF+GNo1Jocf6hFPVD6TyQVslxp7l6HD60dbsABCAg== X-Received: by 2002:adf:ee0c:: with SMTP id y12mr4096911wrn.0.1587127395436; Fri, 17 Apr 2020 05:43:15 -0700 (PDT) MIME-Version: 1.0 References: <20200417121222.156422-1-wangkefeng.wang@huawei.com> <20200417121222.156422-3-wangkefeng.wang@huawei.com> In-Reply-To: <20200417121222.156422-3-wangkefeng.wang@huawei.com> From: Anup Patel Date: Fri, 17 Apr 2020 18:13:03 +0530 Message-ID: Subject: Re: [PATCH 3/3] riscv: sbi: Fix undefined reference to sbi_shutdown To: Kefeng Wang Cc: Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , "linux-kernel@vger.kernel.org List" , linux-riscv Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 17, 2020 at 5:40 PM Kefeng Wang wrote: > > 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 > Looks good to me. Reviewed-by: Anup Patel Regards, Anup