linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Roland Dreier <roland@topspin.com>
Cc: linuxppc-embedded@lists.linuxppc.org,
	linux-usb-devel@lists.sourceforge.net
Subject: Re: [linux-usb-devel] USB on PPC440GP (cache incoherent)
Date: Fri, 07 Jun 2002 19:54:42 -0700	[thread overview]
Message-ID: <3D0171F2.4080602@pacbell.net> (raw)
In-Reply-To: 52hekebq2a.fsf@topspin.com


Roland Dreier wrote:
> I had to make some changes to the USB driver to get this working as
> there are still some places where structures on the stack are being
> used for DMA.

Good to have that -- there have periodically been passes made through
drivers to fix such problems, evidently at least 2.4 didn't catch all
of them.  Corresponding changes should get into 2.5 kernels too.


> Note that this might not work perfectly on all cache-incoherent
> processors, since kmalloc could potentially allocate a chunk of memory
> that is smaller than the processor's cache line size.  However it is
> safe on the 440GP since the 440GP's cache line size is 32 bytes.

Could you elaborate?  Documentation/DMA-mapping.txt says that kmalloc
returns data suitable for DMA, you are saying otherwise.  The DMA
mapping calls are supposed to handle cache flushing as needed.  If
they don't, a lot of code will be breaking ...


>  struct usb_hub {
>  	struct usb_device *dev;
>
>  	struct urb *urb;		/* Interrupt polling pipe */
>
> -	char buffer[(USB_MAXCHILDREN + 1 + 7) / 8]; /* add 1 bit for hub status change */
> -					/* and add 7 bits to round up to byte boundary */
> +        char *buffer;
>  	int error;
>  	int nerrors;

This hub.h change (and its follow-ons) should not be necessary since the
struct usb_hub is already allocated using kmalloc() in hub_probe(), and
so it's DMA-ready.  (Modulo the spec issue noted above for DMA-mapping.txt
of course!)

- Dave


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-06-08  2:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-07 23:57 USB on PPC440GP (cache incoherent) Roland Dreier
2002-06-08  2:54 ` David Brownell [this message]
2002-06-08  3:43   ` [linux-usb-devel] " Roland Dreier
2002-06-08  5:18     ` David Brownell
2002-06-08  8:47 ` Oliver Neukum
2002-06-08 20:43   ` Roland Dreier

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=3D0171F2.4080602@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=roland@topspin.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).