All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Johan Jonker <jbx6244@gmail.com>,
	Luis de Arquer <ldearquer@gmail.com>,
	broonie@kernel.org
Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, heiko@sntech.de, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v1] spi: dt-bindings: spi-rockchip: restrict num-cs
Date: Tue, 23 Jan 2024 17:45:20 +0000	[thread overview]
Message-ID: <97fcde65-9eb0-44e1-a87a-caa308d1998b@arm.com> (raw)
In-Reply-To: <344a3de8-7f10-46f0-9524-dca58ceda671@gmail.com>

On 23/01/2024 10:49 am, Johan Jonker wrote:
> 
> 
> On 1/23/24 10:17, Luis de Arquer wrote:
>> On 1/22/24 23:59, Johan Jonker wrote:
>>> In the driver spi-rockchip.c max_native_cs is limited to 4 and the
>>> default num-cs property is 1. Restrict num-cs in spi-rockchip.yaml.
>>>
>>
> 
>> Doesn't num-cs include gpio chip selects too?
>> I have a setup with num-cs = <12> which uses non-native cs-gpios just fine
> 
> Given that bindings and Linux drivers capabilities are 2 separate things.

Er, that's the whole point - bindings and drivers *are* separate things, 
and bindings do not describe drivers. Not least since the fundamental 
model is to have one canonical binding for multiple different drivers to 
consume.

There seems to be some ambiguity as to whether the common "num-cs" 
property is supposed to describe the number of dedicated hardware 
chipselects or the total number including additional GPIOs, but either 
way this change appears to be objectively wrong - if it's the former 
than the comment in the driver plus a survey of a few TRMs implies that 
the maximum number of hardware lines is 2; if it's the latter then 
obviously it's valid for a platform to wire up 3 or more additional 
GPIOs as desired, and for a DT to accurately describe that, regardless 
of whether any particular consumer happens to support it yet or not. For 
example, AFAICS the U-Boot and FreeBSD drivers for Rockchip SPI appear 
not to support GPIO chipselects at all.

Thanks,
Robin.

> However this document has also a purpose that must notify mainline maintainers if users submit bogus DT values.
> Currently that limit is set to 4 in the mainline driver.
> You are free to submit a real board file/patch serie afterwords as proof for review with 12 spi chips and then adjust this limit and increase ROCKCHIP_SPI_MAX_CS_NUM.
> 
> Johan
> 
>>
>> Luis
>>
>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>> ---
>>>    Documentation/devicetree/bindings/spi/spi-rockchip.yaml | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.yaml b/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> index e4941e9212d1..00d555bcbad3 100644
>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> @@ -65,6 +65,11 @@ properties:
>>>          - const: tx
>>>          - const: rx
>>>
>>> +  num-cs:
>>> +    default: 1
>>> +    minimum: 1
>>> +    maximum: 4
>>> +
>>>      rx-sample-delay-ns:
>>>        default: 0
>>>        description:
>>> -- 
>>> 2.39.2
>>>
>>>
>>> _______________________________________________
>>> Linux-rockchip mailing list
>>> Linux-rockchip@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>>
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Johan Jonker <jbx6244@gmail.com>,
	Luis de Arquer <ldearquer@gmail.com>,
	broonie@kernel.org
Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, heiko@sntech.de, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v1] spi: dt-bindings: spi-rockchip: restrict num-cs
Date: Tue, 23 Jan 2024 17:45:20 +0000	[thread overview]
Message-ID: <97fcde65-9eb0-44e1-a87a-caa308d1998b@arm.com> (raw)
In-Reply-To: <344a3de8-7f10-46f0-9524-dca58ceda671@gmail.com>

On 23/01/2024 10:49 am, Johan Jonker wrote:
> 
> 
> On 1/23/24 10:17, Luis de Arquer wrote:
>> On 1/22/24 23:59, Johan Jonker wrote:
>>> In the driver spi-rockchip.c max_native_cs is limited to 4 and the
>>> default num-cs property is 1. Restrict num-cs in spi-rockchip.yaml.
>>>
>>
> 
>> Doesn't num-cs include gpio chip selects too?
>> I have a setup with num-cs = <12> which uses non-native cs-gpios just fine
> 
> Given that bindings and Linux drivers capabilities are 2 separate things.

Er, that's the whole point - bindings and drivers *are* separate things, 
and bindings do not describe drivers. Not least since the fundamental 
model is to have one canonical binding for multiple different drivers to 
consume.

There seems to be some ambiguity as to whether the common "num-cs" 
property is supposed to describe the number of dedicated hardware 
chipselects or the total number including additional GPIOs, but either 
way this change appears to be objectively wrong - if it's the former 
than the comment in the driver plus a survey of a few TRMs implies that 
the maximum number of hardware lines is 2; if it's the latter then 
obviously it's valid for a platform to wire up 3 or more additional 
GPIOs as desired, and for a DT to accurately describe that, regardless 
of whether any particular consumer happens to support it yet or not. For 
example, AFAICS the U-Boot and FreeBSD drivers for Rockchip SPI appear 
not to support GPIO chipselects at all.

Thanks,
Robin.

