From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB8382FCC1B; Thu, 14 Aug 2025 12:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755175360; cv=none; b=pkLx85hoGjd/h85IwyHbzCvG3I+5ItpyiA2Z/H+xLzMOCLc68Tlt/RcJy0HdnqfhvdEe07lpVmtw0UaZk2X37Yz419Q1IFM1d6RY0eAU8AZoK9My9dD4qcleiCOYOX1GgDvqDnkNMwAaReVCvHAeEIfFDv9YxuqmZNZm5kbkJGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755175360; c=relaxed/simple; bh=hTb4QYgDoMWeyH9uhsH4kqU+JjofNhR4CO/8MIEtlVc=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=dttOb+sIHVsJEtHgACLhjlEqkhYeafHa0vxVkek+U8aHckyTLkbn2t6yN48Q3V79VnEBmVn2Re6bMKdwQYP2Qs1+bOHzTLtNLUEsSlUp3s7aMSt9QytGz87TwbrEZCGsSe0kBNgb4xy6u+VRm/E4pQQqpcnwLoUp9UNA2SpINNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vIKTPG1z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vIKTPG1z" 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) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.