From patchwork Mon Oct 16 22:56:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E029860211 for ; Tue, 17 Oct 2017 07:36:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D14312871D for ; Tue, 17 Oct 2017 07:36:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C62E72876A; Tue, 17 Oct 2017 07:36:01 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 0EB3C2871D for ; Tue, 17 Oct 2017 07:36:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 56EA56E5A7; Tue, 17 Oct 2017 07:35:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com [IPv6:2607:f8b0:400e:c05::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA4B86E553 for ; Mon, 16 Oct 2017 22:56:23 +0000 (UTC) Received: by mail-pg0-x229.google.com with SMTP id y7so7989753pgb.7 for ; Mon, 16 Oct 2017 15:56:23 -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:mime-version:content-disposition; bh=3VmK7gAIiKXSUQrTo2ol/yKS+f500iWFrwPbM7A6Pqw=; b=UP6tDxiOZF8W9G74QX1RsKQMbWV3rjP0QGiXhYUsVS+Iusq6VhBHZbJulpSPfuxUrY ahSvfsrDHqW2iMlkLTaffXUb5lkdGU33gaXOETpMj3Z+2eSg5QIdFtciyjHUd7i28u4S iaAAlKwj+J+ajSZ13q1R0KR0qU5W9Mgdjq/6g= 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:mime-version :content-disposition; bh=3VmK7gAIiKXSUQrTo2ol/yKS+f500iWFrwPbM7A6Pqw=; b=ZJfYTzvAbyBzw0KzBitNiErPEVeGD1VTnLkCzOkcrq/ttsB7+FgPg/YrpRU0Y9tvj6 pAsVDa57lXONsZ+7TYPcsbt/Ow4kS3GKfmaRtniptGho1xWvqNSYsWu3wcpqnjc2k4VC 6khPkkKiz+Yl02/fWmk7ukJPt6UrFMaul5O9tt+IFbwf3ewjdG26GWETliU77IQ1mhB9 LX2wFP9dPhxgexGcDsjP6xtwZO1NliIjwTvrGXq4GEvpDXllZK4E9N3FUKgMA3rsT43J oCET1AEYhMybY5D9vGXPDRrz9L4+AfIndmPXRfkoDsNkemvn1T0Wmnz7ES5gd+SBZD0b sVww== X-Gm-Message-State: AMCzsaUg0dvGgyGB29aRt4IEEONLLrGmPbTjWDhCm/QYLGpvb8W5u6WN keeDjVSbOP7wTgSDByzOk9c0ew== X-Google-Smtp-Source: ABhQp+Q4ehLsO15AG5cQLoR+vdGNTpL/f9TBfS36Qb9OitZENRdKYmyTAwMSKCL7qltPRLMhujroig== X-Received: by 10.101.93.9 with SMTP id e9mr405792pgr.302.1508194583438; Mon, 16 Oct 2017 15:56:23 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id h70sm18273623pfc.51.2017.10.16.15.56.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 15:56:22 -0700 (PDT) Date: Mon, 16 Oct 2017 15:56:21 -0700 From: Kees Cook To: Lucas Stach Subject: [PATCH 150/156] drm/etnaviv: Convert timers to use timer_setup() Message-ID: <20171016225621.GA99059@beast> MIME-Version: 1.0 Content-Disposition: inline X-Mailman-Approved-At: Tue, 17 Oct 2017 07:35:19 +0000 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org, Russell King X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: David Airlie Cc: etnaviv@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 8197e1d6ed11..e19cbe05da2a 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -968,9 +968,9 @@ static void hangcheck_timer_reset(struct etnaviv_gpu *gpu) round_jiffies_up(jiffies + DRM_ETNAVIV_HANGCHECK_JIFFIES)); } -static void hangcheck_handler(unsigned long data) +static void hangcheck_handler(struct timer_list *t) { - struct etnaviv_gpu *gpu = (struct etnaviv_gpu *)data; + struct etnaviv_gpu *gpu = from_timer(gpu, t, hangcheck_timer); u32 fence = gpu->completed_fence; bool progress = false; @@ -1765,8 +1765,7 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master, INIT_WORK(&gpu->recover_work, recover_worker); init_waitqueue_head(&gpu->fence_event); - setup_deferrable_timer(&gpu->hangcheck_timer, hangcheck_handler, - (unsigned long)gpu); + timer_setup(&gpu->hangcheck_timer, hangcheck_handler, TIMER_DEFERRABLE); priv->gpu[priv->num_gpus++] = gpu;