> However this document has also a purpose that must notify mainline maintainers if users submit bogus DT values.
> Currently that limit is set to 4 in the mainline driver.
> You are free to submit a real board file/patch serie afterwords as proof for review with 12 spi chips and then adjust this limit and increase ROCKCHIP_SPI_MAX_CS_NUM.
> 
> Johan
> 
>>
>> Luis
>>
>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>> ---
>>>    Documentation/devicetree/bindings/spi/spi-rockchip.yaml | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.yaml b/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> index e4941e9212d1..00d555bcbad3 100644
>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> @@ -65,6 +65,11 @@ properties:
>>>          - const: tx
>>>          - const: rx
>>>
>>> +  num-cs:
>>> +    default: 1
>>> +    minimum: 1
>>> +    maximum: 4
>>> +
>>>      rx-sample-delay-ns:
>>>        default: 0
>>>        description:
>>> -- 
>>> 2.39.2
>>>
>>>
>>> _______________________________________________
>>> Linux-rockchip mailing list
>>> Linux-rockchip@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>>
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com>
To: Johan Jonker <jbx6244@gmail.com>,
	Luis de Arquer <ldearquer@gmail.com>,
	broonie@kernel.org
Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, heiko@sntech.de, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v1] spi: dt-bindings: spi-rockchip: restrict num-cs
Date: Tue, 23 Jan 2024 17:45:20 +0000	[thread overview]
Message-ID: <97fcde65-9eb0-44e1-a87a-caa308d1998b@arm.com> (raw)
In-Reply-To: <344a3de8-7f10-46f0-9524-dca58ceda671@gmail.com>

On 23/01/2024 10:49 am, Johan Jonker wrote:
> 
> 
> On 1/23/24 10:17, Luis de Arquer wrote:
>> On 1/22/24 23:59, Johan Jonker wrote:
>>> In the driver spi-rockchip.c max_native_cs is limited to 4 and the
>>> default num-cs property is 1. Restrict num-cs in spi-rockchip.yaml.
>>>
>>
> 
>> Doesn't num-cs include gpio chip selects too?
>> I have a setup with num-cs = <12> which uses non-native cs-gpios just fine
> 
> Given that bindings and Linux drivers capabilities are 2 separate things.

Er, that's the whole point - bindings and drivers *are* separate things, 
and bindings do not describe drivers. Not least since the fundamental 
model is to have one canonical binding for multiple different drivers to 
consume.

There seems to be some ambiguity as to whether the common "num-cs" 
property is supposed to describe the number of dedicated hardware 
chipselects or the total number including additional GPIOs, but either 
way this change appears to be objectively wrong - if it's the former 
than the comment in the driver plus a survey of a few TRMs implies that 
the maximum number of hardware lines is 2; if it's the latter then 
obviously it's valid for a platform to wire up 3 or more additional 
GPIOs as desired, and for a DT to accurately describe that, regardless 
of whether any particular consumer happens to support it yet or not. For 
example, AFAICS the U-Boot and FreeBSD drivers for Rockchip SPI appear 
not to support GPIO chipselects at all.

Thanks,
Robin.

> However this document has also a purpose that must notify mainline maintainers if users submit bogus DT values.
> Currently that limit is set to 4 in the mainline driver.
> You are free to submit a real board file/patch serie afterwords as proof for review with 12 spi chips and then adjust this limit and increase ROCKCHIP_SPI_MAX_CS_NUM.
> 
> Johan
> 
>>
>> Luis
>>
>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>> ---
>>>    Documentation/devicetree/bindings/spi/spi-rockchip.yaml | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.yaml b/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> index e4941e9212d1..00d555bcbad3 100644
>>> --- a/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.yaml
>>> @@ -65,6 +65,11 @@ properties:
>>>          - const: tx
>>>          - const: rx
>>>
>>> +  num-cs:
>>> +    default: 1
>>> +    minimum: 1
>>> +    maximum: 4
>>> +
>>>      rx-sample-delay-ns:
>>>        default: 0
>>>        description:
>>> -- 
>>> 2.39.2
>>>
>>>
>>> _______________________________________________
>>> Linux-rockchip mailing list
>>> Linux-rockchip@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>>
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2024-01-23 17:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 22:59 [PATCH v1] spi: dt-bindings: spi-rockchip: restrict num-cs Johan Jonker
2024-01-22 22:59 ` Johan Jonker
2024-01-22 22:59 ` Johan Jonker
2024-01-23  8:33 ` Krzysztof Kozlowski
2024-01-23  8:33   ` Krzysztof Kozlowski
2024-01-23  8:33   ` Krzysztof Kozlowski
2024-01-23  9:17 ` Luis de Arquer
2024-01-23  9:17   ` Luis de Arquer
2024-01-23  9:17   ` Luis de Arquer
2024-01-23 10:49   ` Johan Jonker
2024-01-23 10:49     ` Johan Jonker
2024-01-23 10:49     ` Johan Jonker
2024-01-23 13:51     ` Luis de Arquer
2024-01-23 13:51       ` Luis de Arquer
2024-01-23 13:51       ` Luis de Arquer
2024-01-23 17:45     ` Robin Murphy [this message]
2024-01-23 17:45       ` Robin Murphy
2024-01-23 17:45       ` Robin Murphy
2024-01-26 19:23       ` Luis de Arquer
2024-01-26 19:23         ` Luis de Arquer
2024-01-26 19:23         ` Luis de Arquer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97fcde65-9eb0-44e1-a87a-caa308d1998b@arm.com \
    --to=robin.murphy@arm.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=jbx6244@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=ldearquer@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.