Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp105786iof; Sun, 5 Jun 2022 22:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1MPkMfJlaiwHtzgOYkvPJFkg4Kx9A1+ZuES08RRwsyO3U87vAmdJytSzLrUDT88L9U6aR X-Received: by 2002:a17:902:bb92:b0:153:4eae:c77e with SMTP id m18-20020a170902bb9200b001534eaec77emr22174712pls.93.1654493593734; Sun, 05 Jun 2022 22:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654493593; cv=none; d=google.com; s=arc-20160816; b=ajCcBLRExGaqNoHAEhB3FUVMfTn5B6CYpG90K4vkP2LF5kZWwvuwCDdlRMhIes1Pg9 xal97+jORjgJoBNfYedMGx9ECyfgFqMQy04ZQv2ZGjnbtVklkH5km4ycUQLSw1z3BLCK bq6i+1DpEgtt+04KAVVBBgyEEI4aumBEjfslIawR7vSh1E3taEXM31LiQIUV2+EHzCJR 6AvrvDF5OhfEMYdctKTQvM5IQ2TpS0UAHfI6IcEBhvcaSsnrMSsJxiqHo8HB7WpBIFYz kl82j0Jk7VLKetLZuyw6OgCDv1xxk9s8T3m76AK34GsiVvoGhJQ5XWn8njr5Ys6bYSUU ZWCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Gr4ZLPoYC7yjmhuP13HiSqPcocmBXLj3zM8AgwQZq40=; b=wKuHeaYpzW/HeMH1BceS7ZVQ7ySnoeStvdmNh99QHtrAZ2qlP2LA6nLVxwKPyhRdxH 3GhPvzT2byorE1QM1/UyUfF0/cYU2/2mONy+wBmo6VX8XvABwnVmxT5/6avPkUENQX2E jjrJM1gr0GWUeSInsgMwegkCXShmeVTnzADxmVvZHBYdw9V8Z5N08tv025FhFerPRf97 vwp9apFJDvQDPjap6BroFlQRL1UNyoplOKEq49ddAZffkxHjard4FXhSYBjikjeiRp3+ OoYCkgUCt7qbtvTmhJnEkvosQSGGmffphzkXtSZVjNpWXCsbYu4U9QFZghnDl8FCj6w5 i8Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=J6p4vJWM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u11-20020a170902e80b00b0015cdfb5dc6asi22374031plg.84.2022.06.05.22.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:33:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=J6p4vJWM; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A9C118E33; Sun, 5 Jun 2022 21:32:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245074AbiFCOOk (ORCPT + 99 others); Fri, 3 Jun 2022 10:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240024AbiFCOOi (ORCPT ); Fri, 3 Jun 2022 10:14:38 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 347A13EBB6; Fri, 3 Jun 2022 07:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1654265671; bh=othfUBeCgIWwvNgS19Qxvk9oJwBpnSgFLwDEof8nHew=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=J6p4vJWMqJaB2TgUXZNx3DVsQZyOks2t08tu3ZxCfAPZt9esFy9b9XdnjQm1Fs9/f hDlcVQmB2CMwXsk2LQIwgbVWWULZ5BJoeJpIJ9K4wtkooQx7h8sEv3DQ9owIIsPOmH 0jwwcMUMynWlWVk96KQbQLZkH2tuQxy7x979ggrY= Received: from [192.168.9.172] (unknown [101.88.28.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id EA95760104; Fri, 3 Jun 2022 22:14:30 +0800 (CST) Message-ID: Date: Fri, 3 Jun 2022 22:14:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Thunderbird/103.0a1 Subject: Re: [PATCH V15 10/24] LoongArch: Add other common headers Content-Language: en-US To: "Jason A. Donenfeld" , Arnd Bergmann Cc: Huacai Chen , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Huacai Chen , Guo Ren , Xuerui Wang , Jiaxun Yang , Stephen Rothwell , WANG Xuerui References: <20220603072053.35005-1-chenhuacai@loongson.cn> <20220603072053.35005-11-chenhuacai@loongson.cn> From: WANG Xuerui In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 6/3/22 22:01, Jason A. Donenfeld wrote: > Hi Arnd, > > On Fri, Jun 03, 2022 at 03:55:27PM +0200, Arnd Bergmann wrote: >> On Fri, Jun 3, 2022 at 3:40 PM Jason A. Donenfeld wrote: >>> On Fri, Jun 03, 2022 at 03:20:39PM +0800, Huacai Chen wrote: >>>> diff --git a/arch/loongarch/include/asm/timex.h b/arch/loongarch/include/asm/timex.h >>> "Currently only used on SMP for scheduling" isn't quite correct. It's >>> also used by random_get_entropy(). And anything else that uses >>> get_cycles() for, e.g., benchmarking, might use it too. >>> >>> You wrote also, "we know that all SMP capable CPUs have cycle counters", >>> so if I gather from this statement that some !SMP CPUs don't have a >>> cycle counter, though some do. If that's a correct supposition, then >>> you may need to rewrite this file to be something like: >> The file is based on the mips version that deals with a variety of >> implementations >> and has the same comment. >> >> I assume the loongarch chips all behave the same way here, and won't need >> a special case for non-SMP. > Oh good. In that case, the code is fine and I suppose the comment could > just be removed. In addition, the rdtime family of instructions is in fact guaranteed to be available on LoongArch; LoongArch's subsets all contain them, even the 32-bit "Primary" subset intended for university teaching -- they provide the rdtimeh.w and rdtimel.w pair of instructions that access the same 64-bit counter. So I think the comments are probably just leftovers from a very early port; the LoongArch development started way before it was publicized. And yes, the comment block re get_cycles usage can be removed altogether.