diff mbox series

[v3,1/3] dt-bindings: phy: qcom,qmp: Add PCIe qcom,refclk-always-on property

Message ID 20231127-refclk_always_on-v3-1-26d969fa8f1d@quicinc.com
State New
Headers show
Series [v3,1/3] dt-bindings: phy: qcom,qmp: Add PCIe qcom,refclk-always-on property | expand

Commit Message

Krishna chaitanya chundru Nov. 27, 2023, 12:13 p.m. UTC
Document qcom,refclk-always-on property which is needed in some platforms
to supply refclk even in PCIe low power states.

Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
---
 .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Krzysztof Kozlowski Nov. 28, 2023, 8:56 a.m. UTC | #1
On 27/11/2023 13:13, Krishna chaitanya chundru wrote:
> Document qcom,refclk-always-on property which is needed in some platforms
> to supply refclk even in PCIe low power states.
> 
> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
> ---
>  .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> index 2c3d6553a7ba..c747c9f35795 100644
> --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> @@ -93,6 +93,13 @@ properties:
>    "#phy-cells":
>      const: 0
>  
> +  qcom,refclk-always-on:
> +    type: boolean
> +    description: In some platform where PCIe switch is connected, pcie switch due to some design

You received a comment to use proper wrapping: 80. Please implement it.

> +      limitation fails to propage clkreq signal to the host and due to that host will not send
> +      refclk, which  results in linkdown in L1.2 or L1.1 exit initiated by EP.
> +      This property if set keeps refclk always on even in Low power states.

The property name suggests that's the state of hardware - refclk is
always on. Description suggests you want to instruct OS to do something.

Again, third time (once from Bjorn, once from Dmitry), rephrase property
name and description to describe the hardware issue. I see description
improved, but not the property name. Again in the end of description you
say what Linux should do. Bindings do not describe Linux OS.

Best regards,
Krzysztof
Manivannan Sadhasivam Dec. 1, 2023, 6:07 a.m. UTC | #2
On Tue, Nov 28, 2023 at 02:49:18PM +0530, Krishna Chaitanya Chundru wrote:
> 
> On 11/28/2023 2:26 PM, Krzysztof Kozlowski wrote:
> > On 27/11/2023 13:13, Krishna chaitanya chundru wrote:
> > > Document qcom,refclk-always-on property which is needed in some platforms
> > > to supply refclk even in PCIe low power states.
> > > 
> > > Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
> > > ---
> > >   .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +++++++
> > >   1 file changed, 7 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> > > index 2c3d6553a7ba..c747c9f35795 100644
> > > --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> > > +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> > > @@ -93,6 +93,13 @@ properties:
> > >     "#phy-cells":
> > >       const: 0
> > > +  qcom,refclk-always-on:
> > > +    type: boolean
> > > +    description: In some platform where PCIe switch is connected, pcie switch due to some design
> > You received a comment to use proper wrapping: 80. Please implement it.
> I will update this.
> > > +      limitation fails to propage clkreq signal to the host and due to that host will not send
> > > +      refclk, which  results in linkdown in L1.2 or L1.1 exit initiated by EP.
> > > +      This property if set keeps refclk always on even in Low power states.
> > The property name suggests that's the state of hardware - refclk is
> > always on. Description suggests you want to instruct OS to do something.
> > 
> > Again, third time (once from Bjorn, once from Dmitry), rephrase property
> > name and description to describe the hardware issue. I see description
> > improved, but not the property name. Again in the end of description you
> 
> Both bjorn and Dmitry gave comments to change the description only, and not
> the property name,
> 
> correct if I am wrong.
> 
> > say what Linux should do. Bindings do not describe Linux OS.
> 
> I will remove the last line in the next patch.
> 

You should name the property as, "qcom,keep-refclk-always-on"

Also, no need to stuff the binding with "why this property is required", that
info should be part of the patch description. Just describe what this property
means in binding.

- Mani

