lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 14 Mar 2024 13:58:21 +0530
From: Jishnu Prakash <quic_jprakash@...cinc.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>, <jic23@...nel.org>,
        <robh+dt@...nel.org>, <krzysztof.kozlowski+dt@...aro.org>,
        <conor+dt@...nel.org>, <andersson@...nel.org>,
        <konrad.dybcio@...aro.org>, <lee@...nel.org>,
        <andriy.shevchenko@...ux.intel.com>, <daniel.lezcano@...aro.org>,
        <dmitry.baryshkov@...aro.org>
CC: <lars@...afoo.de>, <luca@...tu.xyz>, <marijn.suijten@...ainline.org>,
        <agross@...nel.org>, <sboyd@...nel.org>, <rafael@...nel.org>,
        <rui.zhang@...el.com>, <lukasz.luba@....com>,
        <linus.walleij@...aro.org>, <quic_subbaram@...cinc.com>,
        <quic_collinsd@...cinc.com>, <quic_amelende@...cinc.com>,
        <quic_kamalw@...cinc.com>, <kernel@...cinc.com>,
        <linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-arm-msm-owner@...r.kernel.org>, <linux-iio@...r.kernel.org>,
        <linux-pm@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <cros-qcom-dts-watchers@...omium.org>
Subject: Re: [PATCH v3 2/3] dt-bindings: iio: adc: Add support for QCOM PMIC5
 Gen3 ADC

Hi Krzysztof,

On 2/21/2024 12:49 PM, Krzysztof Kozlowski wrote:
> On 21/02/2024 06:36, Jishnu Prakash wrote:
>> Hi Krzysztof,
>>
>> On 2/17/2024 7:43 PM, Krzysztof Kozlowski wrote:
>>> On 16/02/2024 11:39, Jishnu Prakash wrote:
>>>> Hi Krzysztof,
>>>>


>>
>>> How is this a problem?
>>
>> In qcom,spmi-vadc.yaml, we have the following top-level constraints for
>> the "reg" and "interrupts" properties:
>>
>>     reg:
>>       maxItems: 1
>>
>>     interrupts:
>>       maxItems: 1
>>
>> For the ADC5 Gen3 device being added now, these constraints cannot be
>> followed always, as there may be more than one peripheral under one
>> device instance, each with a corresponding interrupt. For example, the
>> above properties could be like this for a ADC5 Gen3 device:
>>
>>       reg = <0x9000>, <0x9100>;
>>       interrupts = <0x0 0x90 0x1 IRQ_TYPE_EDGE_RISING>,
>>                    <0x0 0x91 0x1 IRQ_TYPE_EDGE_RISING>;
>>
>>
>> I could not overwrite the top-level constraints for the new device
>> "qcom,spmi-adc5-gen3" alone in qcom,spmi-vadc.yaml, so I tried to remove
>> the constraints from the top level and add them back conditionally for
>> all the device types separately, but you told me not to remove them
>> (full message:
>> https://lore.kernel.org/linux-iio/832053f4-bd5d-4e58-81bb-1a8188e7f364@linaro.org/)
> 
> Because top-level widest constraints must stay, but it is not a problem.
> Most of the multi-device bindings work like this. Dozen of Qualcomm. Why
> you cannot do this the same way we do for all Qualcomm devices?
> 

I would like to clarify a point with you related to the top-level 
constraints, as I think I have not asked this exact question earlier.

For these top-level constraints in qcom,spmi-vadc.yaml:

     reg:
       maxItems: 1

     interrupts:
       maxItems: 1

If we add ADC5 Gen3 bindings in the same file, is it acceptable to 
update the top-level constraints to something like this:

     reg:
       minItems: 1
       maxItems: 2

     interrupts:
       minItems: 1
       maxItems: 2

followed by updating maxItems back to 1 for all the earlier existing 
compatibles, using if:then: conditions, like the below example?

   - if:
       properties:
         compatible:
           contains:
             const: qcom,spmi-adc5

     then:
       properties:
         reg:
           maxItems: 1
         interrupts:
           maxItems: 1


If this is acceptable, I'll add ADC5 Gen3 bindings in the same file with 
changes like the above, else I'll add them in a new file after first 
creating a common schema file as you suggested.

Thanks,
Jishnu

>>
>> Since these constraints cannot be modified for a specific new device or
> 
> ???
> 
>> removed, I think the only way to accommodate this new device is to add
>> it in its own new file.
>>
>> Is this a sufficient justification for adding this documentation in a
>> new file or do you have any other suggestions?
> 
> I already gave you the suggestions and you ignored them. Do like we are
> doing for all other drivers. Don't re-invent stuff. Either this fits to
> existing schema or come with common schema (and then provide rationale
> why it does not fit to existing one).
> 
> Best regards,
> Krzysztof
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