From patchwork Tue Jan 17 12:32:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13104596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0FB97C3DA78 for ; Tue, 17 Jan 2023 12:32:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A35F510E538; Tue, 17 Jan 2023 12:32:44 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD18C10E543; Tue, 17 Jan 2023 12:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673958762; x=1705494762; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MeMXKj5o+Ike3f9M4ooda+PrHav/S+5sUnjX4zwSNj4=; b=SO5JHfdvLU3h4k3nSytbZmhjBOhWh4DzYFNhIYwkH2wxDNv/YwbQChqU nUpKTuo8sAaLrTW+/lbwQdjwybmZHvpzaZlUdbBRolH5I0+AuCduMYzmx 5A7UN8D8q7tCFjqRd/3c8lFTpuG3yghel+vWGaIrhp8YUrhI6ZzWRAAWB TsC2NCz0wSBN/F9lUsxqMVWLIIxGRzmEPbxWwLmv6wP7qAs7+9qIgIgZi iLfWrqhiumDF1Q1ZOg4akLxI3u2zTDCZM2aOdKq1KIBocv398Cy7cosTk 3PQfv6tnb/3UDpi0hrNwZPZhQz/iYfq3CyDJj1Y2o0ny6OAPW2LfX3Xqu g==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="387034033" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="387034033" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 04:32:42 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="636856858" X-IronPort-AV: E=Sophos;i="5.97,222,1669104000"; d="scan'208";a="636856858" Received: from nirmoyda-desk.igk.intel.com ([10.102.42.231]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 04:32:38 -0800 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2] drm/i915/selftests: Unwind hugepages to drop wakeref on error Date: Tue, 17 Jan 2023 13:32:34 +0100 Message-Id: <20230117123234.26487-1-nirmoy.das@intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 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: Andi Shyti , dri-devel@lists.freedesktop.org, Matthew Auld , Andrzej Hajda , chris.p.wilson@linux.intel.com, Nirmoy Das Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Chris Wilson Make sure that upon error after we have acquired the wakeref we do release it again. v2: add another missing "goto out_wf"(Andi). Fixes: 027c38b4121e ("drm/i915/selftests: Grab the runtime pm in shrink_thp") Cc: Andi Shyti Reviewed-by: Matthew Auld Reviewed-by: Andrzej Hajda Signed-off-by: Chris Wilson Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c index c281b0ec9e05..defece0bcb81 100644 --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c @@ -1855,7 +1855,7 @@ static int igt_shrink_thp(void *arg) I915_SHRINK_ACTIVE); i915_vma_unpin(vma); if (err) - goto out_put; + goto out_wf; /* * Now that the pages are *unpinned* shrinking should invoke @@ -1871,19 +1871,19 @@ static int igt_shrink_thp(void *arg) pr_err("unexpected pages mismatch, should_swap=%s\n", str_yes_no(should_swap)); err = -EINVAL; - goto out_put; + goto out_wf; } if (should_swap == (obj->mm.page_sizes.sg || obj->mm.page_sizes.phys)) { pr_err("unexpected residual page-size bits, should_swap=%s\n", str_yes_no(should_swap)); err = -EINVAL; - goto out_put; + goto out_wf; } err = i915_vma_pin(vma, 0, 0, flags); if (err) - goto out_put; + goto out_wf; while (n--) { err = cpu_check(obj, n, 0xdeadbeaf);