Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753015AbbBJIO6 (ORCPT ); Tue, 10 Feb 2015 03:14:58 -0500 Received: from cantor2.suse.de ([195.135.220.15]:48238 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752583AbbBJIO5 (ORCPT ); Tue, 10 Feb 2015 03:14:57 -0500 Message-ID: <1423556076.19839.3.camel@linux-0dmf.site> Subject: Re: [PATCH] HID: sony: Enable Gasia third-party PS3 controllers From: Oliver Neukum To: Lauri Kasanen Cc: jkosina@suse.cz, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ao2@ao2.it, AndrewD207@aol.com Date: Tue, 10 Feb 2015 09:14:36 +0100 In-Reply-To: <20150209204414.a4d205be.cand@gmx.com> References: <20150207154859.89a7e4e3.cand@gmx.com> <1423476481.10695.2.camel@linux-0dmf.site> <20150209204414.a4d205be.cand@gmx.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1018 Lines: 30 On Mon, 2015-02-09 at 20:44 +0200, Lauri Kasanen wrote: > On Mon, 09 Feb 2015 11:08:01 +0100 > Oliver Neukum 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. HTH Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/