> - Krishna Chaitanya.
> 
> > 
> > Best regards,
> > Krzysztof
>
Krzysztof Kozlowski Dec. 1, 2023, 8:01 a.m. UTC | #3
On 01/12/2023 07:07, Manivannan Sadhasivam wrote:
> On Tue, Nov 28, 2023 at 02:49:18PM +0530, Krishna Chaitanya Chundru wrote:
>>
>> On 11/28/2023 2:26 PM, Krzysztof Kozlowski wrote:
>>> On 27/11/2023 13:13, Krishna chaitanya chundru wrote:
>>>> Document qcom,refclk-always-on property which is needed in some platforms
>>>> to supply refclk even in PCIe low power states.
>>>>
>>>> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
>>>> ---
>>>>   .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +++++++
>>>>   1 file changed, 7 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
>>>> index 2c3d6553a7ba..c747c9f35795 100644
>>>> --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
>>>> +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
>>>> @@ -93,6 +93,13 @@ properties:
>>>>     "#phy-cells":
>>>>       const: 0
>>>> +  qcom,refclk-always-on:
>>>> +    type: boolean
>>>> +    description: In some platform where PCIe switch is connected, pcie switch due to some design
>>> You received a comment to use proper wrapping: 80. Please implement it.
>> I will update this.
>>>> +      limitation fails to propage clkreq signal to the host and due to that host will not send
>>>> +      refclk, which  results in linkdown in L1.2 or L1.1 exit initiated by EP.
>>>> +      This property if set keeps refclk always on even in Low power states.
>>> The property name suggests that's the state of hardware - refclk is
>>> always on. Description suggests you want to instruct OS to do something.
>>>
>>> Again, third time (once from Bjorn, once from Dmitry), rephrase property
>>> name and description to describe the hardware issue. I see description
>>> improved, but not the property name. Again in the end of description you
>>
>> Both bjorn and Dmitry gave comments to change the description only, and not
>> the property name,
>>
>> correct if I am wrong.
>>
>>> say what Linux should do. Bindings do not describe Linux OS.
>>
>> I will remove the last line in the next patch.
>>
> 
> You should name the property as, "qcom,keep-refclk-always-on"

Keep the clock by who? By driver? Then not, property should describe
physical phenomena or hardware issue being fixed here, not what driver
should do.


Best regards,
Krzysztof
Manivannan Sadhasivam Dec. 1, 2023, 11:10 a.m. UTC | #4
On Fri, Dec 01, 2023 at 09:01:43AM +0100, Krzysztof Kozlowski wrote:
> On 01/12/2023 07:07, Manivannan Sadhasivam wrote:
> > On Tue, Nov 28, 2023 at 02:49:18PM +0530, Krishna Chaitanya Chundru wrote:
> >>
> >> On 11/28/2023 2:26 PM, Krzysztof Kozlowski wrote:
> >>> On 27/11/2023 13:13, Krishna chaitanya chundru wrote:
> >>>> Document qcom,refclk-always-on property which is needed in some platforms
> >>>> to supply refclk even in PCIe low power states.
> >>>>
> >>>> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
> >>>> ---
> >>>>   .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +++++++
> >>>>   1 file changed, 7 insertions(+)
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> >>>> index 2c3d6553a7ba..c747c9f35795 100644
> >>>> --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> >>>> +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> >>>> @@ -93,6 +93,13 @@ properties:
> >>>>     "#phy-cells":
> >>>>       const: 0
> >>>> +  qcom,refclk-always-on:
> >>>> +    type: boolean
> >>>> +    description: In some platform where PCIe switch is connected, pcie switch due to some design
> >>> You received a comment to use proper wrapping: 80. Please implement it.
> >> I will update this.
> >>>> +      limitation fails to propage clkreq signal to the host and due to that host will not send
> >>>> +      refclk, which  results in linkdown in L1.2 or L1.1 exit initiated by EP.
> >>>> +      This property if set keeps refclk always on even in Low power states.
> >>> The property name suggests that's the state of hardware - refclk is
> >>> always on. Description suggests you want to instruct OS to do something.
> >>>
> >>> Again, third time (once from Bjorn, once from Dmitry), rephrase property
> >>> name and description to describe the hardware issue. I see description
> >>> improved, but not the property name. Again in the end of description you
> >>
> >> Both bjorn and Dmitry gave comments to change the description only, and not
> >> the property name,
> >>
> >> correct if I am wrong.
> >>
> >>> say what Linux should do. Bindings do not describe Linux OS.
> >>
> >> I will remove the last line in the next patch.
> >>
> > 
> > You should name the property as, "qcom,keep-refclk-always-on"
> 
> Keep the clock by who? By driver? Then not, property should describe
> physical phenomena or hardware issue being fixed here, not what driver
> should do.
> 

