diff mbox series

[1/2] dt-bindings: iommu/rockchip: Make clock properties optional

Message ID 20180410092612.2653-2-heiko@sntech.de
State Rejected, archived
Headers show
Series iommu/rockchip: fix clock handling to not break old dts | expand

Commit Message

Heiko Stuebner April 10, 2018, 9:26 a.m. UTC
Rockchip IOMMUs are used without explicit clock handling for 4 years
now, so we should keep compatibility with old devicetrees if possible.
Therefore make iommu clocks optional.

Fixes: 8fa9eb39c614 ("dt-bindings: iommu/rockchip: Add clock property")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 Documentation/devicetree/bindings/iommu/rockchip,iommu.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Robin Murphy April 10, 2018, 11:18 a.m. UTC | #1
On 10/04/18 10:26, Heiko Stuebner wrote:
> Rockchip IOMMUs are used without explicit clock handling for 4 years
> now, so we should keep compatibility with old devicetrees if possible.
> Therefore make iommu clocks optional.

Do we need to touch the binding itself? Obviously the driver has to 
treat clocks as optional in existing DTs (and I feel a bit dumb now for 
managing to overlook that in review), but the binding effectively only 
covers future DTs, and I'd assume we want to encourage the clocks to be 
correctly specified there.

Robin.

> Fixes: 8fa9eb39c614 ("dt-bindings: iommu/rockchip: Add clock property")
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>   Documentation/devicetree/bindings/iommu/rockchip,iommu.txt | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt b/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt
> index 6ecefea1c6f9..25bfad987513 100644
> --- a/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt
> +++ b/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt
> @@ -14,13 +14,13 @@ Required properties:
>                       "single-master" device, and needs no additional information
>                       to associate with its master device.  See:
>                       Documentation/devicetree/bindings/iommu/iommu.txt
> +
> +Optional properties:
>   - clocks          : A list of clocks required for the IOMMU to be accessible by
>                       the host CPU.
>   - clock-names     : Should contain the following:
>   	"iface" - Main peripheral bus clock (PCLK/HCL) (required)
>   	"aclk"  - AXI bus clock (required)
> -
> -Optional properties:
>   - rockchip,disable-mmu-reset : Don't use the mmu reset operation.
>   			       Some mmu instances may produce unexpected results
>   			       when the reset operation is used.
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Heiko Stuebner April 10, 2018, 11:26 a.m. UTC | #2
Hi Robin,

Am Dienstag, 10. April 2018, 13:18:48 CEST schrieb Robin Murphy:
> On 10/04/18 10:26, Heiko Stuebner wrote:
> > Rockchip IOMMUs are used without explicit clock handling for 4 years
> > now, so we should keep compatibility with old devicetrees if possible.
> > Therefore make iommu clocks optional.
> 
> Do we need to touch the binding itself? Obviously the driver has to 
> treat clocks as optional in existing DTs (and I feel a bit dumb now for 
> managing to overlook that in review), but the binding effectively only 
> covers future DTs, and I'd assume we want to encourage the clocks to be 
> correctly specified there.

I guess that depends on your definition of the timespan for backwards
compatibility. I'm always starting out at indefinite till convinced
otherwise ;-). Hence the clocks would need to stay optional for (nearly)
forever.

Also, having the binding claim them as required but the code handling
them as optional just calls for someone to remove the optional handling :-D

Not sure if there is a established way of saying
"we want this for all future devices, but allow it to be missing for old dts".


Heiko
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring (Arm) April 13, 2018, 9:02 p.m. UTC | #3
On Tue, Apr 10, 2018 at 01:26:41PM +0200, Heiko Stuebner wrote:
> Hi Robin,
> 
> Am Dienstag, 10. April 2018, 13:18:48 CEST schrieb Robin Murphy:
> > On 10/04/18 10:26, Heiko Stuebner wrote:
> > > Rockchip IOMMUs are used without explicit clock handling for 4 years
> > > now, so we should keep compatibility with old devicetrees if possible.
> > > Therefore make iommu clocks optional.
> > 
> > Do we need to touch the binding itself? Obviously the driver has to 
> > treat clocks as optional in existing DTs (and I feel a bit dumb now for 
> > managing to overlook that in review), but the binding effectively only 
> > covers future DTs, and I'd assume we want to encourage the clocks to be 
> > correctly specified there.

I'd prefer the DT docs reflect what is correct for new/current dts 
files. That's the only way the docs can validate the dts files.

> I guess that depends on your definition of the timespan for backwards
> compatibility. I'm always starting out at indefinite till convinced
> otherwise ;-). Hence the clocks would need to stay optional for (nearly)
> forever.
> 
> Also, having the binding claim them as required but the code handling
> them as optional just calls for someone to remove the optional handling :-D

A comment in the code saying why missing clocks are allowed should 
suffice.

> Not sure if there is a established way of saying
> "we want this for all future devices, but allow it to be missing for old dts".

We don't really...

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Heiko Stuebner April 17, 2018, 12:01 p.m. UTC | #4
Am Freitag, 13. April 2018, 23:02:26 CEST schrieb Rob Herring:
> On Tue, Apr 10, 2018 at 01:26:41PM +0200, Heiko Stuebner wrote:
> > Hi Robin,
> > 
> > Am Dienstag, 10. April 2018, 13:18:48 CEST schrieb Robin Murphy:
> > > On 10/04/18 10:26, Heiko Stuebner wrote:
> > > > Rockchip IOMMUs are used without explicit clock handling for 4 years
> > > > now, so we should keep compatibility with old devicetrees if possible.
> > > > Therefore make iommu clocks optional.
> > > 
> > > Do we need to touch the binding itself? Obviously the driver has to 
> > > treat clocks as optional in existing DTs (and I feel a bit dumb now for 
> > > managing to overlook that in review), but the binding effectively only 
> > > covers future DTs, and I'd assume we want to encourage the clocks to be 
> > > correctly specified there.
> 
> I'd prefer the DT docs reflect what is correct for new/current dts 
> files. That's the only way the docs can validate the dts files.
> 
> > I guess that depends on your definition of the timespan for backwards
> > compatibility. I'm always starting out at indefinite till convinced
> > otherwise ;-). Hence the clocks would need to stay optional for (nearly)
> > forever.
> > 
> > Also, having the binding claim them as required but the code handling
> > them as optional just calls for someone to remove the optional handling :-D
> 
> A comment in the code saying why missing clocks are allowed should 
> suffice.
> 
> > Not sure if there is a established way of saying
> > "we want this for all future devices, but allow it to be missing for old dts".
> 
> We don't really...

Ok, I'll drop the binding change and add a code comment then.


Heiko
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt b/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt
index 6ecefea1c6f9..25bfad987513 100644
--- a/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt
+++ b/Documentation/devicetree/bindings/iommu/rockchip,iommu.txt
@@ -14,13 +14,13 @@  Required properties:
                     "single-master" device, and needs no additional information
                     to associate with its master device.  See:
                     Documentation/devicetree/bindings/iommu/iommu.txt
+
+Optional properties:
 - clocks          : A list of clocks required for the IOMMU to be accessible by
                     the host CPU.
 - clock-names     : Should contain the following:
 	"iface" - Main peripheral bus clock (PCLK/HCL) (required)
 	"aclk"  - AXI bus clock (required)
-
-Optional properties:
 - rockchip,disable-mmu-reset : Don't use the mmu reset operation.
 			       Some mmu instances may produce unexpected results
 			       when the reset operation is used.