Received: by 10.213.65.68 with SMTP id h4csp2781663imn; Mon, 9 Apr 2018 08:57:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx487mnJj6nxrBRyEh7j6TlD7zpskfaKwYIZBebIZKwkIlPU4Oa96g0it8wMIE3+BXlU/29qN X-Received: by 2002:a17:902:7804:: with SMTP id p4-v6mr39893614pll.17.1523289450582; Mon, 09 Apr 2018 08:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523289450; cv=none; d=google.com; s=arc-20160816; b=uVDylQwAYB5p4W6VVkedHf0QlwkDnjAOIwrw6Eu6EnOVc0/ITR4nETR+8WM319j19y /a7ao1C3Rtl6D5h8rP0QMk9vLziIDufKX19wM1gvz9eh3Gnj3XG7bzCuqdARtNTj3nZj vMf31nv2gVfOeT7V7aPNBGSFa1m7bnXfIJr0KgJXQVp8Z3n5TBttLH+BzAlsBFs6crBv H5phQZIF7cqElpgCjN752Kyh+mwBrNZHpzcvPybyESkaIUxaAMOERuTBGuH9pyMMGnkD S/pwNr7p1c2pYV6hUbWgvF4RxuyX5TsfAudMK+cYN7rwuGxTJS7dELGqtM6LDdMexJ6d xoQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=C//enj1cJe9Ogjj00FXZ8tBHZjLrZXv4WwOcR1V95UU=; b=aYHcYrlDFWvkccSqceu6Pi+cfLnl2ARsWyPOtr64da5lzeNVox9haLnzaNgxP5SYjs C6bNRSMgw0wRTsikXLV+a3YMIHI504ScStUXJvjVRAkFPPfTCrlsDHNklr8ACv+VMfB6 LvX12qXjwpJAuZvN+vAvKB2N2tIv7U228wncQ4wi0JN/RyTfvESLdo5DCdftrnLCsz/P iEdULiGVdCpgm+9Bz9aRhIi8aujmqfERMAC4ZwjT6NtWpQDbaX9IykS1JaNKFzUYDgan 5cOIMJTTtDzo4sIYrxjBjgOsuqIo1KLuzJVmCqEZmiipX+DdOveDDKEI64VPd4pHSS06 9bAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si381854pgn.17.2018.04.09.08.56.51; Mon, 09 Apr 2018 08:57:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753233AbeDIPxK (ORCPT + 99 others); Mon, 9 Apr 2018 11:53:10 -0400 Received: from foss.arm.com ([217.140.101.70]:57912 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbeDIPxI (ORCPT ); Mon, 9 Apr 2018 11:53:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 90633F; Mon, 9 Apr 2018 08:53:07 -0700 (PDT) Received: from [10.1.210.88] (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C826F3F24A; Mon, 9 Apr 2018 08:53:02 -0700 (PDT) Subject: Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes To: =?UTF-8?Q?Heiko_St=c3=bcbner?= , Tomeu Vizoso Cc: Jeffy Chen , open list , jcliang@chromium.org, simon xue , tfiga@chromium.org, Romain Perier , Yakir Yang , Arnd Bergmann , Liang Chen , Rob Herring , Shawn Lin , Catalin Marinas , David Wu , Finley Xiao , Enric Balletbo i Serra , Jacob Chen , Kever Yang , Brian Norris , "open list:ARM/Rockchip SoC..." , Rocky Hao , Will Deacon , Nickey Yang , devicetree@vger.kernel.org, Mark Yao , Russell King , linux-arm-kernel@lists.infradead.org, Sugar Zhang , Caesar Wang , Mark Rutland References: <20180323073814.5802-1-jeffy.chen@rock-chips.com> <20180323073814.5802-8-jeffy.chen@rock-chips.com> <10157755.JROavG9E9U@diego> From: Robin Murphy Message-ID: Date: Mon, 9 Apr 2018 16:53:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <10157755.JROavG9E9U@diego> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.