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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 8BAD4D5B15D for ; Sat, 13 Dec 2025 12:46:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7706510EC64; Sat, 13 Dec 2025 12:42:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=permerror (0-bit key) header.d=db48x.net header.i=@db48x.net header.b="f92PAHz9"; dkim=permerror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="pWbUC/SZ"; dkim-atps=neutral X-Greylist: delayed 372 seconds by postgrey-1.36 at gabe; Thu, 20 Mar 2025 16:01:14 UTC Received: from fout-a1-smtp.messagingengine.com (fout-a1-smtp.messagingengine.com [103.168.172.144]) by gabe.freedesktop.org (Postfix) with ESMTPS id 662B710E668 for ; Thu, 20 Mar 2025 16:01:12 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 9EB2A1383446; Thu, 20 Mar 2025 11:55:01 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Thu, 20 Mar 2025 11:55:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=db48x.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1742486101; x=1742572501; bh=TjbqBCbLA8NWX59i5FOeG9AwtG5k4TfiyzQOVtNKUJM=; b= f92PAHz9acjmk3qfyhM61KE1L9dyP/rTGEg1KIoLTQsAPrAW3j9Xxu6F3PMKu1VZ eTvDyxpX266c4vH0vWeyOp9/kHEoD+SmMsS1qdx7Id18bW9zYx42XPj9GWo5zacz /qxlsU0rtLwnKskvPat1fZk9t2spgL8esLc80GWYlgo6TxdyuqUu3rnDJeWuvkP7 VExoKTDUv4BRwfhm3HocIuLu5fBMPlskSPYqJ9CTkEG3stdAgnzpGqhL3N75CVCl buNU2Axq39NuhElLYmxbNStyR7iMmrDFnb1eHAFpCAa24IX/C9FZBnV1aN/iaEUh odwj6SppQo+we4A38jGVoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1742486101; x= 1742572501; bh=TjbqBCbLA8NWX59i5FOeG9AwtG5k4TfiyzQOVtNKUJM=; b=p WbUC/SZ3m6QQTTQ0g8IEfSeBOJnjZ8dhYW8IFz0LIK2/daIlqXG37M66HB8VIdp8 pYSn/JqtF5rUwy96qJB+oZ91wYVUO4dgdqsQrOdrKxH8eyzOZJW7W9IsmZgxbbbi g/zpOjaLF3EVy1dlwvvRcCatx9Z71440Zrbkp85a6coBeZmt13iureAHODXpLmUL II7X6KSOCJcDvlaaaI2usEfGaTr+zZ2UHCSpjSiYR2aSLxh5xBUWk4XIuJJBGBDa 7MX1/9465LBM87LmZUQjT4rWVP8KTUw3ke/Bgy90JepjpUUwbw2SG+TnFvmUFBvs 5rrAP/11soUe/Rhk3iRfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugeekiedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkfgggtgfgsehtqhertddt reejnecuhfhrohhmpeffrghnihgvlhcuuehrohhokhhsuceouggsgeekgiesuggsgeekgi drnhgvtheqnecuggftrfgrthhtvghrnhepvdduteegieeujeelieejleetffdtjeeifeet vdetteejkeeuueetgeduveejkeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepuggsgeekgiesuggsgeekgidrnhgvthdpnhgspghrtghpthht ohepudelpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegurhhiqdguvghvvghlse hlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtohepnhhouhhvvggr uheslhhishhtshdrfhhrvggvuggvshhkthhophdrohhrghdprhgtphhtthhopehruhhsth dqfhhorhdqlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehl ihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhope hsihhmohhnrgesfhhffihllhdrtghhpdhrtghpthhtohepthhmghhrohhsshesuhhmihgt hhdrvgguuhdprhgtphhtthhopegrlhhitggvrhihhhhlsehgohhoghhlvgdrtghomhdprh gtphhtthhopegrrdhhihhnuggsohhrgheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohep sggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgv X-ME-Proxy: Feedback-ID: ie0194691:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Mar 2025 11:54:58 -0400 (EDT) From: Daniel Brooks To: Alexandre Courbot Cc: Danilo Krummrich , David Airlie , John Hubbard , Ben Skeggs , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Simona Vetter , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH RFC v3 6/7] gpu: nova-core: add basic timer device In-Reply-To: <20250320-nova_timer-v3-6-79aa2ad25a79@nvidia.com> (Alexandre Courbot's message of "Thu, 20 Mar 2025 22:39:14 +0900") References: <20250320-nova_timer-v3-0-79aa2ad25a79@nvidia.com> <20250320-nova_timer-v3-6-79aa2ad25a79@nvidia.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGOfPtRkwAAABJQ TFRFpKfbdou67PD6JjJgAwUWXGSeIcyLHgAAAkZJREFUOI1VU8Fy6yAMxLi+Q13fCZ3cnQL3dqTc 7RD+/1feStDXVnXHDuvVSivZTMba2GPdw3gyCGcMAFxTyrTd9dwGoxHiZX9PmRFUHYAQlGGtXY+F Uk0SJOxgJiUEnH1qkitT9D+pQub7qGAmUbR6bu3CvI96Yv6QqkBBMrsyfZccr1/RDXGDTLf4P7ZY glVxe2V+/ACXWO1gvDO9/gDRpFFVmPluvLcmBjd5H6d8DEte+Pbk4rcY/Fa5tLKLOtCZsuQKYhpa LOkYDT7hESya7/WIET3lfQBqX0pwFtbI832Is0ayMUR9B+12xjgPCQ089cfwkCkX6L5TPmRelJTh zMS0Sz1PyjLAMCUWjcmgQLWQMds+e3aaauZDf9dU9A2/8kPVF2odCUoMKHkfjJR+mbgC+DRiycw5 3XSqGe6HmhN/AWjHypkAXOAFW5EiuA1ge2GiZuMb0s1fSEXcATeLUfbyEY2L8yPOmdSsdghQXx3K pz2eoeXuYvMCINVFDrCdNfVUp4eJ6cSEbjbgFjBEvonGGTrgv9cHjAc8aVgSAPoxaONbzfwhDIhR at7IIS7fAGiDSwIA9alhhTBzfA7YM2FY6eMwayrIGK8FDFmshmUA43WqhFtpvoqG9HHaJ7fqtgTz 8EWVkgZgtsylFliHDgk0MB7KAEC45C/rgnGvanNLXyzOeTzcT2nw/N44gfrtYXRQLoz9Q3TgmJRx 2Mx/Q51qzpm+l3m8z2SWBqC5+PZXAtNYlGFf/gKfHfjFkDT4x7od7R+w3Ls+ZdQBuQAAAABJRU5E rkJggg== Date: Thu, 20 Mar 2025 08:54:57 -0700 Message-ID: <87v7s3zoha.fsf@db48x.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Sat, 13 Dec 2025 12:40:44 +0000 X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" Alexandre Courbot writes: > +impl Add for Timestamp { > + type Output =3D Self; > + > + fn add(mut self, rhs: Duration) -> Self::Output { > + let mut nanos =3D rhs.as_nanos(); > + while nanos > u64::MAX as u128 { > + self.0 =3D self.0.wrapping_add(nanos as u64); > + nanos -=3D u64::MAX as u128; > + } > + > + Timestamp(self.0.wrapping_add(nanos as u64)) > + } > +} Perhaps I missed something, but couldn=E2=80=99t you simplify this method l= ike this: fn add(mut self, rhs: Duration) -> Self::Output { let stamp =3D self.0 as u128; Timestamp(stamp.wrapping_add(rhs.as_nanos()) as u64) } db48x