Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1188652iol; Fri, 10 Jun 2022 02:07:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM2zzhKsIk6f/MYSYLcr89mgZ1tY4npG1NSUbjwqeD0l+CXcV7EdYlb2lfCwKyoOtZ7iSH X-Received: by 2002:a05:6402:c0c:b0:42d:c7b8:dff5 with SMTP id co12-20020a0564020c0c00b0042dc7b8dff5mr50576285edb.251.1654852053195; Fri, 10 Jun 2022 02:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654852053; cv=none; d=google.com; s=arc-20160816; b=j6uMgfpobcCKfqAQO5DXlcsg3uPWH3kBXnz+LdrjG0/lMDH6QKSi+UhBCvMVjGBJS1 HYqrlkg3pWevKTJy5Qmpe9Jl0/qHdTQXJ68tL8zDH1AuCGgWISEuPN/1iOt0TKsmNbss LKd5awnxWOJE9kXvA5+MLGo4RJTglLEa74qhKVMgsF7Lrvt4AhZvO0SJUsM4lMuRQ67O 9TvlLuPfbSyeES9Dp+e0ONq6hXVXOPHwhVI/eoo99xvSYPWdDkNZMdJNm8rFaNDw28zL Wu9u2Pqg5k9BuL0Fg3KVvJLgcaI0Us+AqFsZP/j1mhQ6SZkWWlLhs3hfXuFQp+aLWL3O E9yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=RHBfs5mKn4WHjNzRAQtW1btkL/phCCF1mgUf6oifkSw=; b=l4tuYB2Qc9LQCbIFt2b4qyWAss6sL9nEY2g4Abjrq9rd/MsjHmmtv/fLfPx2G4wSun /4+c6g8tgZkZvPWDsbOhoSaV0DiHoRqPDYS1XC9RU5QprIddsr5KLhBVRCPS7DpA6Yz+ F4rW9cmYIC86zHHNqPOuX9kk1RT/69J+SHKT49bJvkkTNQ73oY5jBVdVUdHlEYriXnV5 IeNaWJgxlUEK3K0n3okNdzbuCzj+lqRBrRdq19wBGcPDxLQ27j2U4+Bags3KY2hZEnfE Ieu08vibsyfBvnsncb+Jy7WJAwkyrZHaKWj+0tWhTWK9WQ7YOc5gQnYJoY6PpY7QZSON StcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JI8jdfXd; 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 qo15-20020a170907212f00b006f42bf415c8si7425818ejb.147.2022.06.10.02.07.06; Fri, 10 Jun 2022 02:07:33 -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=JI8jdfXd; 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 S1347117AbiFJICT (ORCPT + 99 others); Fri, 10 Jun 2022 04:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245600AbiFJICQ (ORCPT ); Fri, 10 Jun 2022 04:02:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71AE7212D91 for ; Fri, 10 Jun 2022 01:02:15 -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 0DDC462048 for ; Fri, 10 Jun 2022 08:02:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 628ABC34114; Fri, 10 Jun 2022 08:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654848134; bh=QkpmABflv2pJVO3bKwyMBZRgjaOjEOLuAV3GsKrcM+s=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JI8jdfXd6JjH1I3BNMkVZ9swStfLIQSdpRhYUIC0U67OZYNmS40DIWn6wH3Vzkdby M4JN2ebbteRCYucbjMFkLUKDCPbC4xHG37pGvxBiyXLkAYZNXWrvMeSQztK4ZElVeu 955sF1AQlFNEeqGSRZPfTnxJnNcVNJllWAGC3NtybrUKt+3ge1Es4LNMdd26IyPMxz RKHyZlTkQwntgRsl3z6dHHEDDJ85eCsDbRzsoZgnpd2CQAMF6u10HeMkGv5NkafNCT 6kfqKcDkwE8SO28BtiJljUG+PGab8fNINlaj5qv36l14wmv6x/ew8we+Z2xI/eQtrX wGdNuUSkce/9g== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nzZat-00H4Zx-RF; Fri, 10 Jun 2022 09:02:11 +0100 Date: Fri, 10 Jun 2022 09:02:11 +0100 Message-ID: <874k0t3q0s.wl-maz@kernel.org> From: Marc Zyngier To: Jiaxun Yang Cc: chenhuacai@kernel.org, kernel@xen0n.name, linux-kernel@vger.kernel.org Subject: Re: [PATCH for-5.19 v2 2/2] loongarch: Mask out higher bits for cpuid and rename the function In-Reply-To: <20220609175242.977-2-jiaxun.yang@flygoat.com> References: <20220609175242.977-1-jiaxun.yang@flygoat.com> <20220609175242.977-2-jiaxun.yang@flygoat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: jiaxun.yang@flygoat.com, chenhuacai@kernel.org, kernel@xen0n.name, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-8.3 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 On Thu, 09 Jun 2022 18:52:42 +0100, Jiaxun Yang wrote: > > Only low 9 bits of CPUID CSR represents coreid, higher bits > are marked as reserved. In case Loongson may define higher > bits in future, just mask them out for get_csr_cpuid. > > Also, as we already have read_csr_cpuid, rename get_csr_cpuid > to get_csr_coreid to reflect the actual bit domain name. I assume you meant read_csr_cpuid here? > > Signed-off-by: Jiaxun Yang > --- > arch/loongarch/include/asm/loongarch.h | 4 ++-- > drivers/irqchip/irq-loongson-liointc.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h > index 3ba4f7e87cd2..fe2408144fa3 100644 > --- a/arch/loongarch/include/asm/loongarch.h > +++ b/arch/loongarch/include/asm/loongarch.h > @@ -1198,9 +1198,9 @@ static inline u64 drdtime(void) > return val; > } > > -static inline unsigned int get_csr_cpuid(void) > +static inline unsigned int get_csr_coreid(void) > { > - return csr_read32(LOONGARCH_CSR_CPUID); > + return csr_read32(LOONGARCH_CSR_CPUID) & CSR_CPUID_COREID; > } > > static inline void csr_any_send(unsigned int addr, unsigned int data, > diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c > index 8d05d8bcf56f..2ee636b2d827 100644 > --- a/drivers/irqchip/irq-loongson-liointc.c > +++ b/drivers/irqchip/irq-loongson-liointc.c > @@ -42,7 +42,7 @@ > #if defined(CONFIG_MIPS) > #define liointc_core_id get_ebase_cpunum() > #else > -#define liointc_core_id get_csr_cpuid() > +#define liointc_core_id read_csr_cpuid() > #endif > > struct liointc_handler_data { I'm not going to take this patch as part of 5.19, as loongarch doesn't have any irqchip support yet, and this can be made part of the IRQ enabling series if really necessary. M. -- Without deviation from the norm, progress is not possible.