From patchwork Fri Feb 17 20:07:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 58764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp49743wrn; Fri, 17 Feb 2023 12:18:53 -0800 (PST) X-Google-Smtp-Source: AK7set9IsCX8jy3+rfK8dFFvJvFPwxjFIZ0JoMHl3BkpFDeA1C+0aUp+vMXD1m8IQXrs0uSAeIvR X-Received: by 2002:a17:906:819:b0:880:e6d0:5794 with SMTP id e25-20020a170906081900b00880e6d05794mr929999ejd.58.1676665133217; Fri, 17 Feb 2023 12:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676665133; cv=none; d=google.com; s=arc-20160816; b=pfszScflcJAH12UhmmTOT8VmD54h1Oio82NwgahW4xl2Kk63nu3xBPOkKTvdoYx5qa mFo/Tc0mI9nDCon54kRnv5O9sm1o6mC0eW0j173/bOc7MqciOlJv0F2xRTMkyT2OgV4A Ls8dwf5dKuWmgEAujXeA4dDOphJTo4g9W9bbGIE0K5uUaAj9prVClyt0c5G/Uszy9vCq E9eVhKJaEuVshDwtV+4kt2+KZ3+y7zfITh1B/RqJbq317E2s61h0fShuRETFD8S79ZAx YnoqD7P8/bqcSzj8ncIHh7ICEny+jvnRyZwDmjt5zkWHePyI9apAnXYZBXcxoEEdPBmx bwyA== 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=ikxt7TJ0ayrq85Qabt4jcejgaojp5IVrlaJ78MvqmxE=; b=IkPpcKTDOqA/36ImOTVPaXrHLxQ08BTNw9ykBCdTiTcrelUgd1HsmCJRNRSS80iiJo h8YoIgwXnvoQIybjllMTfuNh9FYxLGppKxVe1s+ey0LD93xMW9vb2RaaIB3FJbT7rCDp OawWJyVVObBjitUsr3+c8dC/joDYMy0GZcxIkGI9ZDElc9tkGxHanJOxXGQus5S58Ajd djsOrY8lHd9R3VPDgDD4ZAi0zAhwwJsEsjQ8avsb8ACdryVYeAy5eMSQD3QiAga/u2rW dB/a8y+FzWkluJbZIsmex/YAlTg/kTlpc8uO2JvZciFB+7ebollyRMEcjogq/lHUnHPY vjNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=vDGOi91G; 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 fx17-20020a1709069e9100b00877da25cb31si5864123ejc.869.2023.02.17.12.18.30; Fri, 17 Feb 2023 12:18:53 -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=vDGOi91G; 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 S229460AbjBQUHy (ORCPT + 99 others); Fri, 17 Feb 2023 15:07:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjBQUHw (ORCPT ); Fri, 17 Feb 2023 15:07:52 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB1A76A5B; Fri, 17 Feb 2023 12:07:51 -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=ikxt7TJ0ayrq85Qabt4jcejgaojp5IVrlaJ78MvqmxE=; b=vDGOi91GLYfOmXTgPZBTsxjp7h BIIwy0qjcxCsLTr9FWBJuLw7Rlq3lT+R8OcX+ICpcV1Axbuw/q96952DDyBzOYFTrye+pWX0MydJK 7fiRvFwT6nzLbrW1FKK89JYh7q6Bmf6V6iXXR5RihUP7QH7rMvJcWHarSNJsUHkbqH590rdDOxpIX Bs0NDrHAa+irTOrTOCMURugXpsu9o2YRoihlML9nCrWJ5joxqLkegXZRrcY7G7d/CXD3tGLw8vtA/ vi4ipGGGCl8jThMGJmq7WJxk+IEF+or3gGwfgpMUOGMd7reor2vcLMi1yRUeoQAZZXdoBE2OGiiTj OQXGFNVw==; 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 1pT71K-00FaUC-GQ; Fri, 17 Feb 2023 20:07:50 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Dengcheng Zhu , Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Sergei Shtylyov Subject: [PATCH v2] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set Date: Fri, 17 Feb 2023 12:07:49 -0800 Message-Id: <20230217200749.1001-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.39.2 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?1758110818978808234?= X-GMAIL-MSGID: =?utf-8?q?1758110818978808234?= 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 Cc: Sergei Shtylyov Reviewed-by: Philippe Mathieu-Daudé --- v2: use IS_ENABLED() instead of #ifdef-ery (Sergei) arch/mips/kernel/smp-cps.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 { - pr_debug("Gating power to core %d\n", core); - /* Power down the core */ - cps_pm_enter_state(CPS_PM_POWER_GATED); + if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) { + pr_debug("Gating power to core %d\n", core); + /* Power down the core */ + cps_pm_enter_state(CPS_PM_POWER_GATED); + } } }