intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 7/7] tests/chamelium: Disconnect connectors without extra reset
Date: Tue, 27 Jun 2017 10:22:55 +0300	[thread overview]
Message-ID: <1498548175.1405.1.camel@linux.intel.com> (raw)
In-Reply-To: <1498515436.4147.11.camel@redhat.com>

Hey,

On Mon, 2017-06-26 at 18:17 -0400, Lyude Paul wrote:
> On Mon, 2017-06-26 at 16:59 +0300, Paul Kocialkowski wrote:
> > This removes the reset call from the reset_state function and renames
> > it
> > to disconnect_connector. Since a call to reset is already done in
> > chamelium_init, there is no need to do an extra reset in each test.
> > 
> > This allows reducing the execution time a bit.
> > 
> > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
> 
> NAK
> It's annoying that we have to reset the connectors so much, but
> unfortunately there is a reason in this case. The problem is that
> chamelium_init() does not get called once per test. At first glance
> when running through ./scripts/run_tests.sh this might appear to be the
> case, however if you run the test by manually calling the built
> chamelium binary (generally useful for debugging the tests themselves
> with gdb) it won't actually get called in-between tests.

I am well aware of that situation and made sure that it works correctly in that
case too. Disconnecting the connector is really all that should be needed, and
resetting the whole chamelium seems overkill.

There was one occurence where not fully resetting caused an issue when running
the whole test binary on i915 (when switching from poll-based detection to irq
after hpd storm testing), which was definitely a kernel bug. I submitted a patch
to fix it already.

So this can even help discover new kernel bugs!

> This being said, I'm all for getting rid of a couple extraneous hotplug
> resets if possible, but I'd prefer to avoid breaking the ability to run
> the chamelium test binary manually.

Yeah, the real problem was that when running tests standalone, two resets are
done in a row. So worst case, we could ditch the reset at init and make sure
each test calls it.

Thanks for the review!

