Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2406567pxb; Sat, 30 Jan 2021 01:26:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxp474u4L6O8nkkWVtNr26V8zYECd5Mv74WRjg/QEEDLngaQYRJCVUsq/f6QZA0Srb1pZa5 X-Received: by 2002:a17:906:d159:: with SMTP id br25mr8244716ejb.398.1611998770062; Sat, 30 Jan 2021 01:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611998770; cv=none; d=google.com; s=arc-20160816; b=0ieDMicl16W5HSdclotjV2fNSVdmgRn0i5ixFKKEMhWlHHspdEg8pDJmFy63JTm/Oy WT2BTIxv0fzX57l4zOjVB8+URltcJW7EcQqPMhG1q5fUUL+UVc4YPLqOjRkQhyQJehoj UWc4pAGHzgpx4CUvSzK/RXfsYJb5YB9ERnpnHDpXAyPQ1S/sE2Gv6T8HxVx+OISOFayF 2rxWFCWBXvoAQ182X3OS8YA7awDFlUb5KI1i2B+uMcDqxIYr8tra7Y83xhoaur1KseXM jZ4ejIBejwYr1Kacx1l8M1MsGHskg6PDhqPfb5sxwAGOaConOcjvXC014SSQ9i8xHTDF xtzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2Nm9IfnYPTwx6O0U9BdKLhxgG7rzF4f0DS/IBep8xNQ=; b=aY+3wqRa2IKpmIOGGbZJTBBL6JsDcsFIdaYRYqmTjv3Qlkm/ksnuV96qAnonhiHGv8 R3q130aLn+PzMzo2IfqD4BGHbxR/GHIuQ2MxSgqTawmIfR/nfLMLXzRezbpUIWkIX4qX wQyqo0n/zzHYlUo+SHm9QyjMvlfB6BavsPoZpDEdf1RNSCyuap2Dv8FfUqe05qxprcx5 fh1kzQdOIf4T1HkAVOZWvD9lFiGxQ2CSThMOvxa6khwBDmVSM/trOebmwffAsc8YT0Ce MTUuFjeP8hNsCUzjT9zXsUGUQPz8mV1Q70Vx01d2hTIDICpNQgMaw+AB1AXgXhLhU0wk 57Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dAtNPsQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lt6si5895780ejb.133.2021.01.30.01.25.46; Sat, 30 Jan 2021 01:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dAtNPsQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbhA3JYY (ORCPT + 99 others); Sat, 30 Jan 2021 04:24:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231854AbhA3JVG (ORCPT ); Sat, 30 Jan 2021 04:21:06 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49193C061573 for ; Fri, 29 Jan 2021 22:32:03 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id s7so7963714wru.5 for ; Fri, 29 Jan 2021 22:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2Nm9IfnYPTwx6O0U9BdKLhxgG7rzF4f0DS/IBep8xNQ=; b=dAtNPsQdYjophNuTU8NT6epZcaDeSrQs/c8eei4DT1CWQBEjlxVGw5Goax1seBiwBQ jEnwGrlEFssBsfg7D4luNcaUa5QRab0GFZJrpVVACtHEneFndwwVlPeXQA0rEsIIGZfW Dz069gikwHnLrdL4SMMRsvl8air957bwcy5YWCPNcX9KC+PlI728BtkiW2Cz+8Zp7yDQ qLfwrjQDcZK9aD8sh6ZnTLa6NMb+6KW3I7eAmMz9X5NcdzPh74wtay+WBTZQBfd3eDmY qpsHgLNYAbq3Sx3lDXQWCVA5JYDNmVrB9SBbbOcVmzKl4LxbIDepT2dnMAlaMbZF/QgO YmrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2Nm9IfnYPTwx6O0U9BdKLhxgG7rzF4f0DS/IBep8xNQ=; b=NHHhSIGFUY41azFZNyWundWoQhDoBvr/oBdhC4/LAoPFQwIshduiTwbD48HbxJh/cl vZZHAUV/dXpeKtfJo0yyH80S1yo2PuUaRorXUiv7MdP+KcXDSkE+tSIWe15DqnwZgVCX UEYe4Zlezro8iPIP156dJmU9vrjoERk0VnRcHyVaZAvyTuxmuKvhae0l8h0afvJ+uew9 KMIUyCRKboQ5kO0k5yOnHEwwmuVX3L/1fDF2RNyZ9T7k7zF6Wke8kW6IkSKlTHtIMKXR Fa1pPXz7mBl4ifeCJAQ07/l1G7uXkebFlCxfjNAozdhodf2+g32epAhn4CYQomqRCVJP 8IAw== X-Gm-Message-State: AOAM531HamyPv0zCAvjK7SHHNpuBhT5XZjEYhDmDT3WAhJ5aWeGLrtQy SGYPPLJXk3jX5cVzCoDtinDNERhIWiYZuDsDSM8= X-Received: by 2002:a5d:52c5:: with SMTP id r5mr7992929wrv.208.1611988321918; Fri, 29 Jan 2021 22:32:01 -0800 (PST) MIME-Version: 1.0 References: <20201127094438.121003-1-miaoqinglang@huawei.com> In-Reply-To: <20201127094438.121003-1-miaoqinglang@huawei.com> From: Qiang Yu Date: Sat, 30 Jan 2021 14:31:50 +0800 Message-ID: Subject: Re: [PATCH] drm/lima: fix reference leak in lima_pm_busy To: Qinglang Miao Cc: David Airlie , Daniel Vetter , dri-devel , lima@lists.freedesktop.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks, applied to drm-misc-next. Regards, Qiang On Fri, Nov 27, 2020 at 5:42 PM Qinglang Miao wrote: > > pm_runtime_get_sync will increment pm usage counter even it > failed. Forgetting to putting operation will result in a > reference leak here. > > A new function pm_runtime_resume_and_get is introduced in > [0] to keep usage counter balanced. So We fix the reference > leak by replacing it with new funtion. > > [0] dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") > > Fixes: 50de2e9ebbc0 ("drm/lima: enable runtime pm") > Reported-by: Hulk Robot > Signed-off-by: Qinglang Miao > --- > drivers/gpu/drm/lima/lima_sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c > index dc6df9e9a..f6e7a88a5 100644 > --- a/drivers/gpu/drm/lima/lima_sched.c > +++ b/drivers/gpu/drm/lima/lima_sched.c > @@ -200,7 +200,7 @@ static int lima_pm_busy(struct lima_device *ldev) > int ret; > > /* resume GPU if it has been suspended by runtime PM */ > - ret = pm_runtime_get_sync(ldev->dev); > + ret = pm_runtime_resume_and_get(ldev->dev); > if (ret < 0) > return ret; > > -- > 2.23.0 >