Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp475603rwl; Thu, 30 Mar 2023 20:01:33 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvinpjAW0032M/OOf97U6+zv0K9779XxwIhwdcTe/QyKHNnyLvEeurB4Y4TM39GV34bcK7 X-Received: by 2002:a17:906:101c:b0:929:b101:937d with SMTP id 28-20020a170906101c00b00929b101937dmr3669908ejm.1.1680231693309; Thu, 30 Mar 2023 20:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680231693; cv=none; d=google.com; s=arc-20160816; b=DwPIRICAhbelXI4PfISBzJYHjWVgQp3WEoLJuMgauLIjC+l4vYDN61WTTdTvduGtaG kMRO1utDalZArD3hwgNLjKoeyQs29SQp5sUyVcPdKDVmHgOjvopJnkK4IqwuOqrkDbRo AlG+kVCWhDWms+9OXNilZP+Y4Da3lclpm516c9+Z9UMSGAP+cXhUOt9ca793SpfrKTPU pSG71WK44kEqTd3qVWKZD9aieKMGvwgWLR69+LvE8uDiXEWt/mzfeKtMIcUuTPi+GVhm MQSoi9hl0sHkOhsTrHycFZd3NXwvaznQcZwrj0knvT+Be46NbpcLbW0/nZ+rMOBTYlcu XoBQ== 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 :message-id:date:subject:cc:to:from; bh=iyImQKsRpNeP1ji85swwEVOFxefWvXbdpA5GiQ8FHlE=; b=Y73PKD6uOVE9ySuTLk+wibaLV5SunmzpQv715QZnPnnk41/5sAxfvnrpKfwD/ZO6cy JP78k4bYW51k6CNPMf15m1IboQKvzP1uK3bvqakiot4pUcvFnC7Zba9NlNjUj8IcUbca L+Ti7D/M6S9OWXdQSleJFickhBjTEWm1eyZOxYooSvil+IpVUaQYK4JL196jKDGHzNUH Ol5RBXA48n8A9yMD2nTZFO0VklIpvKzLmtP2r+WGOIzOOJ3lPw/RwyMdLRuOwd52vmf5 4U2n5CGCrB532k+33ZorgNEC8MhYMPegUZ9FhV0eQVsw9A55VGHs2kZU3OizOeuojaWr nrRA== ARC-Authentication-Results: i=1; mx.google.com; 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 bt22-20020a170906b15600b008c215db35a7si1076957ejb.37.2023.03.30.20.01.05; Thu, 30 Mar 2023 20:01:33 -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; 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 S229665AbjCaCxo (ORCPT + 99 others); Thu, 30 Mar 2023 22:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjCaCxn (ORCPT ); Thu, 30 Mar 2023 22:53:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 664C11116F for ; Thu, 30 Mar 2023 19:53:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1DFF1B82B95 for ; Fri, 31 Mar 2023 02:53:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38709C433EF; Fri, 31 Mar 2023 02:53:35 +0000 (UTC) From: Huacai Chen To: Huacai Chen Cc: loongarch@lists.linux.dev, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Huacai Chen , Randy Dunlap , Tiezhu Yang Subject: [PATCH] LoongArch: Fix build error if CONFIG_SUSPEND is not set Date: Fri, 31 Mar 2023 10:53:22 +0800 Message-Id: <20230331025322.442337-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,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 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 */ -- 2.39.1