This property indeed fixes the hardware issue (though in board level) and I see
a plenty of properties similar to this one instructing the OS to keep some
resource ON to workaround hardware issues. So they are all wrong?

- Mani

> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Dec. 1, 2023, 12:10 p.m. UTC | #5
On 01/12/2023 12:10, Manivannan Sadhasivam wrote:
> On Fri, Dec 01, 2023 at 09:01:43AM +0100, Krzysztof Kozlowski wrote:
>> On 01/12/2023 07:07, Manivannan Sadhasivam wrote:
>>> On Tue, Nov 28, 2023 at 02:49:18PM +0530, Krishna Chaitanya Chundru wrote:
>>>>
>>>> On 11/28/2023 2:26 PM, Krzysztof Kozlowski wrote:
>>>>> On 27/11/2023 13:13, Krishna chaitanya chundru wrote:
>>>>>> Document qcom,refclk-always-on property which is needed in some platforms
>>>>>> to supply refclk even in PCIe low power states.
>>>>>>
>>>>>> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
>>>>>> ---
>>>>>>   .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +++++++
>>>>>>   1 file changed, 7 insertions(+)
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
>>>>>> index 2c3d6553a7ba..c747c9f35795 100644
>>>>>> --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
>>>>>> +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
>>>>>> @@ -93,6 +93,13 @@ properties:
>>>>>>     "#phy-cells":
>>>>>>       const: 0
>>>>>> +  qcom,refclk-always-on:
>>>>>> +    type: boolean
>>>>>> +    description: In some platform where PCIe switch is connected, pcie switch due to some design
>>>>> You received a comment to use proper wrapping: 80. Please implement it.
>>>> I will update this.
>>>>>> +      limitation fails to propage clkreq signal to the host and due to that host will not send
>>>>>> +      refclk, which  results in linkdown in L1.2 or L1.1 exit initiated by EP.
>>>>>> +      This property if set keeps refclk always on even in Low power states.
>>>>> The property name suggests that's the state of hardware - refclk is
>>>>> always on. Description suggests you want to instruct OS to do something.
>>>>>
>>>>> Again, third time (once from Bjorn, once from Dmitry), rephrase property
>>>>> name and description to describe the hardware issue. I see description
>>>>> improved, but not the property name. Again in the end of description you
>>>>
>>>> Both bjorn and Dmitry gave comments to change the description only, and not
>>>> the property name,
>>>>
>>>> correct if I am wrong.
>>>>
>>>>> say what Linux should do. Bindings do not describe Linux OS.
>>>>
>>>> I will remove the last line in the next patch.
>>>>
>>>
>>> You should name the property as, "qcom,keep-refclk-always-on"
>>
>> Keep the clock by who? By driver? Then not, property should describe
>> physical phenomena or hardware issue being fixed here, not what driver
>> should do.
>>
> 
> This property indeed fixes the hardware issue (though in board level) and I see
> a plenty of properties similar to this one instructing the OS to keep some
> resource ON to workaround hardware issues. So they are all wrong?

What I said before:
"Again, third time (once from Bjorn, once from Dmitry), rephrase
property name and description to describe the hardware issue. I see
description improved, but not the property name. Again in the end of
description you say what Linux should do. Bindings do not describe Linux
OS."


