iommu/rockchip: make clock handling optional
Subsystems (2)
PATCH v2 1/1 iommu/rockchip: make clock handling optional
iommu clocks are optional, so the driver should not fail if they are not present. Instead just set the number of clocks to 0, which the clk-blk APIs can handle just fine.
---
changes in v2:
- keep it required in the binding for future variants but optional in the code for backwards compatiblity
- follow Robin Murphy's beautification suggestion
As the original changes breaks a lot of display support in 4.17-rc1, this should abviously go in as fix into 4.17.
drivers/iommu/rockchip-iommu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/iommu/rockchip-iommu.c +8 -1
@@ -1175,8 +1175,15 @@ static int rk_iommu_probe(struct platform_device *pdev)for (i =0 ; i < iommu->num_clocks; ++i) iommu->clocks[i].id = rk_iommu_clocks[i]; +/* +* iommu clocks should be present for all new devices and devicetrees +* but there are older devicetrees without clocks out in the wild. +* So clocks as optional for the time being. +*/ err =devm_clk_bulk_get (iommu->dev, iommu->num_clocks, iommu->clocks); -if (err) +if (err == -ENOENT ) + iommu->num_clocks =0 ; +else if (err)return err; err =clk_bulk_prepare (iommu->num_clocks, iommu->clocks);
Signature · 1 line
2.16.2
A message that is not in the archive (sent off-list or not yet received): 20180417120915.31535-1-heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org
Enric Balletbo Serra
Tested-by Enric Balletbo i Serra2018-04-17 14:09 GMT+02:00 Heiko Stuebner <[email protected]>:
Quoted 44 lines
iommu clocks are optional, so the driver should not fail if they are not present. Instead just set the number of clocks to 0, which the clk-blk APIs can handle just fine.
Fixes f2e3a5f557ad ("iommu/rockchip: Control clocks needed to access the IOMMU")Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Robin Murphy <[email protected]>---
changes in v2:
- keep it required in the binding for future variants but optional in the code for backwards compatiblity
- follow Robin Murphy's beautification suggestionAs the original changes breaks a lot of display support in 4.17-rc1, this should abviously go in as fix into 4.17.
drivers/iommu/rockchip-iommu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/iommu/rockchip-iommu.c +8
-2@@ -1175,8 +1175,15 @@ static int rk_iommu_probe(struct platform_device *pdev)for (i =0 ; i < iommu->num_clocks; ++i) iommu->clocks[i].id = rk_iommu_clocks[i]; +/* +* iommu clocks should be present for all new devices and devicetrees +* but there are older devicetrees without clocks out in the wild. +* So clocks as optional for the time being. +*/ err =devm_clk_bulk_get (iommu->dev, iommu->num_clocks, iommu->clocks); -if (err) +if (err == -ENOENT ) + iommu->num_clocks =0 ; +else if (err)return err; err =clk_bulk_prepare (iommu->num_clocks, iommu->clocks); --2.16.2
Quoted 4 lines
_______________________________________________
Linux-rockchip mailing list [email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Thanks to this patch my display is back :)
Ho Joerg,
Am Dienstag, 17. April 2018, 14:09:15 CEST schrieb Heiko Stuebner:
Quoted 7 lines
iommu clocks are optional, so the driver should not fail if they are not present. Instead just set the number of clocks to 0, which the clk-blk APIs can handle just fine.
Fixes f2e3a5f557ad ("iommu/rockchip: Control clocks needed to access the IOMMU")Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Robin Murphy <[email protected]>
could you pick up this patch as fix for 4.17 please? As without it, we loose display output with old devicetrees.
Thanks
Heiko
Joerg Roedel
AppliedQuoted 7 lines · Heiko Stuebner
Ho Joerg,
Am Dienstag, 17. April 2018, 14:09:15 CEST schrieb Heiko Stuebner:
Quoted 4 lines
iommu clocks are optional, so the driver should not fail if they are not present. Instead just set the number of clocks to 0, which the clk-blk APIs can handle just fine.
Quoted 6 lines
Quoted 3 lines
Fixes f2e3a5f557ad ("iommu/rockchip: Control clocks needed to access the IOMMU")Signed-off-by Heiko Stuebner <[email protected]>Reviewed-by Robin Murphy <[email protected]>could you pick up this patch as fix for 4.17 please? As without it, we loose display output with old devicetrees.
Applied to the iommu/fixes branch, thanks.