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 D557FEB64DC for ; Mon, 3 Jul 2023 08:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231328AbjGCINY (ORCPT ); Mon, 3 Jul 2023 04:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231290AbjGCINK (ORCPT ); Mon, 3 Jul 2023 04:13:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B79C5 for ; Mon, 3 Jul 2023 01:13:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1552260DF9 for ; Mon, 3 Jul 2023 08:13:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 798FBC433C7; Mon, 3 Jul 2023 08:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688371988; bh=/vatCFORHYkaQFYtyLbCwu4ix9oMWfI+Li1VdAnUU3o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oBiI8NrjjU8PbF7V9kCV3IUMgxAzPMSy6GwvSYjepshFJQ5wzNG8gx0J6QTtYXni8 j1YaqPAJzk+FdnTSQJSFEdupfSH4ZRo1o7hJUMT5qjROyA9EXorTh2NbCQawBPAhq2 /Qq9r9UjERcejltGkOkADl9i1155VsDc0jyuueLSyO6j7/LDss9CVeQmx4vG37/cw6 BCX1h6BNiimEWDmGqbWBm5a49bRriZhgFahA+bkfL5mB3wRaPGN8qDVTRdGg4MhPXq htxf0cO95fqFhw8H4UFaX8cTRFNmH850AeWOYtA+snOwp14VJEBtItpc7Q75bL2oxR QQemVWdArUCZg== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qGEgE-00A6GG-D9; Mon, 03 Jul 2023 09:13:06 +0100 Date: Mon, 03 Jul 2023 09:13:08 +0100 Message-ID: <874jmlza3v.wl-maz@kernel.org> From: Marc Zyngier To: Peter Hilber Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , Daniel Lezcano , Thomas Gleixner Subject: Re: [RFC PATCH 4/7] clocksource: arm_arch_timer: Export counter type, clocksource In-Reply-To: <20230630171052.985577-5-peter.hilber@opensynergy.com> References: <20230630171052.985577-1-peter.hilber@opensynergy.com> <20230630171052.985577-5-peter.hilber@opensynergy.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: peter.hilber@opensynergy.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, daniel.lezcano@linaro.org, tglx@linutronix.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Jun 2023 18:10:47 +0100, Peter Hilber wrote: > > Export helper functions to allow other code to > > - determine the counter type in use (virtual or physical, CP15 or memory), > > - get a pointer to the arm_arch_timer clocksource, which can be compared > with the current clocksource. > > The virtio_rtc driver will require the clocksource pointer when using > get_device_system_crosststamp(), and should communicate the actual Arm > counter type to the Virtio RTC device (cf. spec draft [1]). I really don't see why you should poke at the clocksource backend: - the MMIO clocksource is only used in PM situations, which a virtio driver has no business being involved with - only the virtual counter is relevant -- it is always at a 0-offset from the physical one when userspace has an opportunity to run So it really looks that out of the four combinations, only one is relevant. I'm not Cc'd on the rest of the series, so I can't even see in which context this is used. But as it is, the approach looks wrong. Thanks, M. -- Without deviation from the norm, progress is not possible.