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 DC662C04FDE for ; Fri, 9 Dec 2022 22:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiLIWYL (ORCPT ); Fri, 9 Dec 2022 17:24:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229798AbiLIWYJ (ORCPT ); Fri, 9 Dec 2022 17:24:09 -0500 Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA5937F9D for ; Fri, 9 Dec 2022 14:24:07 -0800 (PST) Received: by mail-oo1-xc2f.google.com with SMTP id y194-20020a4a45cb000000b004a08494e4b6so896241ooa.7 for ; Fri, 09 Dec 2022 14:24:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0niFOJtseZKpNqdp7Vx1SkJWAbHvAgltgpslEU1rios=; b=ZthfjG8mjewWB9eae366IW4b62xtMBDXTGmfIMRwYZeVDo9XwCKj3gbixD0w95mX7d mHgExb1PF8V8wqmwB5OwisI4eDrmRc5fu0ptzV/55nCqzQNi1SCtxvLWW3MmC7NSJrMe cXnW4IwbeKdBWO6R0lqa6uD77PsBY+ifPZxykrPR5yDyq6KeMPKR2ojHSUaeINq1AzKT KidqCJkTyn1ANnE7cgACv665rsc6ktCRCBxlO8mEUBjlOs3oxSbfhXd/CxEoazW1H6M3 v8y1U8nE4ZJcsGx3Dtf/mm1kk7Dea6nO1LF6bXf12OdhSrVV397bXq4IuwbDWkKwPm5n aoAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0niFOJtseZKpNqdp7Vx1SkJWAbHvAgltgpslEU1rios=; b=nyIRQ5Tg0DVhuYkUtxdPxkBtj+pkuPy3QXo2nKqWxc74RwtooVb0focB6Iz4QBL/Cm k7hxEUJT3eZUjG+GskoEruwt/UhhlIhsZpHBgPVtEo7GT/U9pKO1YuXsXQ3K0pGI98gb 0Dvh7g5x/Q14MTRPocGUsC9Dg1Mx2URoj8DIepipegd45RPc4iRvcARa7gZ01SeXhz7N wqtLvs5xdIN2yHW3o99olpzRsS1VhHGZpjLAUH9Hc0MSCwpgALXadARgMaN8IYNI2XZm Skul5HjbfwDzJkZYLSqRkBInUbLZncTec+o/+i3dWTgnj6UqLCVt454aAAxFjJhp5a6b derA== X-Gm-Message-State: ANoB5plkUiiPqni6Dr61cCrsVza8VE/6S0EFpCuD8QAJqIryMoT0LyL9 aqcGzcWs5AvP8tu8AXPZMY3VfA== X-Google-Smtp-Source: AA0mqf6YezcedWqO5/DfQ5Hh5KjmW+9LYC+dlAS/gPvAELaB4jrAICD5YQomLLQmCgeSgLlXx2Ehtg== X-Received: by 2002:a4a:dc8c:0:b0:4a0:c270:2f3f with SMTP id g12-20020a4adc8c000000b004a0c2702f3fmr4138546oou.3.1670624647102; Fri, 09 Dec 2022 14:24:07 -0800 (PST) Received: from fedora (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id c127-20020a4a4f85000000b004a0ad937ccdsm882932oob.1.2022.12.09.14.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 14:24:06 -0800 (PST) Date: Fri, 9 Dec 2022 17:24:03 -0500 From: William Breathitt Gray To: Biju Das Cc: Thomas Gleixner , Geert Uytterhoeven , Rob Herring , Krzysztof Kozlowski , Philipp Zabel , Michael Turquette , Stephen Boyd , Daniel Lezcano , "devicetree@vger.kernel.org" , Geert Uytterhoeven , Magnus Damm , "linux-renesas-soc@vger.kernel.org" , "linux-clk@vger.kernel.org" , "linux-iio@vger.kernel.org" , Prabhakar Mahadev Lad , Fabrizio Castro Subject: Re: [PATCH 0/6] Add RZ/V2M Compare-Match Timer (TIM) support Message-ID: References: <20221205145955.391526-1-biju.das.jz@bp.renesas.com> <20221205225042.GA2812115-robh@kernel.org> <87sfhsgb9e.ffs@tglx> <878rjjfprw.ffs@tglx> <87sfhrdure.ffs@tglx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YkhtusH7Lbb0s/D9" Content-Disposition: inline In-Reply-To: <87sfhrdure.ffs@tglx> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org --YkhtusH7Lbb0s/D9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 07, 2022 at 05:49:09PM +0100, Thomas Gleixner wrote: > On Wed, Dec 07 2022 at 11:35, Biju Das wrote: > > Counter, It can be used as measuring the processing time of DRP-AI. >=20 > Sigh. You can do that with the architected timer too, especially when > you are going to do the measurement in user space. >=20 > clock_gettime(), which uses the VDSO with the architected timer is fast > to access and accurate. >=20 > Thanks, >=20 > tglx Hi Biju, It's true that you could implement a Counter driver to achieve what you want here, but I don't think that's the most apt interface for this device. Your device is used to measure the processing time of DRP-AI, so modeling this as a clocksource seems like the right approach to take. Of course, if there is something missing from clocksource/clockevent that you need, then it should be added to the subsystem. So let's try to narrow down exactly what functionality you need. You gave a Counter use-case example earlier where you can configure the ceiling value of the timer (e.g. to 1usec or 10000000usec) and push Counter events on the interrupts that trigger off that that configuration; the Counter subsystem can logs the current system time everytime a Counter event is pushed. Could the same thing be achieved using clockevents framework instead? With this approach you would register an event to fire in the future (e.g. 1usec or 10000000usec) and then call clock_gettime() to get the current system when you're notified of the event. Would this approach work for your use-case, or is something else missing here? William Breathitt Gray --YkhtusH7Lbb0s/D9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCY5O1gwAKCRC1SFbKvhIj K8zuAP4uMkkxnrQ9VzRVJNsRxxSLOWknl898zSxxh2gIpvALaQD8DStd05P+6buF P9QDJciknANFclFf6QmJ5Pg8Sh6nCgs= =/qcp -----END PGP SIGNATURE----- --YkhtusH7Lbb0s/D9--