Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3867652rwl; Tue, 27 Dec 2022 17:04:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXtzS+gVMpbd478ZScOGdEFAruEkBrLVcnNqRhbOs9UOAAv2lpBQBg+zN59X/IMai5bE8FTX X-Received: by 2002:a05:6a20:6709:b0:af:aa38:12e0 with SMTP id q9-20020a056a20670900b000afaa3812e0mr25670894pzh.34.1672189497388; Tue, 27 Dec 2022 17:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672189497; cv=none; d=google.com; s=arc-20160816; b=wjG3ArYxDdh/9HT9YfsEF1mdJ9IIyUj0A3eJ/LtKXtZ0NbETNty1If4TNdzLHYuB6r klqyDgIcZ8wNgxUw09zTjqqzJdx0fLr/+E1wUKtYo31y31zp+wSM/XcTuSWl+bhnVPMg nWiFbUx8pDuxmEYiN5G53yGUKo8q4qYpdtuurXlw6u2fuY+cL8lwBpj8PypSP3EOJ12q 9pD8SShI+Z6xforvqqou3+3EBI5qdxWxnM8FvISCcA5H75xRy8D+EMoi0ECH7ddgy7II 1QzoaTBviNFrF2b4NccQKVHHOBpEny2PJJw/3H2m3x9OMQPSNyV92+NSMYBUG3rswty1 cCSQ== 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 :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=lJKh5hLUSVyNtGb27sEl8iKUopQtksa0I8JjuVzm/jY=; b=DvNC0NA/8DSVvCeTnnIxRBlbWzp4w3V7uH2V22zEL7FxzUXR8Q4nUJNhrFhinaOlPr QxUSlZdnW50Ef+bs1XvoOvuKB7NGHn9IzhA62QbjOdra6/6rYoZKQQDryByr8rlTqp5T i9T69JF8cp9LfGTsdWkbbT29a1Hz4DJNKMyJJn15bMDsbJo6eyPIFbhQTjTG3Pf/Pz4e Sz5ODP77UYnxn+jFKmy0v1YoAtPuHwNckoFsSAd8gE4Nyc+5NofRO68+EArDQiRP3fvz oyhNAR0BhB2hZERLRfxqaOhgiLXQrgO4nBQIeErNUOAfLIiYpsfMXX0fYk7eomhfsxUt pH4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=zsXQvkbc; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jpUgIno+; 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=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z124-20020a636582000000b004792389988asi16101152pgb.305.2022.12.27.17.04.46; Tue, 27 Dec 2022 17:04:57 -0800 (PST) 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=@sholland.org header.s=fm3 header.b=zsXQvkbc; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jpUgIno+; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbiL1Aoy (ORCPT + 66 others); Tue, 27 Dec 2022 19:44:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbiL1Aot (ORCPT ); Tue, 27 Dec 2022 19:44:49 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C5ADFB8 for ; Tue, 27 Dec 2022 16:44:49 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D7B5B5C00CC; Tue, 27 Dec 2022 19:44:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 27 Dec 2022 19:44:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1672188286; x=1672274686; bh=lJKh5hLUSVyNtGb27sEl8iKUo pQtksa0I8JjuVzm/jY=; b=zsXQvkbc4qvvStb1M0jQ5bPd3f+tBhq0STct4u3nu QFwp83KoW0i4X//TVOFdjcNsGpo1Oc38whYYa4fcxGZZ2eckTsIBQzascSQqMPP8 6OVXIpr4QS8lrMMTycvQ91m6h4MABLc40u0OqDZrJBcGVSwkIfn+8Ccw333WRn/o OKeY58lnAe0WBBFmQeUQFR4qZzeXq7m4JcZlPBMBwtsb30OK9N8DOfDdvrlofZtM PaYpS2orM7rveegfgrhS8t5AIsR+VvHlMG/64g7Eu8EEkiqSvkapcpYnVuxzuOtO wltFE3GW16yFFeXEIMF+HykbGcx2QWkWNG51VzbZTeSdw== 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:message-id :mime-version: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= 1672188286; x=1672274686; bh=lJKh5hLUSVyNtGb27sEl8iKUopQtksa0I8J juVzm/jY=; b=jpUgIno+86qYFaeGQn5+s30NUnkg/CCRVzjVp9GW/E0dR7mLEL6 0DZXdgLmi4IMPbDCHBE6s3l6QB+KlxDqkQernCkEGU2ihv+i16/qN+hh+qornvRW iFBeM82wFAPlLX4qBIGjFMdw3ttGCWogLIZoXxqtEM2fEHC/r5Fg5EzdEBMf8lLV 0DRy/AoepLZX1Gdu93AduwHcuDl1i957/hv5Es+1pO6bFDj34JJty1Af5u5HfPdF qbkN18LEkOeCeLS54EDRbc9ELnnqA8p7qMbMtdxFAKtYA+m/eQlKTsStnCSvhrOL aT/WId0KvRn/4djCWMHJxr8BoTi89658xVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedriedugddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeekveelhfejueelleetvdejvdeffeetgeelheeujeffhefgffefkeehhffh keekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Dec 2022 19:44:45 -0500 (EST) From: Samuel Holland To: Palmer Dabbelt , Daniel Lezcano , Thomas Gleixner Cc: Prabhakar Lad , Samuel Holland , Albert Ou , Paul Walmsley , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH] clocksource/drivers/riscv: Increase the clock source rating Date: Tue, 27 Dec 2022 18:44:44 -0600 Message-Id: <20221228004444.61568-1-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 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, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 RISC-V provides an architectural clock source via the time CSR. This clock source exposes a 64-bit counter synchronized across all CPUs. Because it is accessed using a CSR, it is much more efficient to read than MMIO clock sources. For example, on the Allwinner D1, reading the sun4i timer in a loop takes 131 cycles/iteration, while reading the RISC-V time CSR takes only 5 cycles/iteration. Adjust the RISC-V clock source rating so it is preferred over the various platform-specific MMIO clock sources. Signed-off-by: Samuel Holland --- drivers/clocksource/timer-riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index a0d66fabf073..55dad7965f43 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -73,7 +73,7 @@ static u64 notrace riscv_sched_clock(void) static struct clocksource riscv_clocksource = { .name = "riscv_clocksource", - .rating = 300, + .rating = 400, .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS, .read = riscv_clocksource_rdtime, -- 2.37.4