lkml.org 
[lkml]   [2018]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes
Date
Am Montag, 9. April 2018, 17:53:01 CEST schrieb Robin Murphy:
> On 09/04/18 16:44, Heiko Stübner wrote:
> > Hi Tomeu,
> >
> > Am Montag, 9. April 2018, 16:41:56 CEST schrieb Tomeu Vizoso:
> >> in today's linux-next, the DRM driver fails to probe because the iommu
> >> driver fails to find the aclk. I need to apply this patch for things
> >> to work again.
> >
> > Thanks for catching that issue.
> >
> > This seems to expose a backwards-compatibility issue, as this breaks
> > all old devicetrees, so should get a proper fix, apart from me applying
> > the dt-patch I missed.
> >
> > Looking at the iommu-clock-handling patch, I imagine this part as
> > the culprit:
> >
> > + iommu->num_clocks = ARRAY_SIZE(rk_iommu_clocks);
> > + iommu->clocks = devm_kcalloc(iommu->dev, iommu->num_clocks,
> > + sizeof(*iommu->clocks), GFP_KERNEL);
> > + if (!iommu->clocks)
> > + return -ENOMEM;
> >
> > The clk-bulk functions seem to work with simple for loops and
> > should (as the other standard clock functions) just work fine with
> > an empty struct, so I guess a simple
> >
> > if (!iommu->clocks && iommu->num_clocks > 0)
> >
> > return -ENOMEM;
> >
> > should hopefully be enough. I'll try to give this a test later on
> > if nobody beats me to it :-)
>
> But iommu->num_clocks is clearly set to a nonzero compile-time constant
> at this point ;)
>
> I'd assume it's the return from devm_clk_bulk_get() which needs to
> special-case the "no clocks found" case from any other error, and *then*
> blat num_clocks to 0 if so.

you're right of course. Looking at it again, I now clearly see the ARRAY_SIZE
and am wondering what made me think num_clocks would be runtime-read.

Must be those 25°C today ;-)

\
 
 \ /
  Last update: 2018-04-09 17:56    [W:0.059 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site