From: Randy Dunlap <rdunlap@infradead.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>
Cc: loongarch@lists.linux.dev
Subject: Re: loongarch wakeup build error
Date: Wed, 29 Mar 2023 22:37:50 -0700 [thread overview]
Message-ID: <5d12e0fa-2a40-dc24-ee70-677d5242fd7b@infradead.org> (raw)
In-Reply-To: <af6281f5-9c6c-d2d7-5978-b637b8d18473@loongson.cn>
Hi,
On 3/29/23 20:33, Tiezhu Yang wrote:
>
>
> On 03/30/2023 06:55 AM, Randy Dunlap wrote:
>> Hi,
>>
>> I don't know if this has been reported previously, so here goes.
>>
>> When CONFIG_SUSPEND is not set:
>>
>> loongarch64-linux-ld: drivers/acpi/sleep.o: in function `acpi_pm_prepare':
>> sleep.c:(.text+0x278): undefined reference to `loongarch_wakeup_start'
>> loongarch64-linux-ld: sleep.c:(.text+0x27c): undefined reference to `loongarch_wakeup_start'
>> loongarch64-linux-ld: sleep.c:(.text+0x27c): undefined reference to `loongarch_wakeup_start'
>>
>> A complete randconfig file is attached.
>>
>
> I can reproduce this build error on LoongArch.
>
> Here is the call trace:
>
> acpi_pm_prepare()
> __acpi_pm_prepare()
> acpi_sleep_prepare()
> acpi_get_wakeup_address()
> loongarch_wakeup_start()
>
>
> loongarch_wakeup_start() is defined in arch/loongarch/power/suspend_asm.S
> which is built under CONFIG_SUSPEND. In order to fix the build error, just
> define a empty loongarch_wakeup_start() if CONFIG_SUSPEND is not set.
>
> diff --git a/arch/loongarch/include/asm/acpi.h b/arch/loongarch/include/asm/acpi.h
> index 4198753aa1d0..7b812a836a5a 100644
> --- a/arch/loongarch/include/asm/acpi.h
> +++ b/arch/loongarch/include/asm/acpi.h
> @@ -39,9 +39,14 @@ extern int loongarch_acpi_suspend(void);
> extern int (*acpi_suspend_lowlevel)(void);
> extern void loongarch_suspend_enter(void);
>
> +#ifdef CONFIG_SUSPEND
> +extern void loongarch_wakeup_start(void);
> +#else
> +static inline void loongarch_wakeup_start(void) {}
> +#endif
> +
> static inline unsigned long acpi_get_wakeup_address(void)
> {
> - extern void loongarch_wakeup_start(void);
> return (unsigned long)loongarch_wakeup_start;
> }
>
> If the above change makes sense, I will send a formal patch later.
LGTM and builds cleanly.
Thanks.
--
~Randy
next prev parent reply other threads:[~2023-03-30 5:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 22:55 Randy Dunlap
2023-03-30 3:33 ` Tiezhu Yang
2023-03-30 5:37 ` Randy Dunlap [this message]
2023-03-31 2:17 ` Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d12e0fa-2a40-dc24-ee70-677d5242fd7b@infradead.org \
--to=rdunlap@infradead.org \
--cc=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=yangtiezhu@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®