From patchwork Tue Sep 29 11:00:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C9BDC4727F for ; Tue, 29 Sep 2020 11:58:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDE93206DB for ; Tue, 29 Sep 2020 11:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380729; bh=Wsa4beIEYGpdtXfeQjSXG6vYREQhzVq+tgqNmQLTbOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yYILIqfPTv3hpfq7CQolJsLXLOto9PLnDEeqziBoJxpKBAOJaW2+LD1bpiJndvbVL x8yEH8ctE/XrUyX3wLl+w/gb1YvBmo5SzWHQkMXjczljQty7Qrb5/nuojYj2u0X1b/ 9M8JkDop2wSFZllK/2P+/DIeOnspqA15Ycr5+hf4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731489AbgI2L6s (ORCPT ); Tue, 29 Sep 2020 07:58:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:38460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729326AbgI2Lll (ORCPT ); Tue, 29 Sep 2020 07:41:41 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9285E2076A; Tue, 29 Sep 2020 11:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379691; bh=Wsa4beIEYGpdtXfeQjSXG6vYREQhzVq+tgqNmQLTbOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DPdTjCK7gYLFNSbqZKeQ6Egwto2/O8SlwfHKd7Y0LHbTEFH6WNKZuIJHdQSbK02eM xMAEJOKpWWbJqQ/ahOi6bJjEsRjQ4z7karONeFsk9956v4wJ2iAQEydLcrozUYK00K Mx37C6FuX0ukTzPLmqcFN0Cvv0Nhe7uz3PMCfrig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Ben Skeggs , Sasha Levin Subject: [PATCH 5.4 275/388] drm/nouveau/dispnv50: fix runtime pm imbalance on error Date: Tue, 29 Sep 2020 13:00:06 +0200 Message-Id: <20200929110023.764081753@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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);