diff mbox series

[v2,3/8] dt-bindings: media: mediatek,jpeg: Relax IOMMU max item count

Message ID 20241001113052.3124869-4-fshao@chromium.org (mailing list archive)
State New
Headers show
Series MT8188 DT and binding fixes | expand

Commit Message

Fei Shao Oct. 1, 2024, 11:27 a.m. UTC
On MediaTek platforms with Multimedia MMU (M4U), a multimedia hardware
can be assigned with a local arbiter (LARB) which has a maximum of 32
ports for MediaTek's IOMMU infrastructure. That means there can be at
most 32 items in the iommus property in theory.

Instead of relaxing the max item count every time a newly introduced
device tree hits the limit, bump the number to 32 as an one-time effort.

On the other hand, all existing and foreseeable JPEG decoder nodes at
this point have at least 2 IOMMUs, so set minItems to 2 accordingly.

Signed-off-by: Fei Shao <fshao@chromium.org>
---
It's not in the upstream tree yet, but the upcoming MT8188 DT will have
6 IOMMUs in its JPEG decoder. This patch is to pave the way for that.

Changes in v2:
New patch.

 .../devicetree/bindings/media/mediatek-jpeg-decoder.yaml       | 3 ++-
 .../devicetree/bindings/media/mediatek-jpeg-encoder.yaml       | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski Oct. 2, 2024, 6:16 a.m. UTC | #1
On Tue, Oct 01, 2024 at 07:27:21PM +0800, Fei Shao wrote:
> On MediaTek platforms with Multimedia MMU (M4U), a multimedia hardware
> can be assigned with a local arbiter (LARB) which has a maximum of 32
> ports for MediaTek's IOMMU infrastructure. That means there can be at
> most 32 items in the iommus property in theory.
> 
> Instead of relaxing the max item count every time a newly introduced
> device tree hits the limit, bump the number to 32 as an one-time effort.
> 
> On the other hand, all existing and foreseeable JPEG decoder nodes at
> this point have at least 2 IOMMUs, so set minItems to 2 accordingly.
> 
> Signed-off-by: Fei Shao <fshao@chromium.org>
> ---
> It's not in the upstream tree yet, but the upcoming MT8188 DT will have
> 6 IOMMUs in its JPEG decoder. This patch is to pave the way for that.
> 
> Changes in v2:
> New patch.
> 

I do not see any user of this in this patchset.

Best regards,
Krzysztof
Fei Shao Oct. 2, 2024, 11:57 a.m. UTC | #2
On Wed, Oct 2, 2024 at 2:16 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Tue, Oct 01, 2024 at 07:27:21PM +0800, Fei Shao wrote:
> > On MediaTek platforms with Multimedia MMU (M4U), a multimedia hardware
> > can be assigned with a local arbiter (LARB) which has a maximum of 32
> > ports for MediaTek's IOMMU infrastructure. That means there can be at
> > most 32 items in the iommus property in theory.
> >
> > Instead of relaxing the max item count every time a newly introduced
> > device tree hits the limit, bump the number to 32 as an one-time effort.
> >
> > On the other hand, all existing and foreseeable JPEG decoder nodes at
> > this point have at least 2 IOMMUs, so set minItems to 2 accordingly.
> >
> > Signed-off-by: Fei Shao <fshao@chromium.org>
> > ---
> > It's not in the upstream tree yet, but the upcoming MT8188 DT will have
> > 6 IOMMUs in its JPEG decoder. This patch is to pave the way for that.
> >
> > Changes in v2:
> > New patch.
> >
>
> I do not see any user of this in this patchset.
>

Sorry, I was doing more checks before sending out that series.
The particular patch depending on this is now available as
https://lore.kernel.org/all/20241002114614.847553-6-fshao@chromium.org/

