All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Bug:  shared usb dt document is incorrect
  2015-07-29  1:06 ` Tim Bird
@ 2015-07-29  0:27     ` Peter Chen
  -1 siblings, 0 replies; 10+ messages in thread
From: Peter Chen @ 2015-07-29  0:27 UTC (permalink / raw)
  To: Tim Bird
  Cc: Rob Herring, antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Greg Kroah-Hartman,
	Bjorn Andersson

On Tue, Jul 28, 2015 at 06:06:30PM -0700, 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
> 
> 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.
> 
> 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.
> 
> In case I change the driver, do I then update the binding doc
> to remove the information about the deprecated property, or not?
> 
> Please advise.

In my opinion, you can just keep both driver and binding doc unchanging
until the generic PHY supports all things the current USB PHY supports,
eg, .notify_disconnect is used in your PHY driver, but it is not
supported in generic PHY framework.

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug:  shared usb dt document is incorrect
@ 2015-07-29  0:27     ` Peter Chen
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Chen @ 2015-07-29  0:27 UTC (permalink / raw)
  To: Tim Bird
  Cc: Rob Herring, antoine.tenart, linux-arm-msm, linux-kernel,
	linux-usb, Greg Kroah-Hartman, Bjorn Andersson

On Tue, Jul 28, 2015 at 06:06:30PM -0700, 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
> 
> 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.
> 
> 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.
> 
> In case I change the driver, do I then update the binding doc
> to remove the information about the deprecated property, or not?
> 
> Please advise.

In my opinion, you can just keep both driver and binding doc unchanging
until the generic PHY supports all things the current USB PHY supports,
eg, .notify_disconnect is used in your PHY driver, but it is not
supported in generic PHY framework.

-- 

Best Regards,
Peter Chen

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Bug:  shared usb dt document is incorrect
@ 2015-07-29  1:06 ` Tim Bird
  0 siblings, 0 replies; 10+ messages in thread
From: Tim Bird @ 2015-07-29  1:06 UTC (permalink / raw)
  To: Rob Herring, antoine.tenart
  Cc: linux-arm-msm, linux-kernel, Peter.Chen, linux-usb,
	Greg Kroah-Hartman, Bjorn Andersson

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

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.

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.

In case I change the driver, do I then update the binding doc
to remove the information about the deprecated property, or not?

Please advise.
 -- Tim

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Bug:  shared usb dt document is incorrect
@ 2015-07-29  1:06 ` Tim Bird
  0 siblings, 0 replies; 10+ messages in thread
From: Tim Bird @ 2015-07-29  1:06 UTC (permalink / raw)
  To: Rob Herring, antoine.tenart
  Cc: linux-arm-msm, linux-kernel, Peter.Chen, linux-usb,
	Greg Kroah-Hartman, Bjorn Andersson

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

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.

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.

In case I change the driver, do I then update the binding doc
to remove the information about the deprecated property, or not?

Please advise.
 -- Tim


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug: shared usb dt document is incorrect
  2015-07-29  1:06 ` Tim Bird
  (?)
  (?)
@ 2015-07-29  2:54 ` Rob Herring
  2015-07-29  3:12     ` Peter Chen
  2015-07-29 17:29   ` Tim Bird
  -1 siblings, 2 replies; 10+ messages in thread
From: Rob Herring @ 2015-07-29  2:54 UTC (permalink / raw)
  To: Tim Bird
  Cc: Antoine Ténart, linux-arm-msm, linux-kernel, Peter Chen,
	Linux USB List, Greg Kroah-Hartman, Bjorn Andersson

On Tue, Jul 28, 2015 at 8:06 PM, Tim Bird <tim.bird@sonymobile.com> 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.

> 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.

> 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 qit than that.

devm_phy_get actually. The driver already supports it. See
ci_hdrc_probe in core.c.

> In case I change the driver, do I then update the binding doc
> to remove the information about the deprecated property, or not?

Not.

Rob

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Bug: shared usb dt document is incorrect
  2015-07-29  2:54 ` Rob Herring
@ 2015-07-29  3:12     ` Peter Chen
  2015-07-29 17:29   ` Tim Bird
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Chen @ 2015-07-29  3:12 UTC (permalink / raw)
  To: Rob Herring, Tim Bird
  Cc: Antoine Ténart, linux-arm-msm, linux-kernel, Linux USB List,
	Greg Kroah-Hartman, Bjorn Andersson

 
> > 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.
> 

But how the new SoC (for new dts) which still uses current USB PHY driver?

Maybe we should not add additional description for this property,
it depends on which PHY driver (Generic PHY vs USB PHY)  this controller
will use, if it uses a new PHY driver, it must use generic PHY framework,  and will
use 'phy' and 'phy-names' corresponding.

Peter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Bug: shared usb dt document is incorrect
@ 2015-07-29  3:12     ` Peter Chen
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Chen @ 2015-07-29  3:12 UTC (permalink / raw)
  To: Rob Herring, Tim Bird
  Cc: Antoine Ténart, linux-arm-msm, linux-kernel, Linux USB List,
	Greg Kroah-Hartman, Bjorn Andersson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1159 bytes --]

 
> > 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.
> 

But how the new SoC (for new dts) which still uses current USB PHY driver?

Maybe we should not add additional description for this property,
it depends on which PHY driver (Generic PHY vs USB PHY)  this controller
will use, if it uses a new PHY driver, it must use generic PHY framework,  and will
use 'phy' and 'phy-names' corresponding.

Peter

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug: shared usb dt document is incorrect
  2015-07-29  3:12     ` Peter Chen
  (?)
