From patchwork Thu Jul 26 12:39:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10545817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA7C3112B for ; Thu, 26 Jul 2018 12:39:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B89002B077 for ; Thu, 26 Jul 2018 12:39:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABE5F2B155; Thu, 26 Jul 2018 12:39:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 625F52B077 for ; Thu, 26 Jul 2018 12:39:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CFD8E6E720; Thu, 26 Jul 2018 12:39:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id CA7426E184; Thu, 26 Jul 2018 12:39:49 +0000 (UTC) Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LtX2S-1gA07I0uSy-010y4e; Thu, 26 Jul 2018 14:39:44 +0200 From: Arnd Bergmann To: Rob Clark , David Airlie , Jordan Crouse , Bjorn Andersson Subject: [PATCH] drm/msm/gpu: avoid deprecated do_gettimeofday Date: Thu, 26 Jul 2018 14:39:25 +0200 Message-Id: <20180726123942.4172219-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:Hm34pELgHedz40WKDazuD+Pq1FNMFo6qcWrEOPtyKAwm6xMaIM3 irpU+jc0kZPu9AbM89kiNf2lEQWO6H+gkQ158a3VPrwZNjPYXkuahXM1xhPW6firoCfOwtI n/lGiofY43eeODPAOH0PL7kmk1af06whrBP8mpdGPLWpNAFPypUlhTZTK5M0rahqiJGBo1S klZgar6ZFdYMlcH1Gf00w== X-UI-Out-Filterresults: notjunk:1;V01:K0:BT1nGARZdSs=:Ghy9VhzOljDxMYLitgs4fy sfvXXSvY0gpZk6o1He1ur6cMNWhkfeZiRXgw5JZXV7WdzrJipSSZygf1G3ZpcSWvE6JzYo/lG 8fP+OVDD5vwCarOqT22jtgt7YR08iSvFcu58uoPOe3fBP2h4hqliDwjnF/CUWF+DGjQlEsVHj 8Hw2VS1m3kgAVKja7jnXlmeKsW2GEU2NfVsYGULDjfqb5u2qsoM0p0+cV8Z/5hyagCx390+mp aluH6laNLsM4SAmUY1xe1Wfq//psCfDOMpUbcUkEFDQGme6HAUzYaigncFg+fnZEKpPOsaNUj MLfObBe7ousBLY4BtaShhfQi78o8y/VrlPpDseonwGbwDhr4t87aIM13rtLptmeUcpzMfeqOu r/O9wq5CnkPpaE3ID+ni9bbpUdKz5n1nD4jo5nwG9IexcEuXRqD0NjxXO9uOOGC/3TYSkvXx6 ALhIGrY/QO9xs2W7U9YdK04Sb++hH3Rz0AYKhNmOv2/MWfKvBfksdklDmwAjmfFK4aB99anms G6DLj5gUxXehTG7WyyMEBeOz2x6DVOUn/8I9+2131nse5vDxMmQKhYk41qovKyJEXXtlmJKk2 QfBcSNCiRfHmVz7Rg9B+x20UYYbW7TwiYzmVJAsNKlBYqtrQ/NTvjHdMHp4nl/8X56eXNSGci 6pB9kIN/gqhHz2ZK+dd10Q+ya+LlHKSUIXtzy1Dt4mPChDb3hu82v+rlBmPOw9dzoYEQ= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP All users of do_gettimeofday() have been removed, but this one recently crept in, along with an incorrect printing of the microseconds portion. This converts it to using ktime_get_real_timespec64() as a direct replacement, and adds the leading zeroes. I considered using monotonic times (ktime_get()) instead, but as this timestamp appears to only be used for humans rather than compared with other timestamps, the real time domain is probably good enough. Fixes: e43b045e2c82 ("drm/msm/gpu: Capture the state of the GPU") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- drivers/gpu/drm/msm/msm_gpu.c | 4 ++-- drivers/gpu/drm/msm/msm_gpu.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index 08d3c618b7de..38ac50b73829 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -376,7 +376,7 @@ int adreno_gpu_state_get(struct msm_gpu *gpu, struct msm_gpu_state *state) kref_init(&state->ref); - do_gettimeofday(&state->time); + ktime_get_real_ts64(&state->time); for (i = 0; i < gpu->nr_rings; i++) { int size = 0, j; diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 3cf8e8d29812..f388944c93e2 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -297,8 +297,8 @@ static ssize_t msm_gpu_devcoredump_read(char *buffer, loff_t offset, drm_printf(&p, "---\n"); drm_printf(&p, "kernel: " UTS_RELEASE "\n"); drm_printf(&p, "module: " KBUILD_MODNAME "\n"); - drm_printf(&p, "time: %ld.%ld\n", - state->time.tv_sec, state->time.tv_usec); + drm_printf(&p, "time: %lld.%09ld\n", + state->time.tv_sec, state->time.tv_nsec); if (state->comm) drm_printf(&p, "comm: %s\n", state->comm); if (state->cmd) diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h index 57380ef8d1f7..1c6105bc55c7 100644 --- a/drivers/gpu/drm/msm/msm_gpu.h +++ b/drivers/gpu/drm/msm/msm_gpu.h @@ -189,7 +189,7 @@ struct msm_gpu_state_bo { struct msm_gpu_state { struct kref ref; - struct timeval time; + struct timespec64 time; struct { u64 iova;