From patchwork Sun May 24 02:08:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinghao Liu X-Patchwork-Id: 11568169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 941D31392 for ; Mon, 25 May 2020 07:21:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C65B2065F for ; Mon, 25 May 2020 07:21:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C65B2065F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AC1289CDE; Mon, 25 May 2020 07:21:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by gabe.freedesktop.org (Postfix) with ESMTP id 107566E094 for ; Sun, 24 May 2020 02:09:19 +0000 (UTC) Received: from localhost.localdomain (unknown [222.205.77.158]) by mail-app2 (Coremail) with SMTP id by_KCgDnzpEj18leS73BAQ--.41369S4; Sun, 24 May 2020 10:08:39 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Subject: [PATCH] drm/i915/selftests: Fix runtime PM imbalance on error Date: Sun, 24 May 2020 10:08:32 +0800 Message-Id: <20200524020835.7989-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: by_KCgDnzpEj18le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43ZEXa7VUbpwZ7UUUUU== X-CM-SenderInfo: qrrzjiaqtzq6lmxovvfxof0/1tbiAgEJBlZdtORShQANsN X-Mailman-Approved-At: Mon, 25 May 2020 07:21:04 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Abdiel Janulgue , Andi Shyti , dri-devel@lists.freedesktop.org, Tvrtko Ursulin , David Airlie , Mika Kuoppala , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chris Wilson , Daniele Ceraolo Spurio , Matthew Auld , Rodrigo Vivi MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When drm_dev_init() returns an error code, a pairing runtime PM usage counter decrement is needed to keep the counter balanced. For error paths after this call, things are the same. Signed-off-by: Dinghao Liu --- drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index 754d0eb6beaa..fdf01461acc6 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -200,6 +200,7 @@ struct drm_i915_private *mock_gem_device(void) drm_mode_config_cleanup(&i915->drm); drm_dev_fini(&i915->drm); put_device: + pm_runtime_put_noidle(&pdev->dev); put_device(&pdev->dev); err: return NULL;