From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751701Ab0BQKTv (ORCPT ); Wed, 17 Feb 2010 05:19:51 -0500 Received: from gate.crashing.org ([63.228.1.57]:39773 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983Ab0BQKTt (ORCPT ); Wed, 17 Feb 2010 05:19:49 -0500 Subject: Re: USB mass storage and ARM cache coherency From: Benjamin Herrenschmidt To: Oliver Neukum Cc: "Shilimkar, Santosh" , Matthew Dharm , Russell King - ARM Linux , Ming Lei , "Mankad, Maulik Ojas" , Sergei Shtylyov , Catalin Marinas , Sebastian Siewior , "linux-usb@vger.kernel.org" , linux-kernel , Pavel Machek , Greg KH , linux-arm-kernel In-Reply-To: <201002171109.32107.oliver@neukum.org> References: <20100208065519.GE1290@ucw.cz> <201002171015.52875.oliver@neukum.org> <1266399609.16346.271.camel@pasglop> <201002171109.32107.oliver@neukum.org> Content-Type: text/plain; charset="UTF-8" Date: Wed, 17 Feb 2010 21:18:01 +1100 Message-ID: <1266401881.16346.278.camel@pasglop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2010-02-17 at 11:09 +0100, Oliver Neukum wrote: > > No problem here. USB core does the mapping only if the low-level driver > so requests. The only exception is in usb_buffer_alloc(), but that boils > down to dma_alloc_coherent() Allright, so why do we need to "fix" anything ? Or is the whole thread moot ? :-) It's pretty clear that between dma_map* and subsequent unmap, the memory is owned by the device and must not be touched by the CPU. If that is violated, then we have a driver bug. Cheers, Ben. From mboxrd@z Thu Jan 1 00:00:00 1970 From: benh@kernel.crashing.org (Benjamin Herrenschmidt) Date: Wed, 17 Feb 2010 21:18:01 +1100 Subject: USB mass storage and ARM cache coherency In-Reply-To: <201002171109.32107.oliver@neukum.org> References: <20100208065519.GE1290@ucw.cz> <201002171015.52875.oliver@neukum.org> <1266399609.16346.271.camel@pasglop> <201002171109.32107.oliver@neukum.org> Message-ID: <1266401881.16346.278.camel@pasglop> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, 2010-02-17 at 11:09 +0100, Oliver Neukum wrote: > > No problem here. USB core does the mapping only if the low-level driver > so requests. The only exception is in usb_buffer_alloc(), but that boils > down to dma_alloc_coherent() Allright, so why do we need to "fix" anything ? Or is the whole thread moot ? :-) It's pretty clear that between dma_map* and subsequent unmap, the memory is owned by the device and must not be touched by the CPU. If that is violated, then we have a driver bug. Cheers, Ben.