All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: Lyude <lyude@redhat.com>, Petri Latvala <petri.latvala@intel.com>,
	Paul Kocialkowski <paul.kocialkowski@linux.intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Subject: [PATCH i-g-t 2/2] tests/chamelium: Catch and flush hotplug uevents after each plug
Date: Tue, 18 Jul 2017 18:16:27 +0300	[thread overview]
Message-ID: <20170718151627.29641-3-paul.kocialkowski@linux.intel.com> (raw)
In-Reply-To: <20170718151627.29641-1-paul.kocialkowski@linux.intel.com>

This adds calls to igt_hotplug_detected and igt_flush_hotplugs to catch
and flush hotplugs from connector unplug (due to chamelium reset) and
plug. These need to be intercepted so that they are not delayed and
issued after resume, providing a false positive for the test result.

In addition, the final hotplug uevent flush is brought closer to the
suspend call, to decrease the likeliness of false positive.

However, false positives still do happen, because it is not possible to
make sure that the uevent caused by each connector's state change was
caught instead of being delayed and issued at resume time.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
---
 tests/chamelium.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/chamelium.c b/tests/chamelium.c
index 8af33aaa..0528ffb3 100644
--- a/tests/chamelium.c
+++ b/tests/chamelium.c
@@ -340,12 +340,16 @@ test_suspend_resume_edid_change(data_t *data, struct chamelium_port *port,
 
 	reset_state(data, port);
 
+	/* Catch the event and flush all remaining ones. */
+	igt_assert(igt_hotplug_detected(mon, HOTPLUG_TIMEOUT));
+	igt_flush_hotplugs(mon);
+
 	/* First plug in the port */
 	chamelium_port_set_edid(data->chamelium, port, edid_id);
 	chamelium_plug(data->chamelium, port);
-	wait_for_connector(data, port, DRM_MODE_CONNECTED);
+	igt_assert(igt_hotplug_detected(mon, HOTPLUG_TIMEOUT));
 
-	igt_flush_hotplugs(mon);
+	wait_for_connector(data, port, DRM_MODE_CONNECTED);
 
 	/*
 	 * Change the edid before we suspend. On resume, the machine should
@@ -355,6 +359,8 @@ test_suspend_resume_edid_change(data_t *data, struct chamelium_port *port,
 
 	get_connectors_link_status_failed(data, link_status_failed[0]);
 
+	igt_flush_hotplugs(mon);
+
 	igt_system_suspend_autoresume(state, test);
 
 	igt_assert(igt_hotplug_detected(mon, HOTPLUG_TIMEOUT));
-- 
2.13.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-07-18 15:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 15:16 [PATCH i-g-t 0/2] Unrelated hotplug uevent masking out actual test result Paul Kocialkowski
2017-07-18 15:16 ` [PATCH i-g-t 1/2] tests/chamelium: Skip suspend/resume test with unreliable hotplug event Paul Kocialkowski
2017-07-18 21:21   ` Chris Wilson
2017-07-19  8:31     ` Paul Kocialkowski
2017-07-19 15:47       ` Lyude Paul
2017-07-18 15:16 ` Paul Kocialkowski [this message]
2017-07-18 20:12 ` [Intel-gfx] [PATCH i-g-t 0/2] Unrelated hotplug uevent masking out actual test result Lyude Paul

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=20170718151627.29641-3-paul.kocialkowski@linux.intel.com \
    --to=paul.kocialkowski@linux.intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    --cc=petri.latvala@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.