@ 2015-07-29  3:25     ` Rob Herring
  -1 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2015-07-29  3:25 UTC (permalink / raw)
  To: Peter Chen
  Cc: Tim Bird, Antoine Ténart, linux-arm-msm, linux-kernel,
	Linux USB List, Greg Kroah-Hartman, Bjorn Andersson

On Tue, Jul 28, 2015 at 10:12 PM, Peter Chen <Peter.Chen@freescale.com> wrote:
>
>> > 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.
>>
>
> But how the new SoC (for new dts) which still uses current USB PHY driver?

That's fine to use, but I would encourage people not to.

> Maybe we should not add additional description for this property,
> it depends on which PHY driver (Generic PHY vs USB PHY)  this controller
> will use, if it uses a new PHY driver, it must use generic PHY framework,  and will
> use 'phy' and 'phy-names' corresponding.

We're thinking about this the wrong way around. The driver should not
determine the binding used. The binding should be independent of the
driver used.

Either we should make the generic phy subsystem have feature parity
with usb-phy, or make the usb-phy drivers use the same generic phy
binding. Long term, I think we want the former and need a way to
subclass the generic phy. Other phys have similar needs for additional
protocol specific functions (e.g. configure the # of lanes for PCIe).
The generic phy subsystem needs some love in my brief experience with
it. For the latter case, this would make switching which phy driver is
used transparent to DT.

Rob

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug: shared usb dt document is incorrect
  2015-07-29  2:54 ` Rob Herring
  2015-07-29  3:12     ` Peter Chen
@ 2015-07-29 17:29   ` Tim Bird
  2015-07-29 20:24     ` Rob Herring
  1 sibling, 1 reply; 10+ messages in thread
From: Tim Bird @ 2015-07-29 17:29 UTC (permalink / raw)
  To: Rob Herring
  Cc: Antoine Ténart, linux-arm-msm, linux-kernel, Peter Chen,
	Linux USB List, Greg Kroah-Hartman, "Andersson,
	Björn"



On 07/28/2015 07:54 PM, Rob Herring wrote:
> On Tue, Jul 28, 2015 at 8:06 PM, Tim Bird <tim.bird@sonymobile.com> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Bug: shared usb dt document is incorrect
  2015-07-29 17:29   ` Tim Bird
@ 2015-07-29 20:24     ` Rob Herring
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Herring @ 2015-07-29 20:24 UTC (permalink / raw)
  To: Tim Bird
  Cc: Antoine Ténart, linux-arm-msm, linux-kernel, Peter Chen,
	Linux USB List, Greg Kroah-Hartman, Andersson, Björn

On Wed, Jul 29, 2015 at 12:29 PM, Tim Bird <tim.bird@sonymobile.com> wrote:
>
>
> On 07/28/2015 07:54 PM, Rob Herring wrote:
>> On Tue, Jul 28, 2015 at 8:06 PM, Tim Bird <tim.bird@sonymobile.com> 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.

Perhaps we need to specify which compatible strings still use the old binding.

>>> 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.

In my mind deprecated means "not recommended to be used", not that it
can't be used. If you were doing a new SOC, then I'd tell you don't
use usb-phy, but in this case as usb-phy is still used on QC SOCs I
think it is okay.

> 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.

I believe the msm probe calls the core which then creates sub-devices
for the host and device sides. Then the host and device drivers are
probed. The SOC probe can fill in a phy or the core code will do it.
The problem with the core code is that it will not do a deferred
probe. It may still work though if you remove this from the msm probe:

        phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
        if (IS_ERR(phy))
                return PTR_ERR(phy);

        ci_hdrc_msm_platdata.usb_phy = phy;


You can support the old and new bindings just by doing:

phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0);
if (IS_ERR(phy) == -EPROBE_DEFER)
  return PTR_ERR(phy);
else {
  phy = devm_usb_get_phy_by_phandle(&pdev->dev, "phys", 0);
  if (IS_ERR(phy))
    return PTR_ERR(phy);
}

Not the prettiest code. If the QC maintainers don't care about
compatibility with old dtb's then you could just switch everything
(dts's and driver) to use phys instead.

Perhaps this should be in a wrapper function as I'd like to see all
users of usb-phy migrate to phys and the driver shouldn't really care
what the property name is.

Rob

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-29 20:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29  1:06 Bug: shared usb dt document is incorrect Tim Bird
2015-07-29  1:06 ` Tim Bird
     [not found] ` <55B82716.1060008-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
2015-07-29  0:27   ` Peter Chen
2015-07-29  0:27     ` Peter Chen
2015-07-29  2:54 ` Rob Herring
2015-07-29  3:12   ` Peter Chen
2015-07-29  3:12     ` Peter Chen
2015-07-29  3:25     ` Rob Herring
2015-07-29 17:29   ` Tim Bird
2015-07-29 20:24     ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.