Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp498107rwl; Thu, 30 Mar 2023 20:30:55 -0700 (PDT) X-Google-Smtp-Source: AKy350afX1IMzxraX86DpJ6+a86maDvD/mS9BnP+kaSxfCxdXtC76LxnepK9FGejAaoI8Y99Slln X-Received: by 2002:a17:906:dd:b0:93e:22e6:e7d1 with SMTP id 29-20020a17090600dd00b0093e22e6e7d1mr3867677eji.3.1680233455646; Thu, 30 Mar 2023 20:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680233455; cv=none; d=google.com; s=arc-20160816; b=rNj2Si9r4h+nR7kAB6WwKmT5Z3UUPjWRLWMZfri6L3x3jbbQE82gqCNn45EcssZhxz JsxWAbezZhdATLeWkHmpyy+8ntZUlEOfSK+NQSorvqJUHZDSfMXdaetIDdh8XDDbXaVv mPJGkDOGAkqYkqmmXkD0B1iIg9lIzn9Pm3QDeDYYfSfCH0hNFrmrl8Gsvbhkut9uSp/R oxnDaVUhyOijSRtveCHe+moPDOBPTQ4MGw6YxoeFF28UgIIYJ1IOqp9MDzmvfNkXCa2O fNWUQwS26/pMqti+JSVykD6yuZy9pxz4qh23BSRbgAB0m02P1zQSml8yU9jkPeTTX5oD np3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SKIkuIvtaeIctsGqNz1J+pshDaWf972lrE6e6STh1tE=; b=cUqqfCPx2H5sQw6/1HRkKeC0wXuk3dPB515uAYHMN6fsLZZK343mrLpd++JhyGrrWH UvneTVtxIoPss2XGNSKq/v1iav20A7BjXah25ol27GksKkKDrHEXsTKb/kgLm6v3FxBb 8rddqIsOIDTnkHfvw85HvUVpjuz1inNiqJJt0PFweJbyv8qhrwg0oFZ8Ij0L/TaLsiDC JQokyBZF8uMMdXc+k/GqhIzfr1z9FXI4Pd1aVeTG4eKVUUUpY35TM0W8WMBLqf+L4Yj3 QQBZG0Bax9E4HS7mhFKtX5wCLf5aH0up7vK3rDNP+Mwk7EtzP3dLV4I8D/kzfp/8ahml 5wkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=WNZASJgp; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a170906c20b00b0094596ff820dsi1058674ejz.1025.2023.03.30.20.30.30; Thu, 30 Mar 2023 20:30:55 -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=@xen0n.name header.s=mail header.b=WNZASJgp; 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 S229677AbjCaDZh (ORCPT + 99 others); Thu, 30 Mar 2023 23:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjCaDZf (ORCPT ); Thu, 30 Mar 2023 23:25:35 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 714FD3A91 for ; Thu, 30 Mar 2023 20:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1680233130; bh=882S7QFXm5n//3nqg1xYTL7PCI7LqWbNY4wq4uGr7zQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=WNZASJgpIHXh9KJlbjD56lxOmxbZB+osCc6R7kMJHZYmvRy2Zm8SpMIxRbNC/39Vb 8rTs98eR2BeIqLbs5BSGsDF19vOfL9GVOkdbZO1PPeRnsegeyD9UbTgaDSpmOpSpSx B7PAnZZg9qD9ySM3brfMZUiA3hMSMfShWuCJF3yw= Received: from [100.100.33.167] (unknown [220.248.53.61]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 3C0A560148; Fri, 31 Mar 2023 11:25:30 +0800 (CST) Message-ID: <0942af8b-64f5-2ed5-d8dc-a56a0761741e@xen0n.name> Date: Fri, 31 Mar 2023 11:25:29 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] LoongArch: Fix build error if CONFIG_SUSPEND is not set Content-Language: en-US To: Huacai Chen , Huacai Chen Cc: loongarch@lists.linux.dev, Xuefeng Li , Guo Ren , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Randy Dunlap , Tiezhu Yang References: <20230331025322.442337-1-chenhuacai@loongson.cn> From: WANG Xuerui In-Reply-To: <20230331025322.442337-1-chenhuacai@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS 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 On 2023/3/31 10:53, Huacai Chen wrote: > We can see the following build error on LoongArch if CONFIG_SUSPEND is > not set: > > ld: drivers/acpi/sleep.o: in function 'acpi_pm_prepare': > sleep.c:(.text+0x2b8): undefined reference to 'loongarch_wakeup_start' > > Here is the call trace: > > acpi_pm_prepare() > __acpi_pm_prepare() > acpi_sleep_prepare() > acpi_get_wakeup_address() > loongarch_wakeup_start() > > Root cause: loongarch_wakeup_start() is defined in arch/loongarch/power/ > suspend_asm.S which is only built under CONFIG_SUSPEND. In order to fix > the build error, just let acpi_get_wakeup_address() return 0 if CONFIG_ > SUSPEND is not set. > > Fixes: 366bb35a8e48 ("LoongArch: Add suspend (ACPI S3) support") > Reported-by: Randy Dunlap > Link: https://lore.kernel.org/all/11215033-fa3c-ecb1-2fc0-e9aeba47be9b@infradead.org/ > Signed-off-by: Tiezhu Yang > Signed-off-by: Huacai Chen > --- > arch/loongarch/include/asm/acpi.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/loongarch/include/asm/acpi.h b/arch/loongarch/include/asm/acpi.h > index 4198753aa1d0..976a810352c6 100644 > --- a/arch/loongarch/include/asm/acpi.h > +++ b/arch/loongarch/include/asm/acpi.h > @@ -41,8 +41,11 @@ extern void loongarch_suspend_enter(void); > > static inline unsigned long acpi_get_wakeup_address(void) > { > +#ifdef CONFIG_SUSPEND > extern void loongarch_wakeup_start(void); > return (unsigned long)loongarch_wakeup_start; > +#endif > + return 0UL; > } > > #endif /* _ASM_LOONGARCH_ACPI_H */ Reviewed-by: WANG Xuerui Thanks! -- WANG "xen0n" Xuerui Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/