Update regex to allow multi-worded OPP entry names.
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml
index a27ba7b663d456f964628a91a661b51a684de1be..bba95799919eb52d12afa42354ed909d0ef3c627 100644
--- a/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml
+++ b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml
@@ -23,7 +23,7 @@ properties:
const: operating-points-v2-adreno
patternProperties:
- '^opp-[0-9]+$':
+ '^opp(-?[0-9]+)*$':
type: object
additionalProperties: false
--
2.48.1
On 11/06/2025 13:15, Akhil P Oommen wrote: > Update regex to allow multi-worded OPP entry names. Why would we want multi-worded? This needs to be explained here. > > Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com> > --- > Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml > index a27ba7b663d456f964628a91a661b51a684de1be..bba95799919eb52d12afa42354ed909d0ef3c627 100644 > --- a/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml > +++ b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml > @@ -23,7 +23,7 @@ properties: > const: operating-points-v2-adreno > > patternProperties: > - '^opp-[0-9]+$': > + '^opp(-?[0-9]+)*$': Not correct regex. You allow "opp", "opp1" and all other unusual variants. Commit does not explain what problem you are solving, so I have no clue what you want here, but for sure opp1 is wrong. Best regards, Krzysztof
On 6/11/2025 4:50 PM, Krzysztof Kozlowski wrote: > On 11/06/2025 13:15, Akhil P Oommen wrote: >> Update regex to allow multi-worded OPP entry names. > > Why would we want multi-worded? This needs to be explained here. I took the new regex from "opp-v2-base.yaml" file, so I thought it was obvious enough. The requirement is that sometimes Adreno GPU may require variants of OPP entries with same frequency. As an example, we may want to vote different peak bandwidths in different SKUs for the same GPU frequency. So to denote this minor variation, we can add an integer suffix to the OPP entry name separated by '-'. An example from another patch in this series: opp-666000000-0 { opp-hz = /bits/ 64 <666000000>; opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>; opp-peak-kBps = <8171875>; qcom,opp-acd-level = <0xa82d5ffd>; opp-supported-hw = <0xf>; }; /* Only applicable for SKUs which has 666Mhz as Fmax */ opp-666000000-1 { opp-hz = /bits/ 64 <666000000>; opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>; opp-peak-kBps = <16500000>; qcom,opp-acd-level = <0xa82d5ffd>; opp-supported-hw = <0x10>; }; I will add this explanation in the commit text in the next revision. > > >> >> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com> >> --- >> Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml >> index a27ba7b663d456f964628a91a661b51a684de1be..bba95799919eb52d12afa42354ed909d0ef3c627 100644 >> --- a/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml >> +++ b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml >> @@ -23,7 +23,7 @@ properties: >> const: operating-points-v2-adreno >> >> patternProperties: >> - '^opp-[0-9]+$': >> + '^opp(-?[0-9]+)*$': > > Not correct regex. You allow "opp", "opp1" and all other unusual > variants. Commit does not explain what problem you are solving, so I > have no clue what you want here, but for sure opp1 is wrong. Just to confirm, would this be fine for the requirement I mentioned above? "'^opp(-[0-9]+)*$'" -Akhil. > > > Best regards, > Krzysztof
On 11/06/2025 14:24, Akhil P Oommen wrote: >>> >>> patternProperties: >>> - '^opp-[0-9]+$': >>> + '^opp(-?[0-9]+)*$': >> >> Not correct regex. You allow "opp", "opp1" and all other unusual >> variants. Commit does not explain what problem you are solving, so I >> have no clue what you want here, but for sure opp1 is wrong. > > Just to confirm, would this be fine for the requirement I mentioned above? > > "'^opp(-[0-9]+)*$'" No, You did not solve half of the problems - still allows "opp" and commit msg does not explain why "opp" is now correct. Describe the actual problem and then write the regex solving it in specific way, not causing other effects. Best regards, Krzysztof
On 6/12/2025 4:59 PM, Krzysztof Kozlowski wrote: > On 11/06/2025 14:24, Akhil P Oommen wrote: >>>> >>>> patternProperties: >>>> - '^opp-[0-9]+$': >>>> + '^opp(-?[0-9]+)*$': >>> >>> Not correct regex. You allow "opp", "opp1" and all other unusual >>> variants. Commit does not explain what problem you are solving, so I >>> have no clue what you want here, but for sure opp1 is wrong. >> >> Just to confirm, would this be fine for the requirement I mentioned above? >> >> "'^opp(-[0-9]+)*$'" > > No, You did not solve half of the problems - still allows "opp" and > commit msg does not explain why "opp" is now correct. Describe the > actual problem and then write the regex solving it in specific way, not > causing other effects. Gotcha. If we want to be super strict, the regex should be: ^opp(-[0-9]+){1,2}$ I will send out a new patch. -Akhil > > Best regards, > Krzysztof
On Mon, Jun 16, 2025 at 10:18:24PM GMT, Akhil P Oommen wrote: > On 6/12/2025 4:59 PM, Krzysztof Kozlowski wrote: > > On 11/06/2025 14:24, Akhil P Oommen wrote: > >>>> > >>>> patternProperties: > >>>> - '^opp-[0-9]+$': > >>>> + '^opp(-?[0-9]+)*$': > >>> > >>> Not correct regex. You allow "opp", "opp1" and all other unusual > >>> variants. Commit does not explain what problem you are solving, so I > >>> have no clue what you want here, but for sure opp1 is wrong. > >> > >> Just to confirm, would this be fine for the requirement I mentioned above? > >> > >> "'^opp(-[0-9]+)*$'" > > > > No, You did not solve half of the problems - still allows "opp" and > > commit msg does not explain why "opp" is now correct. Describe the > > actual problem and then write the regex solving it in specific way, not > > causing other effects. > > Gotcha. If we want to be super strict, the regex should be: > ^opp(-[0-9]+){1,2}$ > Yes, looks good. Best regards, Krzysztof
© 2016 - 2025 Red Hat, Inc.