From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
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 10:58:54 +1100 [thread overview]
Message-ID: <1301356734.2402.657.camel@pasglop> (raw)
In-Reply-To: <20110328223424.GF8065@xanatos>
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.
Cheers,
Ben.
next prev parent reply other threads:[~2011-03-28 23:58 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 [this message]
2011-03-29 18:34 ` Sarah Sharp
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=1301356734.2402.657.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=matt@ozlabs.org \
--cc=sarah.a.sharp@linux.intel.com \
--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).