From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58CD2C4332F for ; Wed, 8 Nov 2023 09:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235486AbjKHJKo (ORCPT ); Wed, 8 Nov 2023 04:10:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235384AbjKHJKm (ORCPT ); Wed, 8 Nov 2023 04:10:42 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761E210A for ; Wed, 8 Nov 2023 01:10:39 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507a62d4788so9012397e87.0 for ; Wed, 08 Nov 2023 01:10:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699434638; x=1700039438; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jcINFlc5Bxzgrbc4MTS9NCkyZbTVVfqU+tkYks0UGuM=; b=TIojes5uZi5ODO1/HeGKpmgUoiZFB2chcG1klfGC25xIEYLnafb1JzIXLSn6TUT9Pj 2ivMtpKXsCczZNURs7hhGOJZOjmV8YVRHae9UOmkwL2M3A6Rglu93QN/+6avliklGFGI RFpMqwX1Xb2Cc7Dh8NAVWIoll/n3kHO+IlSxN1luzTTvTy8NHoeEM9x/o72u/Dys9ebD aUPmlOMPgLCmjMFGTImAkfVPjXjwG4toL7ZqdjyKyRm7zxeSmbH4hWf7UvclEm5ANe1F kfMVAGQWGLaEexjpBRrvGXonueIc4R6P6eC6eZ2t4N7TJCddGYDbTVlq8VKVIJY3FN/p unnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699434638; x=1700039438; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jcINFlc5Bxzgrbc4MTS9NCkyZbTVVfqU+tkYks0UGuM=; b=ECFP05kXTMQp959W35dz0ecxYzn+Sf5RwnVXCptEJEeiUiV9tg9GI81Hp6zq9q9uk7 0nupGFogLKfsQ3ZizWwEFx1yDpYn50mlXiah/JfJecq0GcbLVGWPpF9qDpBwlejjgjnn 7ihUQjMPWPOOxk0S9407WVtkHWETZvY3yoQhF6YJQVsLVttykYVMIz46+7xKPRnXf1cn Xsk4tRnrrXSjRf4edQhS3pY3cUl3f1vrt/X0n9V6lFxUCblcwd/dQeBXQxVTftOAjhsD XBOpMbcxViHmVeZI8Q3n5O1WoCw+rbMQcdkirbAKT4a0Qhv+P/ZNpdJoxb9ocV4jEdpW nlBg== X-Gm-Message-State: AOJu0YyfN7qpSNjbTlJ4mdiuj014yvMaGKKbBZp1JFDQfUCHoDRD4Iv1 oGqOl2gDj6tnNzdI6lSoKvk9ljUZwRaia/kooXXu4w== X-Google-Smtp-Source: AGHT+IFWrJhq0yyPZFGkfsmVVYe9rpitNrcZX/tgpoj4oWjopGFCXaydqgPa9BfS1sjHZGerGEiZTg== X-Received: by 2002:a19:4351:0:b0:504:2d54:b4d0 with SMTP id m17-20020a194351000000b005042d54b4d0mr788039lfj.19.1699434637594; Wed, 08 Nov 2023 01:10:37 -0800 (PST) Received: from ?IPV6:2a05:6e02:1041:c10:55a2:c282:5ca3:a855? ([2a05:6e02:1041:c10:55a2:c282:5ca3:a855]) by smtp.googlemail.com with ESMTPSA id y11-20020adff6cb000000b0032fc609c118sm4397265wrp.66.2023.11.08.01.10.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Nov 2023 01:10:37 -0800 (PST) Message-ID: <1dd3d765-c583-4db9-a0aa-303bfcf871db@linaro.org> Date: Wed, 8 Nov 2023 10:10:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 2/3] clocksource: Add JH7110 timer driver Content-Language: en-US To: Xingyu Wu Cc: Thomas Gleixner , Emil Renner Berthing , Christophe JAILLET , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Walker Chen , Samin Guo , linux-kernel@vger.kernel.org, Conor Dooley References: <20231019053501.46899-1-xingyu.wu@starfivetech.com> <20231019053501.46899-3-xingyu.wu@starfivetech.com> <3f76f965-7c7b-109e-2ee0-3033e332e84b@linaro.org> <540136d4-6f8f-49a6-80ff-cc621f2f462b@starfivetech.com> <65c38717-3e0c-46d3-a124-29cae48f1a2e@linaro.org> <72ad5029-42b2-481a-887f-8f6079d8859b@starfivetech.com> From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/11/2023 04:45, Xingyu Wu wrote: > On 2023/11/2 22:29, Daniel Lezcano wrote: [ ... ] > Thanks. The riscv-timer has a clocksource with a higher rating but a > clockevent with lower rating[1] than jh7110-timer. I tested the > jh7110-timer as clockevent and flagged as one shot, which could do > some of the works instead of riscv-timer. And the current_clockevent > changed to jh7110-timer. > > Because the jh7110-timer works as clocksource with lower rating and > only will be used as global timer at CPU idle time. Is it necessary > to be registered as clocksource? If not, should it just be registered > as clockevent? Yes, you can register the clockevent without the clocksource. You mentioned the JH7110 has a better rating than the CPU architected timers. The rating is there to "choose" the best timer, so it is up to the author of the driver check against which timers it compares on the platform. Usually, CPU timers are the best. It is surprising the timer-riscv has a so low rating. You may double check if jh7110 is really better. If it is the case, then implementing a clockevent per cpu would make more sense, otherwise one clockevent as a global timer is enough. Unused clocksource, clockevents should be stopped in case the firmware let them in a undetermined state. > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/tree/drivers/clocksource/timer-riscv.c#n45 > > Thanks, Xingyu Wu -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog