Thread (53 messages) 53 messages, 5 authors, 2018-02-23

Re: [PATCH v7 2/6] iommu/arm-smmu: Add pm_runtime/sleep ops

From: Tomasz Figa <tfiga@chromium.org>
Date: 2018-02-14 03:45:09
Also in: dri-devel, linux-arm-msm, linux-iommu, linux-pm, lkml

On Tue, Feb 13, 2018 at 7:25 PM, Vivek Gautam
[off-list ref] wrote:
quoted
quoted
+static int arm_smmu_init_clks(struct arm_smmu_device *smmu)
+{
+       int i;
+       int num = smmu->num_clks;
+       const struct arm_smmu_match_data *data;
+
+       if (num < 1)
+               return 0;
+
+       smmu->clocks = devm_kcalloc(smmu->dev, num,
+                                   sizeof(*smmu->clocks), GFP_KERNEL);
+       if (!smmu->clocks)
+               return -ENOMEM;
+
+       data = of_device_get_match_data(smmu->dev);
+
+       for (i = 0; i < num; i++)
+               smmu->clocks[i].id = data->clks[i];
I'd argue that arm_smmu_device_dt_probe() is a better place for all
the code above, since this function is called regardless of whether
the device is probed from DT or not. Going further,
arm_smmu_device_acpi_probe() could fill smmu->num_clks and ->clocks
using ACPI-like way (as opposed to OF match data) if necessary.
Right, it's valid to fill the data in arm_smmu_device_dt_probe().
Perhaps we can just keep the devm_clk_bulk_get() in arm_smmu_device_probe()
at the point where we are currently doing arm_smmu_init_clks().
Sounds good to me. Thanks.

Best regards,
Tomasz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help