Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp874627pxk; Thu, 17 Sep 2020 19:59:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUjH4iltvyDOGRKo/RZxWhSEpixc99Nhe7ja+W9BQaojIDxh7PmlVwc+8bp70NvhDPXta X-Received: by 2002:a17:906:82d1:: with SMTP id a17mr33468821ejy.385.1600397969615; Thu, 17 Sep 2020 19:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397969; cv=none; d=google.com; s=arc-20160816; b=Y9wMF/ji2CbDIsAtj/H6H1ylVypFiSI1+zeccYEwmfGruxCBPApZVTs2M/HKQ7bpK0 HOhWueGw3r48o0ww0OTleupFYCR34Iu1N+8ouCmXKRmEWTZpcDyR+K+UvIrQVoz06ad8 irnp/ubPCcZukCAIiWraLhzsU20fEWY2wFo0gErl3X/ve3uVLTwHb+y99vqEJ0owLMCu +CAcHd9sUdJKw8t+syJCoyYunGBj5YGPB0r2yr6kdpX+X7B/qG1TF8u+Ox1plUMMPyFo EosRRhz6mZwUw1hwY438Rl0SCCB5n3Kl5wg/6t1CxT0wjaqc/PeYG0iq0oUb4KBpvp4I WNsA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bWvgLrHY4EZ4c4Hd1GVJ8Yo3daCvEr+NwHhmi2QyB+k=; b=mvool8Z3uFc0QOcQ4srT/vDo5UvwY8N8u4EJ/4YTeu+CuikQMu6ykCBECVOFh0H6iN Z3y6jF1NuaVk/tYvthUMoaQxtt2F2/A+Nuzl7NI/oH1mBTgGhiC32l517Ok8d5O/MJYB J2sqZ3rxxL8oXY8GyISMt0ip6mpnDHjAqYSfZGUbqc8+mfVZiDWNqMN2a2lvJOHOBjTy 5yWAYEA6iBb+m9fcGLwAvmRtWmsbhATvo0ayfZ0ufakn5P3bP3yMIJFHfVMBZo4N0ZCu slDnr2xGSakbjq7q9PeDgVCstIHJ2vQmXpvCcvqK5rORYcXRKhKlZGYvdNnt5LpymAZj zFag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WNZUk24n; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s19si1252336ejv.149.2020.09.17.19.59.06; Thu, 17 Sep 2020 19:59:29 -0700 (PDT) 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=@kernel.org header.s=default header.b=WNZUk24n; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730074AbgIRCz2 (ORCPT + 99 others); Thu, 17 Sep 2020 22:55:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:57216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727846AbgIRCHI (ORCPT ); Thu, 17 Sep 2020 22:07:08 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4CA8C239D4; Fri, 18 Sep 2020 02:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394817; bh=Wsa4beIEYGpdtXfeQjSXG6vYREQhzVq+tgqNmQLTbOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNZUk24nUhOQZNJXfuXSOhuDAjTkWNp+ibeGrl0VHtxHlefDyvTmgWJxBp9E364SI 5JElFtNxwzOUhlbbIC05jLxPUheq0jP+OKX3XaPqVdvcbAHgGxuv46xPFDqYQET8gi S+YzUbBM5KgUGCti7KTcbfE1z7r+5UiehQW4h6ok= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dinghao Liu , Ben Skeggs , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.4 283/330] drm/nouveau/dispnv50: fix runtime pm imbalance on error Date: Thu, 17 Sep 2020 22:00:23 -0400 Message-Id: <20200918020110.2063155-283-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit dc455f4c888365595c0a13da445e092422d55b8d ] pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 419a02260bfa7..ee2b1e1199e09 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1032,8 +1032,10 @@ nv50_mstc_detect(struct drm_connector *connector, bool force) return connector_status_disconnected; ret = pm_runtime_get_sync(connector->dev->dev); - if (ret < 0 && ret != -EACCES) + if (ret < 0 && ret != -EACCES) { + pm_runtime_put_autosuspend(connector->dev->dev); return connector_status_disconnected; + } conn_status = drm_dp_mst_detect_port(connector, mstc->port->mgr, mstc->port); -- 2.25.1