Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp406280imi; Fri, 22 Jul 2022 01:28:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+XmXaH/sjr0V64aT2qpYSGfkVeLD63+qzfmS95yl3zX4vrltySlJtGkUUJLKrkz+cJNEo X-Received: by 2002:a17:902:ab95:b0:16d:12a8:2af1 with SMTP id f21-20020a170902ab9500b0016d12a82af1mr2328296plr.164.1658478527806; Fri, 22 Jul 2022 01:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658478527; cv=none; d=google.com; s=arc-20160816; b=ziC0LOxqebiovS2p0sCTt4j+WepWSrwklX4+5DR1AUAoheuHjkzS6W3DhTya6L0ryF rCAJONdMjRraKXf5v/dKEqqM71s0PDVxyxY7JS2Z6bRXo+imgCHfXPIQebnFAh6gBrnJ HerS42MSNlkivXkh45DtC2t03Gskf5I3mcWCUibm9hL15HR0ZcdzJ+Vk6150dMEZwphm NjxdopVMFMxAc4x9vkXQ8c/7f48UxZ/Jyf85LcLR0Na6TdI9Ivb2A7F+kiMLTkIA1qKw klkexfOck/Go1sK/KkJ3xHVExYHATEAV7587Cc3FzkCKnFC9RgoKka7zbgi+iEFHEcv+ iY7A== 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=PWQVmx5ef1351m8I8ykTmfLzghXvvB/SA/b7K0xzqxY=; b=Kh1MY+RABZuC8NmsY3/h9QbW/unRi9JKrFu3oIdVs2voVGrq1xEdmAgBFREJZDosqf UYOJgtlNK15nFAN0z18qtw4p2TRcbRrCLsMwQKA6j+85ngD6Ld1LlKWh3v1llJUsQbeY PNjBWG3fyM9K0dJxXCNzZd3sJbUdcsp8nxoipRFZ+GAhIBcoCVEoYXGQF3BVXTQPE1r8 WbRSDyUMVdFXYD6Pt5Cq6YHvyuT/uUknQOS6K1GRDH7i1hseXo7+BhvE7cvEVE/mpEZw 9reCf0TG40dk5+vZhuGwJAtptG1KD4NsP74Ki8Okw45F4M4OGTTyXBI2/ez+kVSO2+G2 l4UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QYwJuq2V; 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 t15-20020a170902e84f00b0016a75602af4si5879292plg.597.2022.07.22.01.28.31; Fri, 22 Jul 2022 01:28:47 -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=QYwJuq2V; 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 S234531AbiGVHtV (ORCPT + 99 others); Fri, 22 Jul 2022 03:49:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234464AbiGVHtM (ORCPT ); Fri, 22 Jul 2022 03:49:12 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E2BC43E5C for ; Fri, 22 Jul 2022 00:49:10 -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 sin.source.kernel.org (Postfix) with ESMTPS id E3EA2CE202B for ; Fri, 22 Jul 2022 07:49:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32793C341CB for ; Fri, 22 Jul 2022 07:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658476145; bh=oFiEeRGUgpyFfmlOu8G9LzLg0b440Ed+op390yZ+zAM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QYwJuq2VDEmmH8n4ATz+L0cGEA3259ZXblO469UawOcH6R3UByzFKmzWfWbICt96R IfslQnQDdS95EwFUPuy0XRUNqiFfGtZhxledVHcOTzfiq2uJnQ/A90oVUIWCcqAGl9 TZHp4YHsrlV3GRYOyNX9bqdVfGYYbVM95FDdgoZHCfAGM0JzP5rvgRkqrz/5OyuIPV Qe4p6rekirL7/K73gQmPyEBt7vNBoH3rjp6D/lQdXTOre5M4LkiFu1UPxEX0gTZXTU 0+9znV9YRXRHax9hVyrSqAJ7LkYtDwN2Z8V+/AIXmPo5RravDZd6MMRuOwsCVBhkQ7 AE1RgJbJ8UyTw== Received: by mail-vs1-f51.google.com with SMTP id k129so3645541vsk.2 for ; Fri, 22 Jul 2022 00:49:05 -0700 (PDT) X-Gm-Message-State: AJIora9Wht6b53eUI+nVEka9QXZUW2oZv2v3s1u9Hm9AxEFgtuZ2MoVf e22OoSgEeqryQjp+dk198b/+2XGZ3kDu3EitTGk= X-Received: by 2002:a67:be07:0:b0:358:19f1:742c with SMTP id x7-20020a67be07000000b0035819f1742cmr643262vsq.70.1658476144120; Fri, 22 Jul 2022 00:49:04 -0700 (PDT) MIME-Version: 1.0 References: <1658305979-2073-1-git-send-email-yangtiezhu@loongson.cn> In-Reply-To: From: Huacai Chen Date: Fri, 22 Jul 2022 15:48:50 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] LoongArch: Remove LOONGARCH_CPUCFG48 and some CSR definitions To: WANG Xuerui Cc: Tiezhu Yang , Jiaxun Yang , loongarch@lists.linux.dev, LKML , Jianmin Lv Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.8 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 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, all, On Fri, Jul 22, 2022 at 3:34 PM WANG Xuerui wrote: > > On 2022/7/22 14:58, Tiezhu Yang wrote: > > > > > > On 07/20/2022 04:32 PM, Tiezhu Yang wrote: > >> According to the configuration information accessible by the CPUCFG > >> instruction [1] and the Overview of Control and Status Registers [2], > >> we can not see the descriptions about LOONGARCH_CPUCFG48 (0x30), > >> LOONGARCH_CSR_PRID (0xc0), LOONGARCH_CSR_MCSR* (0xc0 ~ 0xff) and > >> LOONGARCH_CSR_UCAWIN* (0x100 ~ 0x109), they are not used in the > >> current kernel code. > >> > >> LOONGARCH_CPUCFG48 may be used only in the firmware layer, it should > >> not be used in the future for kernel developers, remove the related > >> LOONGARCH_CPUCFG48 definitions. > >> > >> LOONGARCH_CSR_MCSR* is shadow of LOONGARCH_CPUCFG*, no need to access > >> LOONGARCH_CSR_MCSR* and LOONGARCH_CSR_PRID through CSR instruction, > >> use CPUCFG instruction to access LOONGARCH_CPUCFG* is enough, so also > >> remove LOONGARCH_CSR_MCSR* and LOONGARCH_CSR_PRID definitions. > >> > >> LOONGARCH_CSR_UCAWIN* may be not implemented in hardware, use CSR > >> instruction to access them is meaningless, so also remove the related > >> LOONGARCH_CSR_UCAWIN* definitions. > >> > >> The intention of this patch is to keep consistent between the code and > >> the manual. > >> > >> [1] > >> https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#the-configuration-information-accessible-by-the-cpucfg-instruction > >> [2] > >> https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#table-overview-of-control-and-status-registers > >> > >> Signed-off-by: Tiezhu Yang > >> --- > >> > >> v2: > >> -- Remove LOONGARCH_CSR_PRID and LOONGARCH_CSR_UCAWIN* > >> -- Modify the patch subject and update the commit message > >> > >> arch/loongarch/include/asm/loongarch.h | 229 > >> --------------------------------- > >> 1 file changed, 229 deletions(-) > >> Hi all, > > > > Are you OK with this change? Any comments will be much appreciated. > > Sorry for not getting to this earlier; $DAY_JOB is taking its toll on my > Linux contributions these days. > > IMO, it's probably better to keep the definitions for documentation > purposes. > > As a Loongson employee, you may be aware of the fact that your company's > "official" documentation is often lacking, and this information you're > removing is not found elsewhere. So for preserving this knowledge, > either (1) ask your documentation people to properly record these > information in official docs then you can go ahead removing them here, > or (2) just keep the content here if (1) isn't doable for any reason. > You do want 3rd-parties to freely develop on your platforms, making full > use of the products' capabilities, don't you? ;-) I agree with Xuerui, and I have already had an offline discussion with Tiezhu about why we want to keep it. There are various drivers that provide large register definitions, the most notable one is amdgpu (their registers are obviously not "all in use"), you can see drivers/gpu/drm/amd/amdgpu/sid.h as an example. Regards, Huacai > >