Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934227Ab0BQJLA (ORCPT ); Wed, 17 Feb 2010 04:11:00 -0500 Received: from smtp-out003.kontent.com ([81.88.40.217]:46434 "EHLO smtp-out003.kontent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934191Ab0BQJK6 (ORCPT ); Wed, 17 Feb 2010 04:10:58 -0500 From: Oliver Neukum To: "Shilimkar, Santosh" Subject: Re: USB mass storage and ARM cache coherency Date: Wed, 17 Feb 2010 10:10:57 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.33-rc6-0.1-default; KDE/4.3.1; x86_64; ; ) Cc: "Russell King - ARM Linux" , Catalin Marinas , Pavel Machek , Greg KH , Matthew Dharm , Sergei Shtylyov , Ming Lei , Sebastian Siewior , "linux-usb@vger.kernel.org" , "linux-kernel" , "linux-arm-kernel" , "Mankad, Maulik Ojas" , "Gadiyar, Anand" References: <20100208065519.GE1290@ucw.cz> <201002161522.38467.oliver@neukum.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201002171010.57464.oliver@neukum.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1397 Lines: 32 Am Mittwoch, 17. Februar 2010 09:55:08 schrieb Shilimkar, Santosh: > > Your original patch however kills ehci, ohci and uhci on some architectures. > > How about below approach? Controller driver can set > "uses_pio_for_control" if it can't do dma for control transfer. > > diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c > index 80995ef..e3eae02 100644 > --- a/drivers/usb/core/hcd.c > +++ b/drivers/usb/core/hcd.c > @@ -1276,7 +1276,7 @@ static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, > > if (usb_endpoint_xfer_control(&urb->ep->desc) > && !(urb->transfer_flags & URB_NO_SETUP_DMA_MAP)) { > - if (hcd->self.uses_dma) { > + if (hcd->self.uses_dma && !hcd->self.uses_pio_for_control) { It is not elegant to describe exceptions. It would be better, if you split up the flag into two flags, called uses_dma_for_ordinary_transfers and uses_dma_for control_transfers. Doing so also makes sure you look at all hcd drivers ;-) And the tests become straightforward. And please add a detailed comment to explain why this differentiation is needed on ARM. Regards 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/