All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 4/4] station: fix improper state transition
Date: Tue, 26 Jan 2021 09:46:57 -0800	[thread overview]
Message-ID: <20210126174657.867692-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20210126174657.867692-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]

At some point the non-interactive client tests began failing.
This was due to a bug in station where it would transition from
'connected' to 'autoconnect' due to a failed scan request. The
scan request was started prior to the connection, but the work
queue delayed it and tries triggering it after we are connected.
The kernel gives back an error, which results in station
transitioning to autoconnect_full because the triggered callback
(station_quick_scan_triggered) assumed station was in a non
connected state. The sequence can be seen here:

src/station.c:station_connect_cb() 13, result: 0
src/station.c:station_enter_state() Old State: connecting, new state: connected
src/wiphy.c:wiphy_radio_work_done() Work item 6 done
src/wiphy.c:wiphy_radio_work_next() Starting work item 5
src/station.c:station_quick_scan_triggered() Quick scan trigger failed: -95
src/station.c:station_enter_state() Old State: connected, new state: autoconnect_full
---
 src/station.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/station.c b/src/station.c
index b600f37e..e7f78f2b 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1113,6 +1113,9 @@ static void station_quick_scan_triggered(int err, void *user_data)
 	if (err < 0) {
 		l_debug("Quick scan trigger failed: %i", err);
 
+		if (station_is_busy(station))
+			return;
+
 		station_enter_state(station, STATION_STATE_AUTOCONNECT_FULL);
 
 		return;
-- 
2.26.2

  parent reply	other threads:[~2021-01-26 17:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 17:46 [PATCH 1/4] test-runner: fix verbose arguments as single string James Prestwood
2021-01-26 17:46 ` [PATCH 2/4] test-runner: don't always print "verbose on for ..." James Prestwood
2021-01-26 17:46 ` [PATCH 3/4] test-runner: fix logging, verbose, and process output James Prestwood
2021-01-26 17:46 ` James Prestwood [this message]
2021-01-26 19:42 ` [PATCH 1/4] test-runner: fix verbose arguments as single string Denis Kenzior

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=20210126174657.867692-4-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /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.