Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753066AbcD0R7R (ORCPT ); Wed, 27 Apr 2016 13:59:17 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:41744 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752526AbcD0R7P (ORCPT ); Wed, 27 Apr 2016 13:59:15 -0400 Date: Wed, 27 Apr 2016 13:59:13 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Arnd Bergmann cc: linux-arm-kernel@lists.infradead.org, Felipe Balbi , Grygorii Strashko , Catalin Marinas , Yoshihiro Shimoda , , Sekhar Nori , , David Fisher , "Thang Q. Nguyen" , Greg Kroah-Hartman Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev In-Reply-To: <6148633.0YXW4XnX4b@wuerfel> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 904 Lines: 25 On Wed, 27 Apr 2016, Arnd Bergmann wrote: > I've looked at the usb HCD code now and see this: > > struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver, > struct device *dev, const char *bus_name, > struct usb_hcd *primary_hcd) > { > ... > hcd->self.controller = dev; > hcd->self.uses_dma = (dev->dma_mask != NULL); > ... > } > > What I think we need to do here is ensure that the device that gets > passed here and assigned to hcd->self.controller is the actual DMA > master device, i.e. the pci_device or platform_device that was created > from outside of the xhci stack. This is after all the pointer that > gets passed into all the dma_map_*/dma_sync_*/dma_alloc_*/... > functions. It would be better to add a new field, since self.controller is also used for lots of other purposes. Something like hcd->self.dma_dev. Alan Stern