From owner-freebsd-wireless@FreeBSD.ORG Sat Dec 20 19:41:45 2014 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD7F5DCC; Sat, 20 Dec 2014 19:41:45 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ACDC2CE0; Sat, 20 Dec 2014 19:41:45 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id ex7so4815054wid.15; Sat, 20 Dec 2014 11:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=6d8DOUMqpgSFFAh5vZiTOnuphFQ1qFXT6bOK5p9FtPU=; b=YfhfEE+9S4XyukXz7e1RGaDUpBh8RhDaG182BRrQL9MGs2gLaKz9EmB1rhy6VS8mPi +qK6pcqJM4Mh5iBQ7XWX9SlV8R4gb6s8WhQzEi7nA7YVJh+4aB5Kv4SxBGWxIljpLK9J 45ZCGs4PyQlZoFCd/wvS5gzlLa5BzECoWDCcWhrA3h1Yx6v1TFO6Ac9Aj6s3kEQL9jKR eg4FuQ6CEOgNt4IHbiuUaCdhNa+PBh+5kp2G/Dj02++hq2HREd21R7Bht7IZ1vbduz3s CHCSE9g4/GvgJjoTxcnr5lopWuPLP+nrAFKLbLj0m5aa0SMI7hCB9tw7BQCDDuXiZwvS vURw== MIME-Version: 1.0 X-Received: by 10.180.91.193 with SMTP id cg1mr17078248wib.26.1419104503667; Sat, 20 Dec 2014 11:41:43 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.195 with HTTP; Sat, 20 Dec 2014 11:41:43 -0800 (PST) In-Reply-To: <20141220105506.GA3170@unixarea.DDR.dd> References: <20141102152953.GA20263@unixarea.DDR.dd> <54564E4D.4020703@freebsd.org> <20141103054633.GA3258@unixarea.DDR.dd> <20141103095530.GA42402@unixarea.DDR.dd> <20141123163811.GA5739@unixarea.DDR.dd> <20141219075339.GA1748@unixarea.DDR.dd> <20141220105506.GA3170@unixarea.DDR.dd> Date: Sat, 20 Dec 2014 11:41:43 -0800 X-Google-Sender-Auth: Rd9KwHB_pCEd2e97fTp3ILID17Q Message-ID: Subject: Re: Issues with urtwn From: Adrian Chadd To: Matthias Apitz Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-wireless@freebsd.org" , Nathan Whitehorn X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2014 19:41:45 -0000 It's a race condition in the scan handling. :( When scan is cancelled (eg because something cancels it, or the state transitions to IDLE or something because the VAP resets) then it should be setting a flag to cancel things and the VAP should come out of powerstate. However, there seems to be some conditions where the scan is coming out of that loop because it's been aborted/stopped, so it's not complete - but then it stays in powersave mode because whatever's supposed to either change it (eg a state change, a received becaon, TIM coming in, etc) doesn't follow. So it stays in power save. The driver routines are called without the comlock held, so that's a small, narrow window for some state change to come through that doesn't trigger the scan code to see the scan is canceled and "finish" the scan (which would reset the vap powersave state.) I've added another cancel check in scan_task(). Please update this and see what happens! -adrian