Best regards,
Krzysztof
Manivannan Sadhasivam Dec. 1, 2023, 12:30 p.m. UTC | #6
On Fri, Dec 01, 2023 at 01:10:48PM +0100, Krzysztof Kozlowski wrote:
> On 01/12/2023 12:10, Manivannan Sadhasivam wrote:
> > On Fri, Dec 01, 2023 at 09:01:43AM +0100, Krzysztof Kozlowski wrote:
> >> On 01/12/2023 07:07, Manivannan Sadhasivam wrote:
> >>> On Tue, Nov 28, 2023 at 02:49:18PM +0530, Krishna Chaitanya Chundru wrote:
> >>>>
> >>>> On 11/28/2023 2:26 PM, Krzysztof Kozlowski wrote:
> >>>>> On 27/11/2023 13:13, Krishna chaitanya chundru wrote:
> >>>>>> Document qcom,refclk-always-on property which is needed in some platforms
> >>>>>> to supply refclk even in PCIe low power states.
> >>>>>>
> >>>>>> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
> >>>>>> ---
> >>>>>>   .../devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml        | 7 +++++++
> >>>>>>   1 file changed, 7 insertions(+)
> >>>>>>
> >>>>>> diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> >>>>>> index 2c3d6553a7ba..c747c9f35795 100644
> >>>>>> --- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> >>>>>> +++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
> >>>>>> @@ -93,6 +93,13 @@ properties:
> >>>>>>     "#phy-cells":
> >>>>>>       const: 0
> >>>>>> +  qcom,refclk-always-on:
> >>>>>> +    type: boolean
> >>>>>> +    description: In some platform where PCIe switch is connected, pcie switch due to some design
> >>>>> You received a comment to use proper wrapping: 80. Please implement it.
> >>>> I will update this.
> >>>>>> +      limitation fails to propage clkreq signal to the host and due to that host will not send
> >>>>>> +      refclk, which  results in linkdown in L1.2 or L1.1 exit initiated by EP.
> >>>>>> +      This property if set keeps refclk always on even in Low power states.
> >>>>> The property name suggests that's the state of hardware - refclk is
> >>>>> always on. Description suggests you want to instruct OS to do something.
> >>>>>
> >>>>> Again, third time (once from Bjorn, once from Dmitry), rephrase property
> >>>>> name and description to describe the hardware issue. I see description
> >>>>> improved, but not the property name. Again in the end of description you
> >>>>
> >>>> Both bjorn and Dmitry gave comments to change the description only, and not
> >>>> the property name,
> >>>>
> >>>> correct if I am wrong.
> >>>>
> >>>>> say what Linux should do. Bindings do not describe Linux OS.
> >>>>
> >>>> I will remove the last line in the next patch.
> >>>>
> >>>
> >>> You should name the property as, "qcom,keep-refclk-always-on"
> >>
> >> Keep the clock by who? By driver? Then not, property should describe
> >> physical phenomena or hardware issue being fixed here, not what driver
> >> should do.
> >>
> > 
> > This property indeed fixes the hardware issue (though in board level) and I see
> > a plenty of properties similar to this one instructing the OS to keep some
> > resource ON to workaround hardware issues. So they are all wrong?
> 
> What I said before:
> "Again, third time (once from Bjorn, once from Dmitry), rephrase
> property name and description to describe the hardware issue. I see
> description improved, but not the property name. Again in the end of
> description you say what Linux should do. Bindings do not describe Linux
> OS."
> 

You didn't answer my question:

"I see a plenty of properties similar to this one instructing the OS to keep some
resource ON to workaround hardware issues. So they are all wrong?"

If you say they are wrong, why are they approved in the first place?

- Mani

> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Dec. 1, 2023, 1:25 p.m. UTC | #7
On 01/12/2023 13:30, Manivannan Sadhasivam wrote:
>> What I said before:
>> "Again, third time (once from Bjorn, once from Dmitry), rephrase
>> property name and description to describe the hardware issue. I see
>> description improved, but not the property name. Again in the end of
>> description you say what Linux should do. Bindings do not describe Linux
>> OS."
>>
> 
> You didn't answer my question:
> 
> "I see a plenty of properties similar to this one instructing the OS to keep some
> resource ON to workaround hardware issues. So they are all wrong?"

They are not the best, but it all depends on the individual case.

> 
> If you say they are wrong, why are they approved in the first place?
Because we don't have time to keep digging what the driver is doing and
what is claimed in DT. Some people don't even CC us on the driver.


