From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752137AbbKIUdn (ORCPT ); Mon, 9 Nov 2015 15:33:43 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:59484 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbbKIUdl (ORCPT ); Mon, 9 Nov 2015 15:33:41 -0500 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: Alison Schofield , JBottomley@odin.com, outreachy-kernel@googlegroups.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: [Y2038] [PATCH v3] scsi: pmcraid: replace struct timeval with ktime_get_real_seconds() Date: Mon, 09 Nov 2015 21:33:29 +0100 Message-ID: <4181408.ziShjq4Q0D@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1447097660-3063-1-git-send-email-amsfield22@gmail.com> References: <1447097660-3063-1-git-send-email-amsfield22@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:/+/C2qf15yxnZD4gvYcBoVBrxiKyCANE8Bepky8OqpKOckP0nhO r84+goukRoQ5Z/f9oCswJXpBkpe0zuz4ZxlfoDDEQHOjUKshS8oqBc8MjN48Vu9nAwDoPBV jzBo9yuFEhcOrS6DCUNfrvx36+A3NqmQkICKivwW6cQpxONiK7UoMIC2z6HzU01uaAEDpqu lVX1l2YQUgbQ20SD7rvuw== X-UI-Out-Filterresults: notjunk:1;V01:K0:QPfSJwbRgIQ=:putpz73opTZ6r/KheiDTv/ 3QLjf47o/9p2zsFLYoA+t97shinqiTmqDC4QfAuc1y65jAaMrT0E35rRRydpnm2qjzjoyEqYG NawH9ce722sbWQG+Wzwqex/nqEU76iKK5HXnlaX/+Guu0UJVWfAZKAhBhsZXeUiskPZIWzqx8 8n+byTXr/F9zYu78QM0HPWTnRgyHJVYO+H8V4Q4JzPDbEBemukQalqWlK4IYMjrFLtINF2c7J SP2bcxNp0MOpQg0drlvxThMzX5hVAbB5nureYfFEX4YMSVmXYXtN7Evz4KkhxMWYkSPf7bPPR ePeIgN10S5zxL+02eP8NwkV6of9TBrIGNlQbusSQuqmAPW95HZiPSes/McRhRVF7byGNcGzNx 1JDRh2bYcAGlwff8h9RaZcsnYG/5g6FcVpOgHOAIri/qRvTUGhHkpr0wqD5at309PzX6GZdhb T2kvnEfyEDu1uPgN+iE2HcpUEnFFQuTGmrvZ9cK8cg1ztVk6DjowrDMDBNdJLtT0+xXVcvppC 2Yh+UuhO/EYCdFobVNGIjPV3OPLEtrd51539VO+TQrf63rUqZGCYI1DRbFOXwTvUjXwkTG00M ZkH3c0aHgmjJVfzhEw6gK47HJ+lAHi/kiezDr1AcI/HI/KRdxOCf+c0/yB+6FvbsgJ/9/3xud xk/irwPGVj8dzDKG2f9d1JozqRRyeUAylpzrik6yHM5a+nMqtGMC7iDrtZmkLDQdAGA43TCbN XiM1rfzfhHzD+zRi Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 09 November 2015 11:34:20 Alison Schofield wrote: > Replace the use of struct timeval and do_gettimeofday() with > 64 bit ktime_get_real_seconds. Prevents 32-bit type overflow > in year 2038 on 32-bit systems. > > Driver was using the seconds portion of struct timeval (.tv_secs) > to pass a millseconds timestamp to the firmware. This change maintains > that same behavior using ktime_get_real_seconds. > > The structure used to pass the timestamp to firmware is 48 bits and > works fine as long as the top 16 bits are zero and they will be zero > for a long time..ie. thousands of years. > > Alternative Change: Add sub second granularity to timestamp > > As noted above, the driver only used the seconds portion of timeval, > ignores the microseconds portion, and by multiplying by 1000 effectively > does a <<10 and always writes zero into timestamp[0]. > > The alternative change would pass all the bits to the firmware: > > struct timespec64 ts; > > ktime_get_real_ts64(&ts); > timestamp = ts.tv_sec * MSEC_PER_SEC + ts.tv_nsec / NSEC_PER_MSEC; > > MAINTAINER: Please request alternate change if preferred. > > Signed-off-by: Alison Schofield > Reviewed-by: Arnd Bergmann just the last sentence of the changelog should probably go below the "---" line as it is irrelevant in the git history if the patch gets applied. James can probably remove that line manually when he applies it, just remember this if you have to send a version 4 for another reason. Arnd