Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1560969
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Brian Norris <briannorris@chromium.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/3] mwifiex: pcie: don't loop/retry interrupt status checks |
| Date | Tue, 17 Jan 2017 21:00:01 +0100 |
| Message-ID | <t0I5b-2Md-9@gated-at.bofh.it> (permalink) |
| References | <sZjBU-74g-13@gated-at.bofh.it> <sZjBU-74g-19@gated-at.bofh.it> <t03Oq-19i-5@gated-at.bofh.it> |
| 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=zIY6TCAdf53lIEXiwKff38YlbSboXRg1zUj7i6UQI/U=; b=E4OLJN4p39y/4FzIzJDSBAtnb4G9SLG3tpozZ11UQsJZQa1Rpg08GqWPM3OEKgKLRv 2fw0HO8p9osK/2wAywTMqWXc+PaplOSTEbuOGUnWp49JzrvxUmpuAMyFVvGvssTWTfD3 fbl+spsiUddARZwgwL9rWN2rk7fom1wMIe0uA= |
| 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=zIY6TCAdf53lIEXiwKff38YlbSboXRg1zUj7i6UQI/U=; b=cCKO2q6541/HG5zB4vosCTxJYmEXWZ/B9drMOZBjVsnuV5UKn2T0Tx6v0L5N7XqFYU hjFX/alG+udS7L/SNu+NBnG/mlitynnYEZNYmzRylAWiNe3tA+XkYzmFUwpqlkbobezS PvraAoyn2LUlipcYf9/ze2/jJf1KproBEUK0ibplZBCXqTGck7lJXfmzmPsecOwLcQzL XBLZLCxsbsGpzqQsqcMqQZDoY1lsqobjORzRrJxm14VNUrNPIt6fshXbc8gHRvpUcLgZ RfTMcq6Om8qEFPcH2APYbksVxXHTFtWD3GZBc6ecdJqJ04432hg2Li9hSw0E6qiDJ0iM o/pg== |
| X-Gm-Message-State | AIkVDXIbX+cxmes3F0tu4I7BR2H8jBxoKNBvEj8WrfHWNjUKD2rKi4yAnOY5SMXY/mwLyZaF |
| X-Received | by 10.98.94.129 with SMTP id s123mr44921710pfb.37.1484682505432; Tue, 17 Jan 2017 11:48:25 -0800 (PST) |
| 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 | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 65 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Amitkumar Karwar <akarwar@marvell.com>, Nishant Sarmukadam <nishants@marvell.com>, linux-kernel@vger.kernel.org, Kalle Valo <kvalo@codeaurora.org>, linux-wireless@vger.kernel.org, Cathy Luo <cluo@marvell.com> |
| X-Original-Date | Tue, 17 Jan 2017 11:48:22 -0800 |
| X-Original-Message-ID | <20170117194822.GA29749@google.com> |
| X-Original-References | <20170113233538.36196-1-briannorris@chromium.org> <20170113233538.36196-2-briannorris@chromium.org> <20170116005452.GI23285@dtor-ws> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1560969 |
Show key headers only | View raw
On Sun, Jan 15, 2017 at 04:54:52PM -0800, Dmitry Torokhov wrote:
> On Fri, Jan 13, 2017 at 03:35:37PM -0800, Brian Norris wrote:
> > The following sequence occurs when using IEEE power-save on 8997:
> > (a) driver sees SLEEP event
> > (b) driver issues SLEEP CONFIRM
> > (c) driver recevies CMD interrupt; within the interrupt processing loop,
> > we do (d) and (e):
> > (d) wait for FW sleep cookie (and often time out; it takes a while), FW
> > is putting card into low power mode
> > (e) re-check PCIE_HOST_INT_STATUS register; quit loop with 0 value
> >
> > But at (e), no one actually signaled an interrupt (i.e., we didn't check
> > adapter->int_status). And what's more, because the card is going to
> > sleep, this register read appears to take a very long time in some cases
> > -- 3 milliseconds in my case!
> >
> > Now, I propose that (e) is completely unnecessary. If there were any
> > additional interrupts signaled after the start of this loop, then the
> > interrupt handler would have set adapter->int_status to non-zero and
> > queued more work for the main loop -- and we'd catch it on the next
> > iteration of the main loop.
> >
> > So this patch drops all the looping/re-reading of PCIE_HOST_INT_STATUS,
> > which avoids the problematic (and slow) register read in step (e).
> >
> > Incidentally, this is a very similar issue to the one fixed in commit
> > ec815dd2a5f1 ("mwifiex: prevent register accesses after host is
> > sleeping"), except that the register read is just very slow instead of
> > fatal in this case.
> >
> > Tested on 8997 in both MSI and (though not technically supported at the
> > moment) MSI-X mode.
>
> Well, that kills interrupt mitigation and with PCIE that might be
> somewhat important (SDIO is too slow to be important I think) and might
> cost you throughput.
Hmm, well I don't see us disabling interrupts in here, at least for MSI
mode, so it doesn't actually look like a mitigation mechanism. More like
a redundancy. But I'm not an expert on MSI, and definitely not on
network performance.
Also, FWIW, I did some fairly non-scientific tests of this on my
systems, and I didn't see much difference. I can run better tests, and
even collect data on how often we loop here vs. see new interrupts.
> OTOH maybe Marvell should convert PICE to NAPI to make this more
> obvious and probably more correct.
From my brief reading, that sounds like a better way to make this
configurable.
So I'm not sure which way you'd suggest then; take a patch like this,
which makes the driver more clear and less buggy? Or write some
different patch that isolates just the power-save related condition, so
we break out of this look [1]?
I'm also interested in any opinions from the Marvell side -- potentially
testing results, rationale behind this code structure, or even a better
alternative patch.
Brian
[1] i.e., along the lines of commit ec815dd2a5f1 ("mwifiex: prevent
register accesses after host is sleeping").
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH v2 2/3] mwifiex: pcie: don't loop/retry interrupt status checks Brian Norris <briannorris@chromium.org> - 2017-01-17 21:00 +0100
Re: [PATCH v2 2/3] mwifiex: pcie: don't loop/retry interrupt status checks Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-01-17 21:50 +0100
Re: [PATCH v2 2/3] mwifiex: pcie: don't loop/retry interrupt status checks Brian Norris <briannorris@chromium.org> - 2017-01-18 03:20 +0100
RE: Re: [PATCH v2 2/3] mwifiex: pcie: don't loop/retry interrupt status checks Amitkumar Karwar <akarwar@marvell.com> - 2017-01-18 14:30 +0100
csiph-web