Best regards,
Krzysztof
Konrad Dybcio Dec. 1, 2023, 9:29 p.m. UTC | #8
On 1.12.2023 14:25, Krzysztof Kozlowski wrote:
> On 01/12/2023 13:30, Manivannan Sadhasivam wrote:
>>> What I said before:
>>> "Again, third time (once from Bjorn, once from Dmitry), rephrase
>>> property name and description to describe the hardware issue. I see
>>> description improved, but not the property name. Again in the end of
>>> description you say what Linux should do. Bindings do not describe Linux
>>> OS."
>>>
>>
>> You didn't answer my question:
>>
>> "I see a plenty of properties similar to this one instructing the OS to keep some
>> resource ON to workaround hardware issues. So they are all wrong?"
> 
> They are not the best, but it all depends on the individual case.
> 
>>
>> If you say they are wrong, why are they approved in the first place?
> Because we don't have time to keep digging what the driver is doing and
> what is claimed in DT. Some people don't even CC us on the driver.
Not sure if I asked this before, but can this not be set in the config
struct inside the driver?

Konrad
Manivannan Sadhasivam Dec. 6, 2023, 1:07 p.m. UTC | #9
On Fri, Dec 01, 2023 at 10:29:11PM +0100, Konrad Dybcio wrote:
> On 1.12.2023 14:25, Krzysztof Kozlowski wrote:
> > On 01/12/2023 13:30, Manivannan Sadhasivam wrote:
> >>> What I said before:
> >>> "Again, third time (once from Bjorn, once from Dmitry), rephrase
> >>> property name and description to describe the hardware issue. I see
> >>> description improved, but not the property name. Again in the end of
> >>> description you say what Linux should do. Bindings do not describe Linux
> >>> OS."
> >>>
> >>
> >> You didn't answer my question:
> >>
> >> "I see a plenty of properties similar to this one instructing the OS to keep some
> >> resource ON to workaround hardware issues. So they are all wrong?"
> > 
> > They are not the best, but it all depends on the individual case.
> > 
> >>
> >> If you say they are wrong, why are they approved in the first place?
> > Because we don't have time to keep digging what the driver is doing and
> > what is claimed in DT. Some people don't even CC us on the driver.
> Not sure if I asked this before, but can this not be set in the config
> struct inside the driver?
> 

This cannot be the default config for any platform as keeping refclk always on
will have some power penalty. Only if the hardware (EP or board design) has any
issue, we can turn on this option.

- Mani

> Konrad
Krzysztof Kozlowski Dec. 6, 2023, 5:50 p.m. UTC | #10
On 06/12/2023 14:10, Manivannan Sadhasivam wrote:
>>>
>>> If you say they are wrong, why are they approved in the first place?
>> Because we don't have time to keep digging what the driver is doing and
>> what is claimed in DT. Some people don't even CC us on the driver.
>>
> 
> OK. How about, "qcom,broken-refclk"? This reflects the fact that the default
> refclk operation is broken on this platform, so the OS should be prepared for
> it (by keeping it always on).
> 

Sounds very good to me.

Best regards,
Krzysztof
Johan Hovold Dec. 7, 2023, 9:51 a.m. UTC | #11
On Wed, Dec 06, 2023 at 06:40:09PM +0530, Manivannan Sadhasivam wrote:

> OK. How about, "qcom,broken-refclk"? This reflects the fact that the default
> refclk operation is broken on this platform, so the OS should be prepared for
> it (by keeping it always on).

Shouldn't that be

	qcom,broken-clkreq

since its the CLKREQ# signal used to request REFCLK that is broken, not
the REFCLK itself?

Johan
Manivannan Sadhasivam Dec. 7, 2023, 10:12 a.m. UTC | #12
On Thu, Dec 07, 2023 at 10:51:09AM +0100, Johan Hovold wrote:
> On Wed, Dec 06, 2023 at 06:40:09PM +0530, Manivannan Sadhasivam wrote:
> 
> > OK. How about, "qcom,broken-refclk"? This reflects the fact that the default
> > refclk operation is broken on this platform, so the OS should be prepared for
> > it (by keeping it always on).
> 
> Shouldn't that be
> 
> 	qcom,broken-clkreq
> 
> since its the CLKREQ# signal used to request REFCLK that is broken, not
> the REFCLK itself?
> 

Darn... You are right. I got carried away by the initial property name. Thanks
for spotting!

