Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752225AbcDPXjq (ORCPT ); Sat, 16 Apr 2016 19:39:46 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:57612 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751893AbcDPXjp (ORCPT ); Sat, 16 Apr 2016 19:39:45 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: Tina Ruchandani , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, David Airlie , Benjamin Gaignard , Vincent Abriou Subject: Re: [Y2038] [PATCH] drm/sti: Use 64-bit timestamps Date: Sun, 17 Apr 2016 01:39:33 +0200 Message-ID: <7376001.70fALvhWdv@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160413092802.GA99759@localhost> References: <20160413092802.GA99759@localhost> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:8FslviPR+FvYUCAhKmgQkjqUOxr4ehOD77BwVuZCChMoKLID7gE VWfI8GMZvO0Ien6SE60T3yyp+QVK2HrnwugXH1kyFLLttMOIoD6Doli8J4O3T1lNbULazDz ta09x/By4FmspV8g+haK6kZ20lILMFjVBpAJysdrMOyBTMOsP+0BWNzNABfVCLFjtnK7X2I q+/i93MYC7JOaiLe1EaJg== X-UI-Out-Filterresults: notjunk:1;V01:K0:2FJaUH1QYvw=:DBg1OlxGEbyL4nVJINgdEL dWbOWuIHTZV3H7V4WR9zizMXlL8VPlHpzRt6+Qh+fAgAst5N2TUMiud+MSWOgy4ukkJa7i4di jyMYudLLCJ4ejybvQ1QnxBBPtEqSS/F6MXwS79MrW346jhTvlpq94Z7Yst/oGvxnPLT/6Kb9b 3cskFhYcpNcQVt+UPHT4mtPVJ93yKcOuLWgua1zPPg2VADCeep1iwwX+So6h5ABUOGKwgMuCR Jh9pKQ9IUTfQ8VopKE9XC1+LvFo9Fizt7IY1mj8oxcYJl4IXIAcCC0bYtcL9Ehiz53lefIngN OibNNr5ruqvZEe7Er2HTwpQV14Kw14COmUSWd+9Smvu1R7fWSds9FK3f43daK1ea15UFXF0Ym sYK+TuV3LR0uupNHHk67ED0W8MTkVRYlx4GnWnfRg3BlkldrdGV5n425OV6umDfxP5X3Mzaaw XLuSkhLQ/AipAJLC4NpWQkbmTPSK7OTzbEmGIDdfi81J8YoF7dLjrCkTCR9Wy+BYSBZxgzz/4 v8QkwX9HjKunhlEGPIRJxQvXEHqmxY8Q3f7k+p5ALvJg3B9Lx+JEpHGvnLaElMokYYTXi41wJ sQTd1XCQD0A3vh47vWPzKMUUGsoeEM+qKr+vmYEIhRx6j66k+NNhEG7aMxyHSpv0tlMDyQ2xN Y1BaTcwtQaiAbrB7zqDsxvSW6FHrRWX0Hd1yLJ+H8OnWzvOme1a3+/p1zzdEks5naAwKKVoeN 3lShxq5ecTcGZ7mP Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1356 Lines: 41 On Wednesday 13 April 2016 02:28:02 Tina Ruchandani wrote: > 'struct timespec' uses a 32-bit field for seconds, which > will overflow in year 2038 and beyond. This patch is part > of a larger attempt to remove instances of timeval, timespec > and time_t, all of which suffer from the y2038 issue, from the > kernel. > > Signed-off-by: Tina Ruchandani Looks good in principle. Two small points: > void sti_plane_update_fps(struct sti_plane *plane, > bool new_frame, > bool new_field) > { > - struct timespec now; > + ktime_t now; > struct sti_fps_info *fps; > int fpks, fipks, ms_since_last, num_frames, num_fields; > > - getrawmonotonic(&now); > + now = ktime_get(); It's unclear why the driver was using getrawmonotonic() here rather than ktime_get_ts(). The code is fairly new, so Vincent can probably explain this. If it was intentional, we should use ktime_get_raw() instead of ktime_get(). > @@ -76,7 +66,7 @@ void sti_plane_update_fps(struct sti_plane *plane, > return; > > fps->curr_frame_counter++; > - ms_since_last = sti_plane_timespec_ms_diff(now, fps->last_timestamp); > + ms_since_last = ktime_to_ms(ktime_sub(now, fps->last_timestamp)); > num_frames = fps->curr_frame_counter - fps->last_frame_counter; This could be expressed in a more compact way using ktime_ms_delta(). Arnd