Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753429Ab0BHGz2 (ORCPT ); Mon, 8 Feb 2010 01:55:28 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:39904 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482Ab0BHGz0 (ORCPT ); Mon, 8 Feb 2010 01:55:26 -0500 Date: Mon, 8 Feb 2010 07:55:19 +0100 From: Pavel Machek To: Catalin Marinas Cc: Matthew Dharm , Sergei Shtylyov , Ming Lei , linux-usb@vger.kernel.org, linux-kernel , Sebastian Siewior , Greg KH , linux-arm-kernel Subject: Re: USB mass storage and ARM cache coherency Message-ID: <20100208065519.GE1290@ucw.cz> References: <20100129185434.GH19501@one-eyed-alien.net> <1265045354.25750.52.camel@pc1117.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1265045354.25750.52.camel@pc1117.cambridge.arm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1312 Lines: 39 Hi! > > So, let's put this in the HCD drivers and be done with it. > > The patch below is what fixes the I-D cache incoherency issues on ARM. I > don't particularly like the solution but it seems to be the only one > available. Really? It looks like arm should just flush the caches when mapping executable page to the userspace.... you can't expect all the drivers to be modified like that... Plus it does unneccessary flushes on x86, etc... > @@ -904,6 +906,14 @@ __acquires(priv->lock) > status = 0; > } > > + if (usb_pipein(urb->pipe) && usb_pipetype(urb->pipe) == PIPE_BULK) { > + void *ptr; > + for (ptr = urb->transfer_buffer; > + ptr < urb->transfer_buffer + urb->transfer_buffer_length; > + ptr += PAGE_SIZE) > + flush_dcache_page(virt_to_page(ptr)); > + } > + > /* complete() can reenter this HCD */ > usb_hcd_unlink_urb_from_ep(priv_to_hcd(priv), urb); > spin_unlock(&priv->lock); > -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- 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/