From: Pavel Machek <pavel@ucw.cz>
To: Oliver Neukum <oneukum@suse.de>
Cc: Lauri Kasanen <cand@gmx.com>,
jkosina@suse.cz, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, ao2@ao2.it, AndrewD207@aol.com
Subject: Re: [PATCH] HID: sony: Enable Gasia third-party PS3 controllers
Date: Mon, 16 Mar 2015 22:10:56 +0100 [thread overview]
Message-ID: <20150316211056.GB11441@amd> (raw)
In-Reply-To: <1423556076.19839.3.camel@linux-0dmf.site>
On Tue 2015-02-10 09:14:36, Oliver Neukum wrote:
> On Mon, 2015-02-09 at 20:44 +0200, Lauri Kasanen wrote:
> > On Mon, 09 Feb 2015 11:08:01 +0100
> > Oliver Neukum <oneukum@suse.de> wrote:
> >
> > > > + ret = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x02),
> > > > + buf2, sizeof(buf2),
> > > > + &transfered, USB_CTRL_SET_TIMEOUT);
> > >
> > > You cannot do this. Even for a single byte DMA on the stack is
> > > wrong. Not on all architectures it works at all and you violate
> > > the DMA constrainsts. You must use kmalloc().
> >
> > Hi Oliver,
> >
> > Does this still apply when using hid_hw_output_report?
>
> Yes. For USB devices hid_hw_output_report() goes to
> usbhid_output_report(). That goes to usb_interrupt_msg(),
> which passes the buffer pointer. It will then be mapped
> for DMA. You must not do that on the stack.
Should we have some kind of runtime test for this ...? Because this is
very very easy to get wrong... and I bet we do get it wrong at > 1
place...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2015-03-16 21:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-07 13:48 [PATCH] HID: sony: Enable Gasia third-party PS3 controllers Lauri Kasanen
2015-02-07 15:56 ` Benjamin Tissoires
2015-02-07 16:31 ` Antonio Ospite
2015-02-07 21:48 ` Lauri Kasanen
2015-03-19 10:26 ` David Herrmann
2015-02-09 10:08 ` Oliver Neukum
2015-02-09 18:44 ` Lauri Kasanen
2015-02-10 8:14 ` Oliver Neukum
2015-03-16 21:10 ` Pavel Machek [this message]
2015-03-16 21:37 ` Jiri Kosina
2015-03-19 9:14 ` Oliver Neukum
2015-03-19 9:38 ` Pavel Machek
2015-03-19 9:54 ` Oliver Neukum
2015-03-19 10:12 ` Pavel Machek
2015-03-19 10:29 ` Oliver Neukum
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=20150316211056.GB11441@amd \
--to=pavel@ucw.cz \
--cc=AndrewD207@aol.com \
--cc=ao2@ao2.it \
--cc=cand@gmx.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oneukum@suse.de \
/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).