From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8062589A44 for ; Mon, 25 Oct 2021 09:22:34 +0000 (UTC) From: Anshuman Gupta Date: Mon, 25 Oct 2021 14:53:05 +0530 Message-Id: <20211025092305.14742-3-anshuman.gupta@intel.com> In-Reply-To: <20211025092305.14742-1-anshuman.gupta@intel.com> References: <20211025092305.14742-1-anshuman.gupta@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t 2/2] perf/perf_pmu: Nuke unload_i915 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org Cc: chris.p.wilson@intel.com, badal.nilawar@intel.com, Anshuman Gupta List-ID: Nuke unload_i915, instead use lib igt_i915_driver_unload() and __igt_i915_driver_unload(). Cc: Chris Wilson Signed-off-by: Anshuman Gupta --- tests/i915/perf_pmu.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c index 581da8483..9106f7193 100644 --- a/tests/i915/perf_pmu.c +++ b/tests/i915/perf_pmu.c @@ -2039,31 +2039,6 @@ static void faulting_read(int gem_fd, const struct mmap_offset *t) munmap(ptr, 4096); } -static int unload_i915(void) -{ - bind_fbcon(false); - - if (igt_kmod_is_loaded("snd_hda_intel")) { - igt_terminate_process(SIGTERM, "alsactl"); - kick_snd_hda_intel(); - if (igt_kmod_unload("snd_hda_intel", 0)) - return -EAGAIN; - } - - if (igt_kmod_is_loaded("snd_hdmi_lpe_audio")) { - igt_terminate_process(SIGTERM, "alsactl"); - if (igt_kmod_unload("snd_hdmi_lpe_audio", 0)) - return -EAGAIN; - } - - if (igt_kmod_is_loaded("i915")) { - if (igt_kmod_unload("i915", 0)) - return -EBUSY; - } - - return 0; -} - static void test_unload(unsigned int num_engines) { igt_fork(child, 1) { @@ -2126,7 +2101,7 @@ static void test_unload(unsigned int num_engines) igt_debug("Read %d events from perf and trial unload\n", count); pmu_read_multi(fd[0], count, buf); - igt_assert_eq(unload_i915(), -EBUSY); + igt_assert_eq(__igt_i915_driver_unload(NULL), IGT_EXIT_SKIP); pmu_read_multi(fd[0], count, buf); igt_debug("Close perf\n"); @@ -2139,7 +2114,7 @@ static void test_unload(unsigned int num_engines) igt_waitchildren(); igt_debug("Final unload\n"); - igt_assert_eq(unload_i915(), 0); + igt_assert_eq(__igt_i915_driver_unload(NULL), IGT_EXIT_SUCCESS); } #define test_each_engine(T, i915, ctx, e) \ @@ -2419,7 +2394,7 @@ igt_main } igt_subtest("module-unload") { - igt_require(unload_i915() == 0); + igt_require(igt_i915_driver_unload() == IGT_EXIT_SUCCESS); for (int pass = 0; pass < 3; pass++) test_unload(num_engines); } -- 2.26.2