From patchwork Fri Feb 17 06:38:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 58358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp736516wrn; Thu, 16 Feb 2023 22:54:43 -0800 (PST) X-Google-Smtp-Source: AK7set+Uwy5V19KDcyJoQTzkIgeuUw6OWSX8a2BrvK96UDJd7IxSAaCOzf3ed2eDNod4MRUiTqVZ X-Received: by 2002:a17:906:d8cf:b0:8b2:5262:562c with SMTP id re15-20020a170906d8cf00b008b25262562cmr1099534ejb.34.1676616882935; Thu, 16 Feb 2023 22:54:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676616882; cv=none; d=google.com; s=arc-20160816; b=vRXm5lSc8sb7na7aVxnTXsU9hNBr6jihjdRVQafFLtoWvbPZ/sVj8MmTlg3uJIYKjS RRJs7AEDUkeLLpX9sMnO3KNItwopRCBQMDz+iHRh54bzxkNgzdsvM+QK7NM/yV91Z5ft BWGBOU3TADDsCrVXzxMSAM5DgrgjqxcSWWe7rkrYJLMG7uiIVZ7wBZG/2Kkh3YrAv1W0 K7sDde0w4X3PiJisdEE6v9z3WVO45Zb5Ryc+8gPG+PrrE5CpKolYfLIw+aX5s1N0rbes bVnSYHQVQ6OQUWjAMH+a/6VkvDfio4WHRz9zcvLUYAvjcDQND7YZ000mc5UfYReSz0w8 3w3g== 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:dkim-signature; bh=CzxUXmaoKaTawDsDS62APQKN1CPdfaYIP+YvlMfEd5Y=; b=I/ze0gbHyaEIamU4fTEZQqH3NgN+budaoPNMwVfr/E0l+lHcWcltwUjd0gtAdjBzUl FW7iaaym9uqTX4FTjH90v2nzo3HHpyIlYF+G06glY+GW6Ow7B/+ZMAwnblkUSaihC96A pzvEmuDVoQpGlDVfH9d72dcbaBjspaLiRj8xoPEu8EUR6xcUyN3M3XXiOiAhSUe0C2Ry 9dSPycIsWLu8n7vvzfGEq13+zGIww6/DrZg7Q5kJQZ7gSA0NaA+b8u6X8iu1HDgB+PiB Ni/GPbIoZhQ2VZ7QDz7tqpMFHd54MMWoD6w80YA3GGf9Gj0Qh4lVTfGxmbG57a+onJKM fHAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=p4jz++3o; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cp22-20020a17090793d600b008b36d645f22si773179ejc.52.2023.02.16.22.54.19; Thu, 16 Feb 2023 22:54:42 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=p4jz++3o; 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 S229714AbjBQGjD (ORCPT + 99 others); Fri, 17 Feb 2023 01:39:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjBQGjC (ORCPT ); Fri, 17 Feb 2023 01:39:02 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ECC83A093; Thu, 16 Feb 2023 22:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=CzxUXmaoKaTawDsDS62APQKN1CPdfaYIP+YvlMfEd5Y=; b=p4jz++3oZNOf6OwuXb4XnNQw9N EXbztLL9VyfBsGK6U2rT948ui+yy3vLUZSO44gMQtdA25nUIEBtQR+40rlnA8HZ34BroSVQcH78og p/UGPaVdk1IxmXxVYIoMrd1HZzZTnSQwTI8ogR+GiPGHLycp23ZC0p8JjVn7CjGsRqhrGmHOXC6fj EyaiuzGc9d49DOvDvYnajuC9Nsxs5FXMAVbBx7Qlc7/5NOWnPBd92QrBsAmmzJ0VPzUt1EhPxwJKC vWpYeWr639i6z54nfiNIDdM8GWNbhK6OnZE5OMVWFhvz6+SeaVr5DFEoeDYMIHE7zWblBfcXBCI7J j7at1odg==; Received: from [2601:1c2:980:9ec0::df2f] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSuOZ-00Cxjx-48; Fri, 17 Feb 2023 06:38:59 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Dengcheng Zhu , Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org Subject: [RFC PATCH] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set Date: Thu, 16 Feb 2023 22:38:58 -0800 Message-Id: <20230217063858.28311-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758060224606666528?= X-GMAIL-MSGID: =?utf-8?q?1758060224606666528?= When MIPS_CPS=y, MIPS_CPS_PM is not set, HOTPLUG_CPU is not set, and KEXEC=y, cps_shutdown_this_cpu() attempts to call cps_pm_enter_state(), which is not built when MIPS_CPS_PM is not set. Conditionally execute the else branch based on CONFIG_HOTPLUG_CPU to remove the build error. This build failure is from a randconfig file. mips-linux-ld: arch/mips/kernel/smp-cps.o: in function `$L162': smp-cps.c:(.text.cps_kexec_nonboot_cpu+0x31c): undefined reference to `cps_pm_enter_state' Fixes: 1447864bee4c ("MIPS: kexec: CPS systems to halt nonboot CPUs") Signed-off-by: Randy Dunlap Cc: Dengcheng Zhu Cc: Paul Burton Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org --- arch/mips/kernel/smp-cps.c | 2 ++ 1 file changed, 2 insertions(+) diff -- a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -424,9 +424,11 @@ static void cps_shutdown_this_cpu(enum c wmb(); } } else { +#ifdef CONFIG_HOTPLUG_CPU pr_debug("Gating power to core %d\n", core); /* Power down the core */ cps_pm_enter_state(CPS_PM_POWER_GATED); +#endif /* CONFIG_HOTPLUG_CPU */ } }