Regards,
Fei
Matthias Brugger Oct. 2, 2024, 1:12 p.m. UTC | #3
On 02/10/2024 08:16, Krzysztof Kozlowski wrote:
> On Tue, Oct 01, 2024 at 07:27:21PM +0800, Fei Shao wrote:
>> On MediaTek platforms with Multimedia MMU (M4U), a multimedia hardware
>> can be assigned with a local arbiter (LARB) which has a maximum of 32
>> ports for MediaTek's IOMMU infrastructure. That means there can be at
>> most 32 items in the iommus property in theory.
>>
>> Instead of relaxing the max item count every time a newly introduced
>> device tree hits the limit, bump the number to 32 as an one-time effort.
>>
>> On the other hand, all existing and foreseeable JPEG decoder nodes at
>> this point have at least 2 IOMMUs, so set minItems to 2 accordingly.
>>
>> Signed-off-by: Fei Shao <fshao@chromium.org>
>> ---
>> It's not in the upstream tree yet, but the upcoming MT8188 DT will have
>> 6 IOMMUs in its JPEG decoder. This patch is to pave the way for that.
>>
>> Changes in v2:
>> New patch.
>>
> 
> I do not see any user of this in this patchset.
> 

I'm not sure I understand you: the binding describes the hardware. If it can 
have up to 32 ports, then this should be reflected in the binding.

Regards,
Matthias
Krzysztof Kozlowski Oct. 2, 2024, 1:59 p.m. UTC | #4
On 01/10/2024 13:27, Fei Shao wrote:
> On MediaTek platforms with Multimedia MMU (M4U), a multimedia hardware
> can be assigned with a local arbiter (LARB) which has a maximum of 32
> ports for MediaTek's IOMMU infrastructure. That means there can be at
> most 32 items in the iommus property in theory.
> 
> Instead of relaxing the max item count every time a newly introduced
> device tree hits the limit, bump the number to 32 as an one-time effort.
> 
> On the other hand, all existing and foreseeable JPEG decoder nodes at
> this point have at least 2 IOMMUs, so set minItems to 2 accordingly.
> 
> Signed-off-by: Fei Shao <fshao@chromium.org>
> ---
> It's not in the upstream tree yet, but the upcoming MT8188 DT will have
> 6 IOMMUs in its JPEG decoder. This patch is to pave the way for that.
> 
> Changes in v2:
> New patch.


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Krzysztof Kozlowski Oct. 2, 2024, 2 p.m. UTC | #5
On 02/10/2024 15:12, Matthias Brugger wrote:
> 
> 
> On 02/10/2024 08:16, Krzysztof Kozlowski wrote:
>> On Tue, Oct 01, 2024 at 07:27:21PM +0800, Fei Shao wrote:
>>> On MediaTek platforms with Multimedia MMU (M4U), a multimedia hardware
>>> can be assigned with a local arbiter (LARB) which has a maximum of 32
>>> ports for MediaTek's IOMMU infrastructure. That means there can be at
>>> most 32 items in the iommus property in theory.
>>>
>>> Instead of relaxing the max item count every time a newly introduced
>>> device tree hits the limit, bump the number to 32 as an one-time effort.
>>>
>>> On the other hand, all existing and foreseeable JPEG decoder nodes at
>>> this point have at least 2 IOMMUs, so set minItems to 2 accordingly.
>>>
>>> Signed-off-by: Fei Shao <fshao@chromium.org>
>>> ---
>>> It's not in the upstream tree yet, but the upcoming MT8188 DT will have
>>> 6 IOMMUs in its JPEG decoder. This patch is to pave the way for that.
>>>
>>> Changes in v2:
>>> New patch.
>>>
>>
>> I do not see any user of this in this patchset.
>>
> 
> I'm not sure I understand you: the binding describes the hardware. If it can 
> have up to 32 ports, then this should be reflected in the binding.

Yeah, but people do not describe hardware but drivers. Looking at DTS
clarifies sometimes such cases and avoids lengthy discussions. Plus I
was not really sure if these are IOMMUs for the same device for example
(again: people do weird stuff).

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
index cfabf360f278..a4aacd3eb189 100644
--- a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml
@@ -44,7 +44,8 @@  properties:
     maxItems: 1
 
   iommus:
-    maxItems: 2
+    minItems: 2
+    maxItems: 32
     description: |
       Points to the respective IOMMU block with master port as argument, see
       Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details.
diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml
index 83c020a673d6..5b15f8977f67 100644
--- a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml
@@ -39,7 +39,7 @@  properties:
 
   iommus:
     minItems: 2
-    maxItems: 4
+    maxItems: 32
     description: |
       Points to the respective IOMMU block with master port as argument, see
       Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details.