netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Christian Eggers" <ceggers@gmx.de>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH] usb/mcs7830: Don't use buffers from stack for USB transfers
Date: Tue, 20 Jan 2009 23:50:21 +0100	[thread overview]
Message-ID: <200901202350.23231.oliver@neukum.org> (raw)
In-Reply-To: <200901202345.47792.arnd@arndb.de>

Am Tuesday 20 January 2009 23:45:47 schrieb Arnd Bergmann:
> Have you observed problems with this, or just suspected trouble?
> 
> When I wrote this code, I looked at other code doing the same
> and assumed it was ok, because usb_control_msg waits for the
> DMA to complete before returning.
> 
> Is the problem only on systems that have noncoherent DMA, or
> something else?

That's not enough. Tasks can leave pointers to variables on the
stack to other tasks. You must under no circumstances do DMA
on the stack if the driver may run on system that have noncoherent
DMA.

	Regards
		Oliver

      parent reply	other threads:[~2009-01-20 22:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-20 20:29 [PATCH] usb/mcs7830: Don't use buffers from stack for USB transfers Christian Eggers
2009-01-20 20:32 ` David Miller
2009-01-20 22:45 ` Arnd Bergmann
2009-01-20 22:47   ` David Miller
2009-01-20 23:17     ` Arnd Bergmann
2009-01-20 23:23       ` David Miller
2009-01-20 23:36         ` Oliver Neukum
2009-01-20 23:37         ` Arnd Bergmann
2009-01-20 23:39           ` David Miller
2009-01-20 23:28       ` Oliver Neukum
2009-01-20 22:50   ` Oliver Neukum [this message]

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=200901202350.23231.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=arnd@arndb.de \
    --cc=ceggers@gmx.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).