- Mani

> Johan
Konrad Dybcio Dec. 7, 2023, 10:53 a.m. UTC | #13
On 12/6/23 14:07, Manivannan Sadhasivam wrote:
> On Fri, Dec 01, 2023 at 10:29:11PM +0100, Konrad Dybcio wrote:
>> On 1.12.2023 14:25, Krzysztof Kozlowski wrote:
>>> On 01/12/2023 13:30, Manivannan Sadhasivam wrote:
>>>>> What I said before:
>>>>> "Again, third time (once from Bjorn, once from Dmitry), rephrase
>>>>> property name and description to describe the hardware issue. I see
>>>>> description improved, but not the property name. Again in the end of
>>>>> description you say what Linux should do. Bindings do not describe Linux
>>>>> OS."
>>>>>
>>>>
>>>> You didn't answer my question:
>>>>
>>>> "I see a plenty of properties similar to this one instructing the OS to keep some
>>>> resource ON to workaround hardware issues. So they are all wrong?"
>>>
>>> They are not the best, but it all depends on the individual case.
>>>
>>>>
>>>> If you say they are wrong, why are they approved in the first place?
>>> Because we don't have time to keep digging what the driver is doing and
>>> what is claimed in DT. Some people don't even CC us on the driver.
>> Not sure if I asked this before, but can this not be set in the config
>> struct inside the driver?
>>
> 
> This cannot be the default config for any platform as keeping refclk always on
> will have some power penalty. Only if the hardware (EP or board design) has any
> issue, we can turn on this option.
So, if I'm reading this right, this concerns some but not all
8280 boards?

Konrad
Johan Hovold Dec. 7, 2023, 1:36 p.m. UTC | #14
On Thu, Dec 07, 2023 at 06:50:32PM +0530, Manivannan Sadhasivam wrote:
> On Thu, Dec 07, 2023 at 02:05:12PM +0100, Johan Hovold wrote:
> > On Thu, Dec 07, 2023 at 03:42:52PM +0530, Manivannan Sadhasivam wrote:
> > > On Thu, Dec 07, 2023 at 10:51:09AM +0100, Johan Hovold wrote:

> > > > Shouldn't that be
> > > > 
> > > > 	qcom,broken-clkreq
> > > > 
> > > > since its the CLKREQ# signal used to request REFCLK that is broken, not
> > > > the REFCLK itself?
> > > > 
> > > 
> > > Darn... You are right. I got carried away by the initial property name. Thanks
> > > for spotting!
> > 
> > Thinking some more on this after hitting send: It may still be wrong
> > with a 'broken-clkreq' property in the PHY instead of in the controller
> > (or endpoint).
> > 
> > Could there not be other ways to handle a broken clkreq signal so that
> > this really should be a decision made by the OS, for example, to disable
> > L1 substates and clock PM?
> 
> One has to weigh the power consumption between keeping refclk always on and
> disabling L1SS. Chaitanya, can you measure power consumption in both cases?

Sure, my point was just that that's a policy decision and not something
that should be encoded in the devicetree (as was initially proposed).

And that the right place for the renamed property is not necessarily in
the PHY node either.

> > Simply leaving the refclk always on in the PHY seems like a bit of a
> > hack and I'm not even sure that can be considered correct.
> 
> I wouldn't agree it is a hack, even though it may sound like one. The option to
> keep refclk always on in the PHY is precisely there for usecase like this.

I just skimmed the spec so perhaps I'm missing something, but there's
definitely wordings in there that explicitly says that L1 PM substates
must not be enabling unless you have a functioning CLKREQ# signal.

Johan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
index 2c3d6553a7ba..c747c9f35795 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
@@ -93,6 +93,13 @@  properties:
   "#phy-cells":
     const: 0
 
+  qcom,refclk-always-on:
+    type: boolean
+    description: In some platform where PCIe switch is connected, pcie switch due to some design
+      limitation fails to propage clkreq signal to the host and due to that host will not send
+      refclk, which  results in linkdown in L1.2 or L1.1 exit initiated by EP.
+      This property if set keeps refclk always on even in Low power states.
+
 required:
   - compatible
   - reg