Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752436AbcDULfw (ORCPT ); Thu, 21 Apr 2016 07:35:52 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:35229 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752351AbcDULfv (ORCPT ); Thu, 21 Apr 2016 07:35:51 -0400 MIME-Version: 1.0 In-Reply-To: <4683452.tNFHTvCUEu@wuerfel> References: <20160413095214.GA101605@localhost> <4683452.tNFHTvCUEu@wuerfel> Date: Thu, 21 Apr 2016 04:35:49 -0700 Message-ID: Subject: Re: [PATCH v2] drm/msm: Use 64-bit timekeeping From: Tina Ruchandani To: Arnd Bergmann Cc: y2038 , dri-devel@lists.freedesktop.org, Linux Kernel List , Wentao Xu , Thierry Reding , Hai Li Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 696 Lines: 18 > > How about > > remaining_jiffies = msecs_to_jiffies(ktime_ms_delta(*timeout, now)); > > which only does one 64-bit division, and it's one that we can probably > optimize out in the future (we can check in ktime_ms_delta whether the > difference is more than 2^32 nanoseconds as the fast path). Hi Arnd, I had thought about that, but discard that approach being confused about the truncation. ktime_ms_delta returns s64 and msecs_to_jiffies will truncate that input to int. However, I now realize that for the msecs value to be greater than 32 bits, the time delta has to be >= ((2^29)/(60*60*24*365)) or >= 17 years. So your solution is safe. If that sounds ok, I will send out a v3.