Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2153356imm; Tue, 10 Jul 2018 14:20:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcwajqfJv9PtD5P0uEIp9pRoZ1Kpi9dlyitYvEYzF2Jw8fWTlUxWGa1vbyKH92OQ7s/shT0 X-Received: by 2002:a62:bd03:: with SMTP id a3-v6mr27141355pff.138.1531257614102; Tue, 10 Jul 2018 14:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531257614; cv=none; d=google.com; s=arc-20160816; b=aqXWrjHTpPiFEyuez+WTOP3yFv9vmTFpZy6f28hqmLExogaAZYom8MQhJU1qfSOXnQ PvNJ21pg2TSP0h9PY1/7+PehmGmxVG/vr/P0iCS0BViEMuAhLFBfgDXK85pErd22ZLTs 56M6aSkMGuuCFI7Zqg2R3u9pLeuYEUKm23g0axvqdEKuD7hjph9K5aqBywSwxLHE6cs7 V5zMBlp5fqMsEYQUSbB9HoFwAKuWnxciE1o/SwY9zhQdYOKjzOddIOH8PH7qdyByYTlo bkGskSodi/em4HBqqWN+nJ5jEBxRdBYRl31uz6zCMRSNNiRqVBdabeYn52COwsliTXBC tNAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=D4V2He12W5IThoG2lp37esf8UqUdAuwXkWaIgIeVuu4=; b=jriCl9JGOqBFmQhaAjR+8cPUkpBTA2mhoS0kuucH+mefBETwl4X4k+nANZKQmwCyJR a1rxGg2QUreM4RX7Zkrn0K/KCG35GdyQYaaYvv7zmoJhA/mbeF8kASU4wUogupKd2XRe VwtBGW2UR7rN50lZgEYFCF0ZSQbiC/KrDV7SFsyomoJp2dK/Is18ItPvl7b53/rZDso3 G+QaWr1W0xJSOASlfGxCnxQonLalI4X0ZU8Mvej6oSmraRg1YtnLDN59AZ8q/QJeh7Y0 iyUj0U1KgcxZDgBI0Dh3tm1fmHJuRzf8Zx7FLMXQ/N5sDU3xLLji81lqv9rzSuI0icRY EvZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Tt+x9ldM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si16664839plp.44.2018.07.10.14.19.58; Tue, 10 Jul 2018 14:20:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Tt+x9ldM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732318AbeGJVTm (ORCPT + 99 others); Tue, 10 Jul 2018 17:19:42 -0400 Received: from mail-yb0-f196.google.com ([209.85.213.196]:38944 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732187AbeGJVTm (ORCPT ); Tue, 10 Jul 2018 17:19:42 -0400 Received: by mail-yb0-f196.google.com with SMTP id k127-v6so9201108ybk.6 for ; Tue, 10 Jul 2018 14:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=D4V2He12W5IThoG2lp37esf8UqUdAuwXkWaIgIeVuu4=; b=Tt+x9ldMF6TqXe7r96ec1npfJ+OcvnUpXNSUTOJ1ZOq53nCRnvlzDtpe0Kd1Q7S0vu KoczRrmqhFru//MStzG9wyqgOSgxkEcmtGqtXlKDneHdjcacFsC13d0jUqg2eCIowQzY T1oYQU66Nts5lJFwBSQy/o9eFlvDWmxbwbh9U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=D4V2He12W5IThoG2lp37esf8UqUdAuwXkWaIgIeVuu4=; b=MU+zGcoqAt62+Szk/xeaqjdW7+NlOcFciruUSa1iOPnDWD0FRzX+sevw0xOSoWkg9M 1FrVxALa++QhxczlzA7UHt6YK0ZFwhPyyDUksNYG5J1zjqE2z+bbOEDFnqCvruM28zKM BVQRwyQdkYdmQ1k9dbv0rEqg9KZ+TT+A/rmNxLYGKVhuVTcOzqZRYhK1fo0Gt5KCjGOE wFCAidEe4cbh/6aCZzJhX2VJs8PeKxvBhNCAJY91x2sf9SmP3BTSoAtpxiHvr/vcXVh1 EKdi2gjpFBzTW4dQD0NShXz3g5NTG/IISLnLq2LuH+mC69Iz+ryU2NzEFU7nF3U/u0Lk Ofug== X-Gm-Message-State: APt69E2DfBj0rjUFzYSUm5ORx/2AOzwbuukByQOugBD5302diiqa8m9m PfAToWCYgRO3wJKQ9aoaZOTFeQ== X-Received: by 2002:a25:ac44:: with SMTP id r4-v6mr13826891ybd.497.1531255657892; Tue, 10 Jul 2018 13:47:37 -0700 (PDT) Received: from localhost ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id m128-v6sm4808378ywf.10.2018.07.10.13.47.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jul 2018 13:47:36 -0700 (PDT) Date: Tue, 10 Jul 2018 16:47:36 -0400 From: Sean Paul To: Arnd Bergmann Cc: Rob Clark , David Airlie , y2038@lists.linaro.org, Jordan Crouse , Sean Paul , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/msm: avoid using 'timespec' Message-ID: <20180710204736.GU20303@art_vandelay> References: <20180618153959.2169325-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180618153959.2169325-1-arnd@arndb.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 18, 2018 at 05:39:42PM +0200, Arnd Bergmann wrote: > The timespec structure and associated interfaces are deprecated and will > be removed in the future because of the y2038 overflow. > > The use of ktime_to_timespec() in timeout_to_jiffies() does not > suffer from that overflow, but is easy to avoid by just converting > the ktime_t into jiffies directly. > > Signed-off-by: Arnd Bergmann > --- > drivers/gpu/drm/msm/msm_drv.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h > index b2da1fbf81e0..cc8977476a41 100644 > --- a/drivers/gpu/drm/msm/msm_drv.h > +++ b/drivers/gpu/drm/msm/msm_drv.h > @@ -353,8 +353,7 @@ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout) > remaining_jiffies = 0; > } else { > ktime_t rem = ktime_sub(*timeout, now); > - struct timespec ts = ktime_to_timespec(rem); > - remaining_jiffies = timespec_to_jiffies(&ts); > + remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ); Do you need to wrap rem in ktime_to_ns() just to be safe? Sean > } > > return remaining_jiffies; > -- > 2.9.0 > -- Sean Paul, Software Engineer, Google / Chromium OS