> > ---
> >  tests/chamelium.c | 22 +++++++++++-----------
> >  1 file changed, 11 insertions(+), 11 deletions(-)
> > 
> > diff --git a/tests/chamelium.c b/tests/chamelium.c
> > index 01ae4cd7..7d6893da 100644
> > --- a/tests/chamelium.c
> > +++ b/tests/chamelium.c
> > @@ -144,17 +144,17 @@ wait_for_connector(data_t *data, struct
> > chamelium_port *port,
> >  }
> >  
> >  static void
> > -reset_state(data_t *data, struct chamelium_port *port)
> > +disconnect_connector(data_t *data, struct chamelium_port *port)
> >  {
> >  	int p;
> >  
> > -	chamelium_reset(data->chamelium);
> > -
> >  	if (port) {
> > +		chamelium_unplug(data->chamelium, port);
> >  		wait_for_connector(data, port,
> > DRM_MODE_DISCONNECTED, false);
> >  	} else {
> >  		for (p = 0; p < data->port_count; p++) {
> >  			port = data->ports[p];
> > +			chamelium_unplug(data->chamelium, port);
> >  			wait_for_connector(data, port,
> > DRM_MODE_DISCONNECTED,
> >  					   false);
> >  		}
> > @@ -167,7 +167,7 @@ test_basic_hotplug(data_t *data, struct
> > chamelium_port *port, int toggle_count)
> >  	struct udev_monitor *mon = igt_watch_hotplug();
> >  	int i;
> >  
> > -	reset_state(data, NULL);
> > +	disconnect_connector(data, NULL);
> >  	igt_hpd_storm_set_threshold(data->drm_fd, 0);
> >  
> >  	for (i = 0; i < toggle_count; i++) {
> > @@ -201,7 +201,7 @@ test_edid_read(data_t *data, struct
> > chamelium_port *port,
> >  	    data->chamelium, port, false);
> >  	uint64_t edid_blob_id;
> >  
> > -	reset_state(data, port);
> > +	disconnect_connector(data, port);
> >  
> >  	chamelium_port_set_edid(data->chamelium, port, edid_id);
> >  	chamelium_plug(data->chamelium, port);
> > @@ -270,7 +270,7 @@ test_suspend_resume_hpd(data_t *data, struct
> > chamelium_port *port,
> >  {
> >  	struct udev_monitor *mon = igt_watch_hotplug();
> >  
> > -	reset_state(data, port);
> > +	disconnect_connector(data, port);
> >  
> >  	/* Make sure we notice new connectors after resuming */
> >  	try_suspend_resume_hpd(data, port, state, test, mon, false);
> > @@ -294,7 +294,7 @@ test_suspend_resume_hpd_common(data_t *data, enum
> > igt_suspend_state state,
> >  		igt_debug("Testing port %s\n",
> > chamelium_port_get_name(port));
> >  	}
> >  
> > -	reset_state(data, NULL);
> > +	disconnect_connector(data, NULL);
> >  
> >  	/* Make sure we notice new connectors after resuming */
> >  	try_suspend_resume_hpd(data, NULL, state, test, mon, false);
> > @@ -315,7 +315,7 @@ test_suspend_resume_edid_change(data_t *data,
> > struct chamelium_port *port,
> >  	struct udev_monitor *mon = igt_watch_hotplug();
> >  	int delay = chamelium_get_suspend_resume_delay(data-
> > > chamelium);
> > 
> >  
> > -	reset_state(data, port);
> > +	disconnect_connector(data, port);
> >  
> >  	igt_set_autoresume_delay(delay);
> >  
> > @@ -585,7 +585,7 @@ test_hpd_without_ddc(data_t *data, struct
> > chamelium_port *port)
> >  {
> >  	struct udev_monitor *mon = igt_watch_hotplug();
> >  
> > -	reset_state(data, port);
> > +	disconnect_connector(data, port);
> >  	igt_flush_hotplugs(mon);
> >  
> >  	/* Disable the DDC on the connector and make sure we still
> > get a
> > @@ -607,7 +607,7 @@ test_hpd_storm_detect(data_t *data, struct
> > chamelium_port *port, int width)
> >  	int count = 0;
> >  
> >  	igt_require_hpd_storm_ctl(data->drm_fd);
> > -	reset_state(data, port);
> > +	disconnect_connector(data, port);
> >  
> >  	igt_hpd_storm_set_threshold(data->drm_fd, 1);
> >  	chamelium_fire_hpd_pulses(data->chamelium, port, width, 10);
> > @@ -632,7 +632,7 @@ static void
> >  test_hpd_storm_disable(data_t *data, struct chamelium_port *port,
> > int width)
> >  {
> >  	igt_require_hpd_storm_ctl(data->drm_fd);
> > -	reset_state(data, port);
> > +	disconnect_connector(data, port);
> >  
> >  	igt_hpd_storm_set_threshold(data->drm_fd, 0);
> >  	chamelium_fire_hpd_pulses(data->chamelium, port,
-- 
Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2017-06-27  7:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 13:59 [PATCH i-g-t 1/7] tests/chamelium: Update connector state without reprobe when possible Paul Kocialkowski
2017-06-26 13:59 ` [PATCH i-g-t 2/7] tests/chamelium: Check all connectors state for basic hotplug Paul Kocialkowski
2017-06-26 21:35   ` Lyude Paul
2017-06-26 13:59 ` [PATCH i-g-t 3/7] tests/chamelium: Use 50 ms delay to wait for connector change Paul Kocialkowski
2017-06-26 21:36   ` Lyude Paul
2017-06-26 13:59 ` [PATCH i-g-t 4/7] lib/igt_chamelium: Add support for configurable DUT suspend/resume delay Paul Kocialkowski
2017-06-26 14:25   ` Martin Peres
2017-06-26 14:33     ` Paul Kocialkowski
2017-06-26 15:15       ` Martin Peres
2017-06-26 21:14         ` Lyude Paul
2017-06-27  7:33         ` Paul Kocialkowski
2017-06-27  7:45           ` Paul Kocialkowski
2017-06-27 10:16             ` Paul Kocialkowski
2017-06-26 13:59 ` [PATCH i-g-t 5/7] tests/chamelium: Use " Paul Kocialkowski
2017-06-26 13:59 ` [PATCH i-g-t 6/7] tests/chamelium: Reduce the simple hotplug test toggle count for VGA Paul Kocialkowski
2017-06-26 13:59 ` [PATCH i-g-t 7/7] tests/chamelium: Disconnect connectors without extra reset Paul Kocialkowski
2017-06-26 22:17   ` Lyude Paul
2017-06-27  7:22     ` Paul Kocialkowski [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=1498548175.1405.1.camel@linux.intel.com \
    --to=paul.kocialkowski@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lyude@redhat.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).