Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5664956iog; Thu, 23 Jun 2022 02:56:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQdtBgCsoNVmInaqYuTf8oXzHtwfpRXeVG8xqwvuuADyhZeavFrIUH6uT8WR7Ey/JUI/x/ X-Received: by 2002:a17:907:1b1e:b0:6d7:31b0:e821 with SMTP id mp30-20020a1709071b1e00b006d731b0e821mr7446777ejc.334.1655978176176; Thu, 23 Jun 2022 02:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655978176; cv=none; d=google.com; s=arc-20160816; b=NHRlmeA3GmJZrihPXoIa1ChQsJGeFXbvsFLPvjbKUqirCY+lqIqvWuWE6GEmIoxEKL tMnCMB0lYnofBafUCmxFdnSVlShESZGj3I5X+dmBHQL48M5cU0kgO5BRJXJ7aYMTOm2H Kpdyfn82D28znhS/rnLgYOMBase4KVWhxMXeTV343OwU4w7zlLy57u4jSjU+4exFBFOs iiW71OsLlkklxii7XSZXKACB1YV9zQRmn8T/ldamscJPvPxBuUfai09dDHa3Gu9NXJe7 uPM7J6Vtdxy8oJAWW6q/Ig/Ij99YLb9PI2U7NY/CqPHE7DepuKdva7TmbfGF6Bgllfm4 O5XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=bRVBPz6fIaQ7M1WRsj49Ex5XW1+l4lPAzoj7xR4siN0=; b=erU+H3Bg/NttbRNMoXflfvUSPwNrBG4N5GgKfFdIh7nOr7O/+VUiiqwhnOOI5bSjPk DRrF9V4IvHpe6oXHsCVx6tJiRcDUn8NLp2YE1d24sQP0iAAvjT8eU9f8nTtROKp4UOhJ kEDi5pnG3+qY5pnx9l7PdTLE+EdKUFTiaR1EReEl85C4nrCd7OGZhBHgWkoN3JDHdQaL LCQWndusOHI79ouJgOmTZ12JMLRZ85PE2gtWYuLlpLtsBwzHGqGd/jaUu5aXXJPxS7vM moPDdLHPJku8jcED9WSOj2C4eqos0usLsAompdZdpPay2sk06zMpUGkw/L37SIUaPDr9 Xy3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qknkBtEZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn15-20020a17090794cf00b00711c9e20c40si25179877ejc.243.2022.06.23.02.55.51; Thu, 23 Jun 2022 02:56:16 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qknkBtEZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230391AbiFWJWv (ORCPT + 99 others); Thu, 23 Jun 2022 05:22:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbiFWJWu (ORCPT ); Thu, 23 Jun 2022 05:22:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C0F74706A for ; Thu, 23 Jun 2022 02:22:49 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 9AABB61DA3 for ; Thu, 23 Jun 2022 09:22:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B20BC341C0 for ; Thu, 23 Jun 2022 09:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655976168; bh=noa0LflmElsINLkxkDjBwmgwa2qGfzyqGoF65Sy3oKs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qknkBtEZCgJLSC6x1SYArQmkXFkoh1LvUGHeQ+R6d0fXgTLKG7NOFEwhvL7d1mLF9 uCQZr0n+XstzUyFvQnOCZRrLseey+s+Q4EVEA8bvmDYkn2mjhabAong4Pg3y+tTPcm UmgSpJZIsAL4KDVarLrskwWDc7HYcoBzGDHR8Lg/QFbKt5rRh2LUNsp/ur5jalBGOE ZK4OYsGZ6jvdyndDO7Glb6wP27Q27Vh/KJUAC05Bh2Jake5cN7ehKppN7mNUtRyXCZ D/rsYlbum/OPSpIOePkBU/zrj6KbtMeZmc/FEB3OXp/FaKJvF3hz/n2LxkgmtjIvzr zPRYLuhJDuuxg== Received: by mail-lj1-f177.google.com with SMTP id g12so16475216ljk.11 for ; Thu, 23 Jun 2022 02:22:47 -0700 (PDT) X-Gm-Message-State: AJIora/SRGN0X164qnUTiFw7zFUWTixz8BF9bsKoKTPnOBOBVsxgbVXu OR4ohaw8OrfLhoeN8z+MtOVUqNPaqVfKmBfmqhc= X-Received: by 2002:a05:651c:548:b0:25a:700e:ccfc with SMTP id q8-20020a05651c054800b0025a700eccfcmr4180404ljp.224.1655976165987; Thu, 23 Jun 2022 02:22:45 -0700 (PDT) MIME-Version: 1.0 References: <1655527831-3661-1-git-send-email-yangtiezhu@loongson.cn> In-Reply-To: <1655527831-3661-1-git-send-email-yangtiezhu@loongson.cn> From: Huacai Chen Date: Thu, 23 Jun 2022 17:22:33 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: Fix wrong fpu version To: Tiezhu Yang Cc: WANG Xuerui , Xuefeng Li , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi, Tiezhu, On Sat, Jun 18, 2022 at 12:50 PM Tiezhu Yang wrote: > > According to the configuration information accessible by the CPUCFG > instruction in LoongArch Reference Manual [1], FP_ver is stored in > bit [5: 3] of CPUCFG2, the current code to get fpu version is wrong, > use CPUCFG2_FPVERS to fix it. > > [1] https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html > > Fixes: 628c3bb40e9a ("LoongArch: Add boot and setup routines") > Signed-off-by: Tiezhu Yang > --- > arch/loongarch/kernel/cpu-probe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/loongarch/kernel/cpu-probe.c b/arch/loongarch/kernel/cpu-probe.c > index 6c87ea3..529ab8f4 100644 > --- a/arch/loongarch/kernel/cpu-probe.c > +++ b/arch/loongarch/kernel/cpu-probe.c > @@ -263,7 +263,7 @@ void cpu_probe(void) > > c->cputype = CPU_UNKNOWN; > c->processor_id = read_cpucfg(LOONGARCH_CPUCFG0); > - c->fpu_vers = (read_cpucfg(LOONGARCH_CPUCFG2) >> 3) & 0x3; > + c->fpu_vers = (read_cpucfg(LOONGARCH_CPUCFG2) & CPUCFG2_FPVERS) >> 3; Looks good to me, thanks. Huacai > > c->fpu_csr0 = FPU_CSR_RN; > c->fpu_mask = FPU_CSR_RSVD; > -- > 2.1.0 >