DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	David Hunt <david.hunt@intel.com>,
	Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Subject: [PATCH 2/2] test/power_intel_uncore: skip test if init fails
Date: Thu, 15 May 2025 17:58:54 +0100	[thread overview]
Message-ID: <20250515165854.1087247-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20250515165854.1087247-1-bruce.richardson@intel.com>

If the initialization of the uncore power management fails, mark the
test as skipped rather than a failure. This prevents false failures in
the case where we are running as a normal user, who doesn't have
permissions to edit uncore power states.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/test_power_intel_uncore.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/test_power_intel_uncore.c b/app/test/test_power_intel_uncore.c
index 049658627d..973dc7a945 100644
--- a/app/test/test_power_intel_uncore.c
+++ b/app/test/test_power_intel_uncore.c
@@ -35,7 +35,7 @@ static int check_power_uncore_init(void)
 			"may occur if environment is not configured "
 			"correctly(APCI cpufreq) or operating in another valid "
 			"Power management environment\n", VALID_PKG, VALID_DIE);
-		return -1;
+		return TEST_SKIPPED;
 	}
 
 	/* Unsuccessful Test */
@@ -257,8 +257,11 @@ test_power_intel_uncore(void)
 	}
 
 	ret = check_power_uncore_init();
-	if (ret < 0)
+	if (ret != 0) {
+		if (ret == TEST_SKIPPED)
+			return TEST_SKIPPED;
 		goto fail_all;
+	}
 
 	ret = check_power_get_uncore_freq();
 	if (ret < 0)
-- 
2.48.1


      reply	other threads:[~2025-05-15 16:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 16:58 [PATCH 1/2] power/intel_uncore: fix crash closing uninitialized driver Bruce Richardson
2025-05-15 16:58 ` Bruce Richardson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250515165854.1087247-2-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=sivaprasad.tummala@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).