Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752783AbbG2R3Q (ORCPT ); Wed, 29 Jul 2015 13:29:16 -0400 Received: from seldrel01.sonyericsson.com ([37.139.156.2]:11868 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbbG2R3O (ORCPT ); Wed, 29 Jul 2015 13:29:14 -0400 Message-ID: <55B90D64.1010509@sonymobile.com> Date: Wed, 29 Jul 2015 10:29:08 -0700 From: Tim Bird User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Rob Herring CC: =?UTF-8?B?QW50b2luZSBUw6luYXJ0?= , "linux-arm-msm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Peter Chen , Linux USB List , Greg Kroah-Hartman , =?UTF-8?B?IkFuZGVyc3NvbiwgQmrDtnJuIg==?= Subject: Re: Bug: shared usb dt document is incorrect References: <55B82716.1060008@sonymobile.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2658 Lines: 60 On 07/28/2015 07:54 PM, Rob Herring wrote: > On Tue, Jul 28, 2015 at 8:06 PM, Tim Bird wrote: >> Antoine and Rob, >> >> I was just doing some testing with USB on a Qualcomm SoC. >> >> I followed the instructions in the binding document: >> Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt >> >> which has a compatible for "qcom,ci-hdrc", and is, in general, >> for chipidea-based USB controllers. >> >> It says in the document that the property usb-phy is deprecated, and to >> use phys and phy-names instead. However, the Qualcomm >> driver for this still uses usb-phy. That driver is in: >> drivers/usb/chipidea/ci_hdrc_msm.c > > Deprecated means it still exists in the wild and should be maintained, > but don't use it for new dts files. OK. But for the Qualcomm driver, the new binding doesn't work (see below). Since the binding doc specifically says: 'Use "phys" instead [of "usb-phy"].', it is wrong as currently written, for this controller/phy combination. >> I'm guessing I should update the Qualcomm driver to use >> phys and phy-names, but wanted to check with you-all to >> verify that this is the preferred method of getting >> phys by phandle now. It's either change the driver >> or make an exception in the binding document, I believe. > > That would be fine along with updating the dts files, but the doc > should remain for some time. Does this mean I should try phys/phy-names, and if that doesn't work try usb-phy, for backwards compatibility? >> I presume I should be changing devm_usb_get_phy_by_phandle() >> to of_phy_get(), but let me know if there's more to it than that. > > devm_phy_get actually. The driver already supports it. See > ci_hdrc_probe in core.c. In my case the probe that is running is ci_hdrc_msm_probe(), in ci_hdrc_msm.c This probe uses devm_usb_get_phy_by_phandle(..."usb-phy"). If I specify phys/phy-names in my dts, the probe fails silently - leading ultimately to USB not working. If I specify "usb-phy" in my dts, everything works. In this case, that property is NOT deprecated. It's the only one that works. I don't understand what's going on with the different probe routines and how the SoC-specific parts interact with the core. I just know that the kernel behaviour and the binding doc don't match, and I'd like to help fix it if I can. Thanks for your patience while I try to understand this issue. -- Tim -- 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/