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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA301CA0EE4 for ; Thu, 14 Aug 2025 14:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mrll9PwbMb2P6WbsB0DUOEsjJg4s9P//dZa2u/HhJfE=; b=pQQiwWQIAaFmUWGuChfVzuKpPT smqq56e30IosPOmdG4VH9U/tQfULM6Gnb2f+PMmfNAZLsB0+xU6UbIfNeYDdW1AzBeUQx6E/inZFC rBag0KbLxgb1K1tpHKYkvq9Z9qfguCeNk/al6MQuowopIrnrHy09qTUsRBvnKw9cnmPGFfoxO0uEe ikJQtfDrBK+qGkmKJmakA05Co9hURG6xPVLSEq1u253adTIS+CDeRDqLa2QrTk4cR1S3ObRbPfxjm G67Zo64XxCvmTHpXu2kBxF6XhCnSNcI77ON5lNDVVa1f9rfhiv/sRrwE+wycyXg5OdLbHBi8xJZX9 iR0m+j4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1umZDt-0000000HJYD-25JL; Thu, 14 Aug 2025 14:46:33 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1umXI2-0000000GsDn-2iRv for linux-arm-kernel@lists.infradead.org; Thu, 14 Aug 2025 12:42:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 6A691A56D76; Thu, 14 Aug 2025 12:42:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06344C4CEED; Thu, 14 Aug 2025 12:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755175360; bh=hTb4QYgDoMWeyH9uhsH4kqU+JjofNhR4CO/8MIEtlVc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vIKTPG1z2sUq4RMN98SYRSi1yNJ6Kev6eLvLU+LiClxMQPzirNMx8KgujIs7+25g+ XkjUmHwKRjTenEkYvcvm1tZnCmWXZJKPzno18cOx12+TbsVNvcFE7TSoY9DAf7zmFP Q3XbVdRKH2DrjBQAOs1Z+oDDp9FJnB2lxP7qMz2xS77ax0YlU680vLLnl3R9zljszV u5joUcQaIddAg5a0TDEO6oKeZSIqmt286gxlS1KHTH/C12PeH5XkrnAqRTmRkvpG/1 Kkhm5QRkuyG+wLPGneUvzv25N3gB+6CzxfUS8+MoT3tesqjz9KY0rrR1g8rz/itaC9 q1xsJSpRgp4jw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1umXHu-007RX2-Lm; Thu, 14 Aug 2025 13:42:34 +0100 Date: Thu, 14 Aug 2025 13:42:34 +0100 Message-ID: <86jz36dqh1.wl-maz@kernel.org> From: Marc Zyngier To: Steven Price Cc: Daniel Lezcano , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Thomas Gleixner , Mark Rutland Subject: Re: [PATCH 2/4] clocksource/drivers/arm_arch_timer: Add standalone MMIO driver In-Reply-To: References: <20250807160243.1970533-1-maz@kernel.org> <20250807160243.1970533-3-maz@kernel.org> <8e58b01b-772d-4ca7-a681-34f10baa07e6@arm.com> <86ldnmdvpl.wl-maz@kernel.org> <871ppetatg.wl-maz@kernel.org> 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/30.1 (aarch64-unknown-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: steven.price@arm.com, daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lpieralisi@kernel.org, guohanjun@huawei.com, sudeep.holla@arm.com, rafael@kernel.org, tglx@linutronix.de, mark.rutland@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250814_054242_750559_AED417CE X-CRM114-Status: GOOD ( 20.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 14 Aug 2025 13:23:26 +0100, Steven Price wrote: > > No - CLOCKSOURCE_MASK() turns into GENMASK_ULL so a simple truncation to > unsigned long would be ULONG_MAX (all 1s). So an unsigned long cast > should be fine. My suggestion of MIN(, ULONG_MAX) was just to make that > more clear. Huh. yes, Can't think today. Sorry for the noise. > > >> But it also means that the per-cpu timer also gets truncated the same > >> way, and that has interesting impacts on how often the timer is > >> reprogrammed. > > > > That question still stand, and I wonder whether we have ugly bugs > > lurking on 32bit platforms because of that... I'll try and have a > > look. > > I don't know whether there are other bugs due to the capping to > ULONG_MAX, but I don't think there's an (additional) bug here, it's > "just" a ugly warning. It really isn't about the warning, but how we express the maximum deadline to the core infrastructure. The MMIO driver is the least of our worries, and the CPU timer is the thing I'm concerned about, as it uses the same construct. M. -- Without deviation from the norm, progress is not possible.