Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbbG0Guy (ORCPT ); Mon, 27 Jul 2015 02:50:54 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:33549 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202AbbG0Guw (ORCPT ); Mon, 27 Jul 2015 02:50:52 -0400 Date: Mon, 27 Jul 2015 08:50:39 +0200 From: Petr Tesarik To: Oliver Neukum Cc: Johan Hovold , Greg Kroah-Hartman , "open list:USB SERIAL SUBSYSTEM" , open list , Petr Tesarik Subject: Re: [PATCH 3/4] cp210x: Store part number Message-ID: <20150727085039.1627db72@hananiah.suse.cz> In-Reply-To: <1437917574.5839.2.camel@suse.com> References: <1437720491-28702-1-git-send-email-ptesarik@suse.com> <1437720491-28702-4-git-send-email-ptesarik@suse.com> <1437917574.5839.2.camel@suse.com> Organization: SUSE Linux X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.28; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1524 Lines: 38 On Sun, 26 Jul 2015 15:32:54 +0200 Oliver Neukum wrote: > On Fri, 2015-07-24 at 08:48 +0200, Petr Tesarik wrote: > > @@ -872,6 +886,12 @@ static int cp210x_startup(struct usb_serial > > *serial) > > > > usb_set_serial_data(serial, spriv); > > > > + /* Get the 1-byte part number of the cp210x device */ > > + cp210x_control_msg(serial->port[0], CP210X_VENDOR_SPECIFIC, > > + REQTYPE_DEVICE_TO_HOST, CP210X_GET_PARTNUM, > > + &partnum, 1, USB_CTRL_GET_TIMEOUT); > > + spriv->bPartNumber = partnum & 0xFF; > > DMA on the stack. That breaks the cache coherency rules. > You must kmalloc the buffer. I don't understand. While you're right that I copied this part from Sillicon Labs' driver without much thinking, and &spriv->bPartNumber can be used directly, I can't see any DMA on stack. FWIW cp210x_control_msg always allocates a buffer using kcalloc: buf = kcalloc(length, sizeof(__le32), GFP_KERNEL); /* ... */ result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), request, requesttype, value, spriv->bInterfaceNumber, buf, size, timeout); Is that what you mean? TIA, Petr T -- 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/