Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp692860iol; Thu, 9 Jun 2022 11:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBIiAb3+mq/4Elw9BnPlZ3bpLJJBA5iKcS7RRq2UthvCPsfAWk0FuFtgwRdWZGNn2AWw92 X-Received: by 2002:a17:90b:38c2:b0:1e8:7ad1:bec5 with SMTP id nn2-20020a17090b38c200b001e87ad1bec5mr4694845pjb.51.1654800681988; Thu, 09 Jun 2022 11:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654800681; cv=none; d=google.com; s=arc-20160816; b=ERnPMBVCGcUkZbmfSkiOBm5S1ZCz2YBkQR8wK2eDVoWgECBjnKGDmGpf0rUF0w6RnF 2sVwJB89DjguBCoXKurmkxUhh7VLyXSe1OxHZvtG8uLABppkts4ew1/oJYFw9+BPTBta lKi3i7YrbKq5rHpNPdfedwXC/xPg0vy/Oi5adNdINh65S2uLOMKAGE4EqTIz8dNvLBrm bxc3WHDh3jYeJs1n1Ng3GhsF4DY8joAaWGTb8vq4+x7sU3p3SqcBmd9Y1e566d790P30 ARBbMQ69LdfFJNur6FfEY5e2LGPqxRHEqoO/gcer8tTUSZhAHimcDsE+7K0RLhIkbxl0 8IAg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=NPlvGbpWe3tdccHpDPunMo3g/eJ+mFewyfL3DA2+pmg=; b=FsUJ30Uh3f1DTjXSvUVWGx8l9YZsUsqxMcysyWLsfGOugE5qwakd2DwNK9oBbIHS1w XnRQg8SPVhtcJey3ey5EpdlstcW3xOFOjPva1PB397iFac0XT/yzkgaVt3wYfq31WGKl dfNXyfGb4+9sENwCjBREeFOTkUj9FVPtl8QOg7x3ZmXNyJTllc89vEcRnZTfWyLWCPiu z/Gc6Hskv2o5ZCrwbb2ySX6Vio/R4NgF95spucWTiqwoO+ZfYaNKX90C2O58fa6/G8Xq n/z3K9br5Ej+Y2rTJ3n4ycqTmmjW9ZkbkYMerFSkOmLgp86PT4OwUEsHbIEwnkmCpDFi X8GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm3 header.b=jeDvndkX; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Mi9CifMx; 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=flygoat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q187-20020a632ac4000000b003fdd8b44d24si14954171pgq.279.2022.06.09.11.51.09; Thu, 09 Jun 2022 11:51:21 -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=@flygoat.com header.s=fm3 header.b=jeDvndkX; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Mi9CifMx; 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=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345198AbiFIRxF (ORCPT + 99 others); Thu, 9 Jun 2022 13:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237685AbiFIRw4 (ORCPT ); Thu, 9 Jun 2022 13:52:56 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DE1E44A0A for ; Thu, 9 Jun 2022 10:52:55 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 3F18C32009B4; Thu, 9 Jun 2022 13:52:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 09 Jun 2022 13:52:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1654797172; x=1654883572; bh=NP lvGbpWe3tdccHpDPunMo3g/eJ+mFewyfL3DA2+pmg=; b=jeDvndkXiscmTy0nS3 PgFDpL/m84xWB9iDdKJc+m8BzNG0dzYLnOUECadviLsTnp3shfBoMIIXUZtYMllm yrKargcVAzo8NEmbju6ZNsNZwDjysGs+uCZnR6t2Mg7X9p2GrJZRFh5KolgDhZse xKb52z5oSqq5BKK0WwWsVWyK1qznvUWSIlYDlvZXwHTzS6NxPzl6sTHMmLFb/Gv5 X2JqWcTzx+IuzUkeU5/MeeUgvi0YoDyo86TigV13bNap3tUL5qBG1B+whqcucoO7 AePsQgOvlphEUkKEZ9ufygExJ9wc+Pf9Hf3/yab+VN/IW7npEzDwRF+2eY5CqJnL ycgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1654797172; x=1654883572; bh=NPlvGbpWe3tdc cHpDPunMo3g/eJ+mFewyfL3DA2+pmg=; b=Mi9CifMxcLMG2mIO3lTLFdvboXwTk kg1JSmurIACiEmxd0f3QbCV+Ldy+7vUDPPfIAqf4+STzJeh5PSP+SA7YPaU6UyUF OtoXnXL9FT570X6Ur50TZ3uf6xsSO5czWQYnGG+Y2oHGCkTwsw9IHCrqx6VZUgCT ttOTmZTCO2kOwda9ogmm6Ynnsisp2ejMFH8jiCK60gJ7wFMazHKzt3jAMdxaT8Em S0Ni4KdiyehPErlME6woTOW50vpeBgMWWi/9+BKW20ZlDGOKy0yjoxjUiwu+tJL5 Xais3LlJvD9lqYVdXSfTR70WQzhhXAcFVH4lgkudI70TRRPBVUzXWF+qQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddtledgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgjfhgggfestd ekredtredttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigr nhhgsehflhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpeefledufeehgedvue dvvdegkefgvddttedtleeiiefhgeetudegkefhvdfhjeeftdenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflh ihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Jun 2022 13:52:51 -0400 (EDT) From: Jiaxun Yang To: chenhuacai@kernel.org Cc: kernel@xen0n.name, maz@kernel.org, linux-kernel@vger.kernel.org, Jiaxun Yang Subject: [PATCH for-5.19 v2 2/2] loongarch: Mask out higher bits for cpuid and rename the function Date: Thu, 9 Jun 2022 18:52:42 +0100 Message-Id: <20220609175242.977-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220609175242.977-1-jiaxun.yang@flygoat.com> References: <20220609175242.977-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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. 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 { -- 2.25.1