lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df522a01-6f4a-bb96-4423-19965b078a1b@arm.com>
Date:   Mon, 9 Apr 2018 16:53:01 +0100
From:   Robin Murphy <robin.murphy@....com>
To:     Heiko Stübner <heiko@...ech.de>,
        Tomeu Vizoso <tomeu@...euvizoso.net>
Cc:     Jeffy Chen <jeffy.chen@...k-chips.com>,
        open list <linux-kernel@...r.kernel.org>, jcliang@...omium.org,
        simon xue <xxm@...k-chips.com>, tfiga@...omium.org,
        Romain Perier <romain.perier@...labora.com>,
        Yakir Yang <kuankuan.y@...il.com>,
        Arnd Bergmann <arnd@...db.de>, Liang Chen <cl@...k-chips.com>,
        Rob Herring <robh+dt@...nel.org>,
        Shawn Lin <shawn.lin@...k-chips.com>,
        Catalin Marinas <catalin.marinas@....com>,
        David Wu <david.wu@...k-chips.com>,
        Finley Xiao <finley.xiao@...k-chips.com>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        Jacob Chen <jacob-chen@...wrt.com>,
        Kever Yang <kever.yang@...k-chips.com>,
        Brian Norris <briannorris@...omium.org>,
        "open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
        Rocky Hao <rocky.hao@...k-chips.com>,
        Will Deacon <will.deacon@....com>,
        Nickey Yang <nickey.yang@...k-chips.com>,
        devicetree@...r.kernel.org, Mark Yao <markyao0591@...il.com>,
        Russell King <linux@...linux.org.uk>,
        linux-arm-kernel@...ts.infradead.org,
        Sugar Zhang <sugar.zhang@...k-chips.com>,
        Caesar Wang <wxt@...k-chips.com>,
        Mark Rutland <mark.rutland@....com>
Subject: Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

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.

Robin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