Path: csiph.com!goblin2!goblin.stu.neva.ru!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod From: Brian Norris Newsgroups: linux.kernel Subject: Re: [PATCH 05/14] mwifiex: re-register wiphy across reset Date: Wed, 21 Jun 2017 19:50:02 +0200 Message-ID: References: X-Original-To: Kalle Valo Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VLmvZ8NZ2byBrC7OQyoyZ2LGB2wqYF9jSuOLlo0qXaU=; b=kytFS+JA1W9/8qwYFybxqFB2ZyJJ36ugkYIs8X9phP/J1/7Cq9WQf1aBILKZ2m6flK pVXvkkRwisdvjPNH0aOjl0cym+jlyjOqV6zGpVgAVvqejx7NrsSOfjB5yGV3hlx51rDf U/sy0HSPDawm/Or3qcmvVdGuBPhBAwzlY2Acw= X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VLmvZ8NZ2byBrC7OQyoyZ2LGB2wqYF9jSuOLlo0qXaU=; b=Kq/Z32rkdvxQDGOpAxXB/q4OVjcvsoRq/wsv2PxEzxVPClFvpmSBPx9t8/s53LAwNM aOh3YuJDaIPycOYyu33CYVffNppGn2561vLnbFiTAinl/YB6NyPMmKdJRSSWLhKoNdyn 0ey5Te3EQa8Raq29+39wL/FMT5jj04x8zRriOUKPF4V+hMkUmk5LaNouMXd5qeZQaEeQ Lsoa+9Jau1nG0SsCqzPlSiZY0a1/2u1Of2S8gciXXxnaRFGlOmNVh6ZpFcVfG1ZValoD 0oMdqkJO2G+EL1dCXzMgMcGEz3XvZnyW660z/GcKj5OBrEikwVwCs5xXXeAUkws74o5h JF5g== X-Gm-Message-State: AKS2vOxSY/5ZaNjxkLy+KAI7xqAI5G4McF7GwlFDr3wGPQl8LPB3qwUH az7kN0Xu9ybNZbOD X-Received: by 10.99.106.2 with SMTP id f2mr39326825pgc.46.1498067312970; Wed, 21 Jun 2017 10:48:32 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 52 Organization: linux.* mail to news gateway X-Original-Cc: Ganapathi Bhat , Nishant Sarmukadam , linux-kernel@vger.kernel.org, Dmitry Torokhov , Amitkumar Karwar , linux-wireless@vger.kernel.org, Johannes Berg X-Original-Date: Wed, 21 Jun 2017 10:48:30 -0700 X-Original-Message-ID: <20170621174829.GA92340@google.com> X-Original-References: <20170525001119.64791-1-briannorris@chromium.org> <20170525001119.64791-5-briannorris@chromium.org> <87fufk2hmm.fsf@purkki.adurom.net> <20170601173954.GA138807@google.com> <87inka77md.fsf@codeaurora.org> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1671855 Hi Kalle (and Johannes; I'll reply to Johannes response separately too), On Mon, Jun 05, 2017 at 06:54:18PM +0300, Kalle Valo wrote: > Brian Norris writes: > > That's not to say that there aren't such bugs out there. I'd still be > > willing to bet there are. And IMO, it seems wise to just do the same > > teardown/setup as one would do for (e.g.) 'rmmod', to prevent exposing > > *too* many new permutations of "wiphy is available but rest of the > > driver is torn down". > > This feels like a sledge hammer approach causing all sort of problems Yes, it is a sledge hammer. But I'm working with what we have here. With this approach, it's also easier to tell that things aren't out-of-sync, since I'm never quite sure how much state was held in the firmware (and now won't match what user space thinks). A full removal / re-init makes this clear -- user space should expect *everything* to be reset. I'm open to learning better approaches if possible, but this also might be difficult if I don't get any support from Marvell on this. (They seem quite happy to let sleeping dogs lie.) > for user space and I really like the mac80211 approach more. For > example, if an ath10k firmware crash happens user only sees a few second > pause in data traffic and a warning in kernel log, otherwise everything > happens behind the scenes. Of course there are very likely races > somewhere but at least I haven't seen that many reports related to > firmware restart functionality. Yes, that all sounds nice. But for my sake, can you describe better what's actually going on there (e.g., can you point me at which code does this)? I'm really not familiar with mac80211 (though I was aware of the above general behavior). But to my knowledge, mac80211 drivers keep a lot more state managed in the kernel, so it's a little easier and more natural to get the driver/FW back to "the same state" than it is with a full-MAC driver. > > But if none of this is convincing to you, I can take a stab at a > > different solution. > > I don't have any problem applying this patch but more about being > curious why doing it like this. And hopefully finding a less intrusive > solution in the future. OK, sure. I'll see what I can do, but I don't see an easy path at the moment toward fixing (i.e., completely rewriting) this long-standing driver behavior. [trim] Thanks, Brian