From: Matt Porter <mporter@kernel.crashing.org>
To: song sam <samsongshzu@yahoo.com.cn>
Cc: Wolfgang Denk <wd@denx.de>, Xavier Miville <xmiville@oerlikon.ca>,
v.sudeep@exgate.tek.com, linuxppc-embedded@lists.linuxppc.org
Subject: Re: PCI daughter card with USB on a 405GP
Date: Tue, 24 Feb 2004 08:53:53 -0700 [thread overview]
Message-ID: <20040224085353.A13974@home.com> (raw)
In-Reply-To: <20040224143841.64071.qmail@web15204.mail.bjs.yahoo.com>; from samsongshzu@yahoo.com.cn on Tue, Feb 24, 2004 at 10:38:41PM +0800
On Tue, Feb 24, 2004 at 10:38:41PM +0800, song sam wrote:
>
> Hi,
>
> Wolfgang Denk wrote:
> > We tested a Adaptec AUA-200LP USB 2.0 card in some PPC sytems. It
> > worked fine when the devices were already connected at power-on or
> > at least when booting Linux, while hot-plug would reliably crash the
> > kernel. As far as I understand such behaviour is typical of some of
> > the alignment/cache bugs in the Linux kernel's USB code.
>
> I also met this USB problem on LITE_DW board when
> using USB keyboard and mouse.Has it solved or not?
I use the following hack locally to work around some of the 2.4 USB
stack DMA problems.
-Matt
===== arch/ppc/mm/cachemap.c 1.12 vs edited =====
--- 1.12/arch/ppc/mm/cachemap.c Tue Dec 10 18:09:59 2002
+++ edited/arch/ppc/mm/cachemap.c Tue Dec 12 09:43:06 2002
@@ -152,7 +152,26 @@
case PCI_DMA_NONE:
BUG();
case PCI_DMA_FROMDEVICE: /* invalidate only */
+#if (defined(CONFIG_4xx) && (defined(CONFIG_USB)) || defined(CONFIG_USB_MODULE))
+ /*
+ * USB code does DMA off the stack, so when a driver
+ * uses the stock pci DMA routines, they end up calling
+ * invalidate_dcache_range().
+ * The cache invalidate code in the 405 port invalidates
+ * an entire cache line, regardless of what addresses are
+ * passed in - it 'rounds out' to the surrounding cache line.
+ * While other ports will notice if part of the cache line
+ * is NOT part of the range being invalidated and 'do
+ * the right thing', the 405 code will invalidate the
+ * entire line, potentially trashing the stack, causing a
+ * panic.
+ * Until all the USB drivers are fixed, we flush the data
+ * buffer, a much safer operation.
+ */
+ flush_dcache_range(start, end);
+#else
invalidate_dcache_range(start, end);
+#endif
break;
case PCI_DMA_TODEVICE: /* writeback only */
clean_dcache_range(start, end);
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2004-02-24 15:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-23 16:11 PCI daughter card with USB on a 405GP v.sudeep
2004-02-23 16:29 ` Xavier Miville
2004-02-23 17:09 ` Wolfgang Denk
2004-02-24 14:38 ` song sam
2004-02-24 15:53 ` Matt Porter [this message]
2004-03-01 17:42 ` llandre
2004-03-05 10:54 ` song sam
2004-03-08 2:25 ` song sam
2004-03-08 4:15 ` Solution of USB in HOST mode on RPXLITE DW 823e board song sam
-- strict thread matches above, loose matches on Subject: below --
2004-02-23 17:01 PCI daughter card with USB on a 405GP Laurent Mohin
2004-02-26 14:05 v.sudeep
2004-02-26 15:22 Laurent Mohin
[not found] <AE20493C16DE7F46BC29B257C8D708D30130405C@mail.oerlikon.ca>
2004-02-26 16:27 ` Xavier Miville
2004-02-27 6:17 v.sudeep
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=20040224085353.A13974@home.com \
--to=mporter@kernel.crashing.org \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=samsongshzu@yahoo.com.cn \
--cc=v.sudeep@exgate.tek.com \
--cc=wd@denx.de \
--cc=xmiville@oerlikon.ca \
/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).