Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1162666pxb; Fri, 21 Jan 2022 11:10:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvUL7QO0nHttEzijF0p1LbycPvP+vGChbN8qVghwvzB8qv/6BRzhnmrBf1nvTzeALvBRSB X-Received: by 2002:a17:903:185:b0:14a:6879:930f with SMTP id z5-20020a170903018500b0014a6879930fmr5151050plg.94.1642792251607; Fri, 21 Jan 2022 11:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642792251; cv=none; d=google.com; s=arc-20160816; b=NGoWz9pzKnLm8QTzoDob5hCQS8S3Ztw/k+94zhj4o3Vug9jtSP82Im3W6ng607RWqE uxQW/DE0plOa3IUyA3o3WynxBRB5ZTT9jmr6TdB/EJWhtgAufDu70wejwLG3Za32rc8e QBC6r92LLYa1SpMdrmRRYNEMf8oULUekr9GkxyBajc+iBZrjoazlHJFpRZymUrMemXRt 7V662y6vn6mp9WJ5feGlpYMzgXsul+vAlvMXkJMij6wxkZhOsrRmkTgM0qq5QdKWb0i+ 4dQ6MKaRQIw0f7ZJ8CkDRAH9VoAPFwhl3sIqelDPu6vfOWAO/xgebEjE5J7GTBhAwj1q 698w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=RsUu/jYhmOYwBtMyjfdBO07hVIBQv4rZll/OqCSMK/M=; b=w1E2VgxA4t9KAD/z3dHRVe5Z0OwGoH/eIieNkFATZRL7l6A2Ei0ytGkXBfYXP6MSzO n1dT+wv+1zH32Hhge61NllGI0BFR16R9qdSSsGS8rvEO3bbI7EymQc+0XCl6tRGUOA7u uaUfZ8NrVdv4dUayJ90+fi6aUWatWM5rmPNrjgVVwIxmVIGsSxCUKrYZELp3SwLQtO8Q I4YmT7cZcaI90STNb4ubEMKK9LqQlt1kP0jRBEC59hBCWl+fjrAyZkwR3lmXx4VOvo0X mmPuBKikjM0Qx7vTnQDIDlz05faV4rjwdjtY8yIlNSaB1EQz9ZIQpKAEOYHSFVIcgH1B aUMg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v185si1849508pgd.469.2022.01.21.11.10.39; Fri, 21 Jan 2022 11:10:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353905AbiASKvj (ORCPT + 99 others); Wed, 19 Jan 2022 05:51:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346702AbiASKvi (ORCPT ); Wed, 19 Jan 2022 05:51:38 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C6D0C061574 for ; Wed, 19 Jan 2022 02:51:38 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nA8Ym-0004NV-S7; Wed, 19 Jan 2022 11:51:24 +0100 Message-ID: Subject: Re: [PATCH] drm/etnaviv: Add missing pm_runtime_put From: Lucas Stach To: Yongzhi Liu , linux+etnaviv@armlinux.org.uk, christian.gmeiner@gmail.com, airlied@linux.ie, daniel@ffwll.ch, etnaviv@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Wed, 19 Jan 2022 11:51:20 +0100 In-Reply-To: <1642515391-19329-1-git-send-email-lyz_cs@pku.edu.cn> References: <1642515391-19329-1-git-send-email-lyz_cs@pku.edu.cn> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Dienstag, dem 18.01.2022 um 06:16 -0800 schrieb Yongzhi Liu: > pm_runtime_get_sync() increments the runtime PM usage counter even > when it returns an error code, thus a matching decrement is needed > on the error handling path to keep the counter balanced. > Instead of adding more error handling code here, I would prefer to convert this to pm_runtime_resume_and_get to avoid this issue. Regards, Lucas > Signed-off-by: Yongzhi Liu > --- > drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > index 242a5fd..5e81a98 100644 > --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c > @@ -1714,6 +1714,9 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master, > return 0; > > out_sched: > +#ifdef CONFIG_PM > + pm_runtime_put_autosuspend(gpu->dev); > +#endif > etnaviv_sched_fini(gpu); > > out_workqueue: