From patchwork Wed Sep 8 19:06:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 508254 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_ADSP_ALL, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 056B4C433EF for ; Wed, 8 Sep 2021 19:06:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5A8A61158 for ; Wed, 8 Sep 2021 19:06:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350941AbhIHTH7 (ORCPT ); Wed, 8 Sep 2021 15:07:59 -0400 Received: from home.keithp.com ([63.227.221.253]:35594 "EHLO elaine.keithp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350387AbhIHTHa (ORCPT ); Wed, 8 Sep 2021 15:07:30 -0400 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id DA45E3F30882; Wed, 8 Sep 2021 12:05:49 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZJ8V24QNtY-4; Wed, 8 Sep 2021 12:05:49 -0700 (PDT) Received: from keithp.com (168-103-156-98.tukw.qwest.net [168.103.156.98]) by elaine.keithp.com (Postfix) with ESMTPSA id 769D03F30883; Wed, 8 Sep 2021 12:05:48 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 593CF1E60132; Wed, 8 Sep 2021 12:06:09 -0700 (PDT) From: Keith Packard To: linux-kernel@vger.kernel.org Cc: Abbott Liu , Alexei Starovoitov , Andrew Morton , Andrii Nakryiko , Anshuman Khandual , Ard Biesheuvel , Arnd Bergmann , Ben Segall , Bjorn Andersson , bpf@vger.kernel.org, Christoph Lameter , Daniel Borkmann , Daniel Bristot de Oliveira , Dennis Zhou , devicetree@vger.kernel.org, Dietmar Eggemann , Florian Fainelli , Frank Rowand , Geert Uytterhoeven , Ingo Molnar , Jason Wang , Jens Axboe , Joe Perches , John Fastabend , Juri Lelli , Keith Packard , KP Singh , kvm@vger.kernel.org, Linus Walleij , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Manivannan Sadhasivam , Marc Zyngier , Martin KaFai Lau , Mel Gorman , Michael Ellerman , "Michael S. Tsirkin" , Miguel Ojeda , Mike Rapoport , netdev@vger.kernel.org, Nick Desaulniers , Nick Desaulniers , Nicolas Pitre , Peter Zijlstra , Rob Herring , Russell King , Song Liu , Srikar Dronamraju , Steven Rostedt , Tejun Heo , Thomas Gleixner , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Valentin Schneider , Vincent Guittot , virtualization@lists.linux-foundation.org, "Wolfram Sang (Renesas)" , YiFei Zhu , Yonghong Song Subject: [PATCH v4 3/7] ARM: Use smp_processor_id() in vfp_pm_suspend instead of ti->cpu Date: Wed, 8 Sep 2021 12:06:01 -0700 Message-Id: <20210908190605.419064-4-keithpac@amazon.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210908190605.419064-1-keithpac@amazon.com> References: <20210908190605.419064-1-keithpac@amazon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These are equivalent when thread_info contains the CPU value, but when THREAD_INFO_IN_TASK is enabled, cpu moves to task_struct. Using the macro allows either. Signed-off-by: Keith Packard --- arch/arm/vfp/vfpmodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 2cb355c1b5b7..d7a3818da671 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c @@ -458,16 +458,16 @@ static int vfp_pm_suspend(void) /* disable, just in case */ fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); - } else if (vfp_current_hw_state[ti->cpu]) { + } else if (vfp_current_hw_state[smp_processor_id()]) { #ifndef CONFIG_SMP fmxr(FPEXC, fpexc | FPEXC_EN); - vfp_save_state(vfp_current_hw_state[ti->cpu], fpexc); + vfp_save_state(vfp_current_hw_state[smp_processor_id()], fpexc); fmxr(FPEXC, fpexc); #endif } /* clear any information we had about last context state */ - vfp_current_hw_state[ti->cpu] = NULL; + vfp_current_hw_state[smp_processor_id()] = NULL; return 0; }