Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754009AbbFXQ2R (ORCPT ); Wed, 24 Jun 2015 12:28:17 -0400 Received: from vi37-28-154-113.vibiznes.pl ([37.28.154.113]:39406 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbbFXQ1W (ORCPT ); Wed, 24 Jun 2015 12:27:22 -0400 Message-ID: <558ADA5E.3070902@maciej.szmigiero.name> Date: Wed, 24 Jun 2015 18:27:10 +0200 From: "Maciej S. Szmigiero" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Peter Chen CC: USB list , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Greg Kroah-Hartman , Markus Pargmann , "devicetree@vger.kernel.org" , linux-kernel , Fabio Estevam , Alan Stern Subject: Re: [PATCH] usb: ci_hdrc_imx: add optional hub clock References: <5586EC36.1070403@maciej.szmigiero.name> <20150623025534.GA15147@shlinux2> In-Reply-To: <20150623025534.GA15147@shlinux2> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2870 Lines: 71 Hi Peter, W dniu 23.06.2015 04:55, Peter Chen pisze: > On Mon, Jun 22, 2015 at 12:54:14AM +0800, Maciej S. Szmigiero wrote: >> This patch adds ability to define optional clock of connected >> USB hub to ChipIdea i.MX usb controller driver. >> >> This is needed for example for UDOO board. >> Previously, this board DT file used a fact that non-core registers >> of this USB controller have a separate driver (usbmisc_imx) which >> did allow defining a separate clock. >> >> Because the non-core registers are in fact using the same clock as >> main controller this allowed to use one of such clock definitions >> to enable USB hub clock instead. >> >> However, since commit 73dea4a912b2 >> ("usb: chipidea: usbmisc_imx: delete clock information") this >> possibility no longer exists and loading USB support on this board >> results in a hard SoC lockup. >> >> Note that this is not specific to particular USB hub chip used, >> rather than to a particular board. >> Since this is a DT-based board there is no board platform file to >> put such clock enable. >> Also, USB bus devices aren't instantiated in DT file since it is an >> enumerable bus. >> >> NOP PHY also can't be used as clock consumer since this >> USB controller needs a true MXS phy definition, which accepts only >> one clock (different from USB controller one). >> >> Based on a patch previously submitted by Fabio Estevam, with consent. >> >> Signed-off-by: Maciej Szmigiero >> (..) > Hi Maciej, > > As I said before, the USB HUB is just an USB peripheral, we should > not put a peripheral's clock information to controller driver, I think > hub driver should take responsibilities for it, just like other usb > pheripheral drivers, like usb modem, etc. You can talk it with Alan > Stern about it. I understand you position, but there is a problem with this solution that USB devices - including hubs - as devices on an enumerable bus don't have DT bindings to put such clock handle in, since they are instantiated by their bus scanning code. If such devices would be added to DT at least there would be need to somehow match the discovered device with its DT counterpart. In case of USB this would need address like controller X, port x (or port x,y,z in case of multiple hubs in between controller and device). As far I see there is nothing like this in USB core yet. Of course, there is still possibly to add something like a generic OF USB hub driver which will take care of configuring extra clocks, pins, GPIOs, etc. but which will be otherwise unrelated to normal USB hub driver. Best regards, Maciej Szmigiero -- 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/