Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp7941589ioo; Fri, 3 Jun 2022 17:39:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsS7l+lovx2TXRiHf84xf7ibtKUDxrzaPjCoidDTOFQRB+KWKn1BO2UccxJzjb81HMeSrA X-Received: by 2002:a17:90b:388c:b0:1e2:f376:b8d with SMTP id mu12-20020a17090b388c00b001e2f3760b8dmr31405689pjb.148.1654303156137; Fri, 03 Jun 2022 17:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654303156; cv=none; d=google.com; s=arc-20160816; b=pKKMNH3PbvpLhp084fEaMKXY38SVyRHtGZAL1PhUf/vQkD2Bpj9RJpVm6At5WMm0k2 3wVywz9YZqeCnYtS7+yVOHgpzZ+IJK2Za/KZ0mVwu63kTq7MIjIy8oT9v49EO4OMGIrQ FSj6xaCaxkptn5Qin+pH3WfTWV1mSadju3PAyx/7yz9mptJd+vXzh+p9C7uQnfYjnE7X fPM3MWIQ96Axd9UHE6/rn3/gZ0zE43DvkdWpV1nHLCZ/J774/IUFP+je+6NWiSTRsEaa bMP3oqf5rDGJGtbh+h94nxU392Rate4nCA+nwhx7Bc6zs8KjaoAykPFEM6MbebnDJuDu /L8g== 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=grXyfamOfZ9pzFDeR6krf55MYVqi5D3RRk27kJIFMrA=; b=BD9Ed16/ZdEeZTEp3MYl40wh8SbSS8J9CNyDp5AaoB4x0b7cPtOuP9MVXW3NokqnE8 o7oOXKLtt5KUfi3tuvZlVSAfD82pCnfF93lN+BzN3ToU1/qRCWcmO+E4Ob1AWqiXLdUV AhwsoheapMs8BtU3EfqudVe6XyVikB78nzAbmqO3YuNWCqphaL1y12h/A0ENVSaDgFBy MTn+Jx03GGSpBvW5DUQ/jBeY5gY9n3SWpBNicjnXKBgvZpPjLDmXxXUNLzNRiHY1/hBe +L6GFjnuO3xO1R5gNC+uG1RD/Vaq0XOVIYFGCRr1dIPgGg93r2FbNl9tTE7QCbomFUGt 9uwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=D+wggy4y; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k10-20020a170902d58a00b0015eb08a71a6si11043093plh.16.2022.06.03.17.39.02; Fri, 03 Jun 2022 17:39: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=@gmail.com header.s=20210112 header.b=D+wggy4y; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245151AbiFCOgL (ORCPT + 99 others); Fri, 3 Jun 2022 10:36:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235721AbiFCOgF (ORCPT ); Fri, 3 Jun 2022 10:36:05 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0CA75046C; Fri, 3 Jun 2022 07:36:00 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id y17so6838967ilj.11; Fri, 03 Jun 2022 07:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=grXyfamOfZ9pzFDeR6krf55MYVqi5D3RRk27kJIFMrA=; b=D+wggy4yN83jO+X0j6lEgqxBqbWmTOQid65J1mQccB4CcHtLZfesqtLwcU2uQC5F2H ku5kiXdomks6sp4kBvnd/1nXSew5phehLhOYzMVMeMLURIe8txblWYtCjl9wlEi8Kq3i UM2Y5V/BmN2YjTkqmw0geNnwnU+5lsL/2AFPr93TrDIoOtb3l7RmBtleknJ7QSN7PY/+ CKD9N6N439g0IEegMLDn0bnqyU1XrzNwGkdGGIalQU5POwwoqxZu8bWdaSOn8xps8nPP cGg4K+Qp68f8kaS+nMH3cJ6SUuzb+vEhJTkIOdYJKNzaK21E3fff6RRaI0lOmp1xn5Lz YQ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=grXyfamOfZ9pzFDeR6krf55MYVqi5D3RRk27kJIFMrA=; b=LpIZ4Y1rUvKIjTUTJI/TexS2dL4qyb7jYupCyZbmnsZdnRZALu6CbFedYGSpDGyfRd A19ehh7a03rnWAgwTsevBDkr767sbawMfR/x8JlrCSVe9TpQIbFzO106wcE6UnUVaY0G OVVA5z/0g+i7JpF3YNfKC6TQ8QnMjfKW2T1SkJ5tQS+3wLMIYCOA0PANVt9pi8DO5dNV YErv2bLWjxFsTz6d++p4JYe2TS+qflGvw3HmQE5U2P+v/3IttYAG0JhJ9xyQcI5H3OXx io9Hh/cPgAeuoDD8U0uASLlu6r29pTapJNoGO7QZVAVrkAU94b0RcKIiw9ZWBswPKFdi XXSQ== X-Gm-Message-State: AOAM533mKxX5Nzi/Hn/ZMcmd6W0mPs2cv0r07XGTI7b9SBC4GCITHRUk gvdQu4Y9IR4Sj7XtGEc5gJlc+r3qhLeRsJUscDg= X-Received: by 2002:a5d:9d8c:0:b0:664:afc8:64df with SMTP id ay12-20020a5d9d8c000000b00664afc864dfmr4973409iob.42.1654266959848; Fri, 03 Jun 2022 07:35:59 -0700 (PDT) MIME-Version: 1.0 References: <20220603072053.35005-1-chenhuacai@loongson.cn> <20220603072053.35005-11-chenhuacai@loongson.cn> In-Reply-To: From: Huacai Chen Date: Fri, 3 Jun 2022 22:35:47 +0800 Message-ID: Subject: Re: [PATCH V15 10/24] LoongArch: Add other common headers To: WANG Xuerui Cc: "Jason A. Donenfeld" , Arnd Bergmann , 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 , Guo Ren , Jiaxun Yang , Stephen Rothwell , WANG Xuerui Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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, Jason, On Fri, Jun 3, 2022 at 10:14 PM WANG Xuerui wrote: > > 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. Thanks for catching this; what Arnd and Xuerui said is right, and I agree it would be better to remove the comment. As the PR has already been tagged before your reply, this will get fixed in rc2. Thanks for your review again. Huacai >