From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, linux-usb@vger.kernel.org,
Sergei Shtylyov <sshtylyov@mvista.com>,
Matt Evans <matt@ozlabs.org>
Subject: Re: [PATCH v2 5/5] xhci: Remove recursive call to xhci_handle_event
Date: Tue, 29 Mar 2011 11:34:34 -0700 [thread overview]
Message-ID: <20110329183434.GA5720@xanatos> (raw)
In-Reply-To: <1301356734.2402.657.camel@pasglop>
On Tue, Mar 29, 2011 at 10:58:54AM +1100, Benjamin Herrenschmidt wrote:
> On Mon, 2011-03-28 at 15:34 -0700, Sarah Sharp wrote:
> >
> > What I'd like to do is take out the read of the status register out of
> > the interrupt handler (which is killing performance), and make it only
> > check the status register when xhci_handle_event() returns a negative
> > error status. If the status register shows the host controller has a
> > critical error, the driver should call usb_hcd_died().
>
> Be careful with removing that read...
>
> Without MSIs, that read is what guarantees that all pending DMA writes
> by the xHCI have been "flushed" before you start poking at memory.
>
> IE. If the chip writes an event and sends an LSI, without that read, you
> might get the interrupt before the writes to memory have completed and
> your driver will "miss" the event.
>
> With MSIs (provided they are not broken on your PCI host bridge of
> course, this is typically the #1 cause of MSI breakage), you don't need
> that as the MSI itself is a DMA store by the device which is ordered
> after the stores done to update the event. So by the time you get the
> MSI interrupt, you -should- have all the updates visible in memory.
>
> But that means that your PCI host bridge is doing the right thing, by
> ensuring whatever queues to the coherency domain it has have been
> properly flushed before it signals the interrupts caused by the MSI to
> the processors. Hopefully most systems get that right nowadays.
>
> Point is: you need to keep that read if MSIs aren't enabled.
Sorry for the sloppy language, yes, I understand I still need the status
register read if only legacy IRQs are enabled.
Sarah Sharp
next prev parent reply other threads:[~2011-03-29 18:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 7:44 [PATCH 5/5] xhci: Remove recursive call to xhci_handle_event Matt Evans
2011-03-25 12:48 ` Sergei Shtylyov
2011-03-28 4:53 ` [PATCH v2 " Matt Evans
2011-03-28 22:34 ` Sarah Sharp
2011-03-28 23:58 ` Benjamin Herrenschmidt
2011-03-29 18:34 ` Sarah Sharp [this message]
2011-03-29 20:00 ` Dmitry Torokhov
2011-03-30 7:51 ` David Laight
2011-03-30 23:10 ` Matt Evans
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=20110329183434.GA5720@xanatos \
--to=sarah.a.sharp@linux.intel.com \
--cc=benh@kernel.crashing.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=matt@ozlabs.org \
--cc=sshtylyov@mvista.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).