From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758607AbcIHIqT (ORCPT ); Thu, 8 Sep 2016 04:46:19 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:61927 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757626AbcIHIqQ (ORCPT ); Thu, 8 Sep 2016 04:46:16 -0400 From: Arnd Bergmann To: Felipe Balbi Cc: Peter Chen , Leo Li , Grygorii Strashko , Russell King - ARM Linux , Catalin Marinas , Yoshihiro Shimoda , "linux-usb@vger.kernel.org" , Sekhar Nori , lkml , Stuart Yoder , Scott Wood , David Fisher , "Thang Q. Nguyen" , Alan Stern , Greg Kroah-Hartman , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev Date: Thu, 08 Sep 2016 10:45:26 +0200 Message-ID: <2733202.7lpFC7RnDm@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <87y432iylr.fsf@linux.intel.com> References: <6739240.VDAnDBppH0@wuerfel> <87y432iylr.fsf@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:L4xyucjWIYSnalTDR0DK0Hv8NoZbW+SxAn6d85c1lLCJScegiNY AJOgM+PrsSoh3MFAndyf1Gr7QQ5npo9vgecuXmF5sHlrvgDSuw5PUiBIL6JWrAua+8aJZwn MM6UFahsTsg/QSujk19jdutxEkHEuKgPcfi/zjC+iRqntKEVzziaevSvOe6o827jKzTU0u3 4QzthXuKtnSuR3WZDWPzQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:DJXPhVuNqTw=:96cI70yNJ7o+uxtBzO2EUH +Frut7yw4xEv+hhgUGQ4WXVJ5hO3iSX/MF4E7HrIbRYLLUCeGBILpv+36Scyz1WWcodTUVMg0 sAE+H/LbFDj6aJhjYDWvrQNdX0V659ABtfpBV5uS4livHGlFfnkKGB+Ipx6+LhvbZUic8wSpH Kp6oElcB6td7uaup5YNwd0BogXeJDzv1/hWlSSnkgMR5hZ+h4MnWnFV3jITqkCKBp9Vtzsrke cv15HFw3H8UMP8sUUrxnRTtAaghVmG7/b86qjbM7Un5jezTNQll4CJZUq5IQZoMK8RdOtOWok EAXRqkcqGWdgZNDjPMAXZiqjTG0v8OUFkET7OlhpPnTlV6at6O24Orgbb6OjDucgReskaKm8c GFqD41f/1BLrOB9tDzbbfWHIL10HX1d+L3PtDz/YyiuqgbWQwEPisxOC6houAgVv/mUoc19/u b9ga6YYnnjnb/xrF1zaVpw0PajJj0XW46PE34as8tsmUhofd1LlaCtV7/zjGoT6gGNXhb6N3l KFlv6fuyBMQ2QhO9QnvhhSGMBeL0S7a8ciPu3V8OW8j7fqupgAcXaiVZpgUWFWmNP2iH9s8jG S8HzGTVxjiKB6o7844Ej3Q5JZ4OkjtG/BUwjaH3EJrJwamAOMImE4wrC/CM9RvMf0g71y7Fl7 Msutk57e55D313fbnNrq3BUQtG7VNrSg1Nb8Igqc88U2rrrI1wYquFCogMoPb7cnL6s+hKbqr 1mJCll8Npe08zYb+ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, September 8, 2016 11:29:04 AM CEST Felipe Balbi wrote: > > If we do that, we have to put child devices of the dwc3 devices into > > the platform glue, and it also breaks those dwc3 devices that don't > > have a parent driver. > > Well, this is easy to fix: > > if (dwc->dev->parent) { > dwc->sysdev = dwc->dev->parent; > } else { > dev_info(dwc->dev, "Please provide a glue layer!\n"); > dwc->sysdev = dwc->dev; > } I don't understand. Do you mean we should have an extra level of stacking and splitting "static struct platform_driver dwc3_driver" in two so instead of "qcom,dwc3" -> "snps,dwc3" (usb_bus.sysdev) -> "xhci" (usb_bus.dev) we do this? "qcom,dwc3" -> "snps,dwc3" (usb_bus.sysdev) -> "dwc3-glue" -> "xhci" (usb_bus.dev) That sounds a bit clumsy for the sake of consistency with PCI. The advantage is that xhci can always use the grandparent device as sysdev whenever it isn't probed through PCI or firmware itself, but the purpose of the dwc3-glue is otherwise questionable. How about adding a 'compatible="snps,dwc3-pci"' property for the dwc3 device when that is created from the PCI driver and checking for that with the device property interface instead? If it's "snps,dwc3" we use the device itself while for "snps,dwc3-pci", we use the parent? Arnd