Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp430206rwl; Fri, 4 Nov 2022 02:03:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4KM6BY3NV30S+SsL63GmO5+VygNEK8cxzrrTntPEwPsyzoM0Rj50y3MpwCE/h4yNnGTaqR X-Received: by 2002:a63:8641:0:b0:46e:c693:2e57 with SMTP id x62-20020a638641000000b0046ec6932e57mr28838783pgd.341.1667552618573; Fri, 04 Nov 2022 02:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667552618; cv=none; d=google.com; s=arc-20160816; b=ERg5I1+er0GUr2ixxqT44xN196m1s/iKmGWSFrcmw09D8O/p6xE6BBbsnEiwcUKOaH xa9qBn47sLK/H6MJ7OtrZ0rOYTcZ98hB+Kpys6ZJyvjmwCVupd6zFt2Q7bneOwhOtszg MetppOubFgwujcWI5vLSc/lmNX1bOyjxgo7I8H3nsU+keDvyE29A2h5mE5dNhkEnDeqs paMNqtcDiZZgtTRxsnICZuHk0Rr5ZYdcMqKQ6554PdG5XttUoewGt2Qp81Ibj4/w4CqV h1G/fcc3UdaBA2kmyrXm92e0omCUCU17vG7CKDesxZqRP+1VkTZf9maRZG3BgE0nIgN8 5YtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=0OWVQs+eE/tnmxSvtjbmM1DskkuHtrEYHWGMfl7RqqQ=; b=yXHC46xewqdqej3HwHRC88CP/ul3/lVl7G1Erj4nRuIlJJ5+O5PE4GZb8IKNat0ugc 8tk1IJutNUOEihPzMyWrDic+DpxiXM6WaOSwW49wXiUoqq+8yevmELQ1qJAUq/HxO2qM 0FS0JkWZB4SQQ6v1jP4tWKTSJz39cLPLHaX+WCQUEIq1EIRrdXncrIdzVKFkUYKVs3ot bkxAstv7NEpCVFFikUozvLsVefx3knQ6c12MkNPt9PaZv/Kphm6yh/arYi/OsyT/R6qs M+qnaIJcVSG2FcyR2wYHY61xvvno7QmBL2F8hsw2UKZKC0GibBu1E4319fLx6O3olxYx zxSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fq2cj16e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w184-20020a6382c1000000b004393f62586csi3902974pgd.238.2022.11.04.02.03.24; Fri, 04 Nov 2022 02:03:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fq2cj16e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbiKDIsk (ORCPT + 96 others); Fri, 4 Nov 2022 04:48:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbiKDIsh (ORCPT ); Fri, 4 Nov 2022 04:48:37 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8538E20369 for ; Fri, 4 Nov 2022 01:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667551714; x=1699087714; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=SieuJp0yLN7Eko7RfCaC+7W6DcydvNmx8QgS37YH/kU=; b=fq2cj16eks+5i8yGy1S9xJ6Jm9c5u1bzo212VX6gOKvfYoHXjEzHsdfI d7U4xlCi+kpNY5naVOSRr1ipH001dSTri89UFz+q9o8mjw799n2PKT3py YExx0GdFWVhR4jLhLN3P4i/Q5Q9rfKNI8jIB1SqrAwbcJIRR/S7DYccJE gwAedc5LA69MwPsSynoY9zX7UkaiWppQNCvu0n14jEFnIgSh2MCzLUhFi Ihdgx9XtlrQnLyR+V6kvc+QqCo/kkluPCXwFK5CCXJ1t6mcaD1+/yVZdl MD7v14B/ZLa2VN4HC/Pj89G2H90EEGK4xZTj/Jw9LUEKNb0IqJoGpkZeT A==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="311656191" X-IronPort-AV: E=Sophos;i="5.96,136,1665471600"; d="scan'208";a="311656191" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 01:48:33 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="809992785" X-IronPort-AV: E=Sophos;i="5.96,136,1665471600"; d="scan'208";a="809992785" Received: from mlmesa-mobl2.ger.corp.intel.com (HELO [10.213.192.110]) ([10.213.192.110]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 01:48:30 -0700 Message-ID: Date: Fri, 4 Nov 2022 08:48:28 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [RFC][PATCH v3 13/33] timers: drm: Use timer_shutdown_sync() before freeing timer Content-Language: en-US To: Steven Rostedt , linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , David Airlie , Daniel Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org References: <20221104054053.431922658@goodmis.org> <20221104054914.271196777@goodmis.org> From: Tvrtko Ursulin Organization: Intel Corporation UK Plc In-Reply-To: <20221104054914.271196777@goodmis.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HK_RANDOM_ENVFROM,HK_RANDOM_FROM, NICE_REPLY_A,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 04/11/2022 05:41, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > Before a timer is freed, timer_shutdown_sync() must be called. > > Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ > > Cc: "Noralf Trønnes" > Cc: David Airlie > Cc: Daniel Vetter > Cc: Jani Nikula > Cc: Joonas Lahtinen > Cc: Rodrigo Vivi > Cc: Tvrtko Ursulin > Cc: dri-devel@lists.freedesktop.org > Cc: intel-gfx@lists.freedesktop.org > Signed-off-by: Steven Rostedt (Google) > --- > drivers/gpu/drm/gud/gud_pipe.c | 2 +- > drivers/gpu/drm/i915/i915_sw_fence.c | 2 +- If it stays all DRM drivers in one patch then I guess it needs to go via drm-misc, which for i915 would be okay I think in this case since patch is extremely unlikely to clash with anything. Or split it up per driver and then we can handle it in drm-intel-next once core functionality is in. We do however have some more calls to del_timer_sync, where freeing is perhaps not immediately next to the site in code, but things definitely get freed like on module unload. Would we need to convert all of them to avoid some, presumably new, warnings? Regards, Tvrtko > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/gud/gud_pipe.c b/drivers/gpu/drm/gud/gud_pipe.c > index 7c6dc2bcd14a..08429bdd57cf 100644 > --- a/drivers/gpu/drm/gud/gud_pipe.c > +++ b/drivers/gpu/drm/gud/gud_pipe.c > @@ -272,7 +272,7 @@ static int gud_usb_bulk(struct gud_device *gdrm, size_t len) > > usb_sg_wait(&ctx.sgr); > > - if (!del_timer_sync(&ctx.timer)) > + if (!timer_shutdown_sync(&ctx.timer)) > ret = -ETIMEDOUT; > else if (ctx.sgr.status < 0) > ret = ctx.sgr.status; > diff --git a/drivers/gpu/drm/i915/i915_sw_fence.c b/drivers/gpu/drm/i915/i915_sw_fence.c > index 6fc0d1b89690..bfaa9a67dc35 100644 > --- a/drivers/gpu/drm/i915/i915_sw_fence.c > +++ b/drivers/gpu/drm/i915/i915_sw_fence.c > @@ -465,7 +465,7 @@ static void irq_i915_sw_fence_work(struct irq_work *wrk) > struct i915_sw_dma_fence_cb_timer *cb = > container_of(wrk, typeof(*cb), work); > > - del_timer_sync(&cb->timer); > + timer_shutdown_sync(&cb->timer); > dma_fence_put(cb->dma); > > kfree_rcu(cb, rcu);