Received: by 10.213.65.68 with SMTP id h4csp3733550imn; Tue, 10 Apr 2018 03:58:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx49JKXyONedCT/elMrZ57CyX6aU8ZGg+q4DTD/zFdDuQ1mLMNDkSAZwXjpULgoV+kUyao7z5 X-Received: by 10.98.11.149 with SMTP id 21mr2348241pfl.64.1523357934477; Tue, 10 Apr 2018 03:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523357934; cv=none; d=google.com; s=arc-20160816; b=nhoQ/7evm7D68yNDuilX1eUmsUmDwGcaWz/RuQXIQhhKMThiC9LoUWF2BV9P0ZHkHs w0Z2dZXRX7yR7vr7Shthk1PwB6wRWlKkl/M6SS5bUu821a00Ax0Zv+NbewZPVCP8neFz gaMVkqIafKZF0UI0QqqxlvDPQdXSndU0DOdxhB+ZU8ysBVQN9eqBObWV25ZiDDEnRjFU EaL/W11aTUk6nc9vsKbm60NAsuhuvSc5EDWSNjvhrj2UkrU2BWaLrSnLoXalvdfjmdTy BqBpzJ8uT8TqQqzmgY6ZP7dCbZ2ocz1+NcZoWJ33Z5aCffYvlnOVqwdKMXhxjaQK651R fecg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fAwu3OadJhVGnQ4gmR18FWGvs7Oz97vZemaoszMgPYY=; b=nP7S5pBCfYVbg4AgGmCGNGQ+yMMpSiGyFeavNMFQw18i/PpIWJUrFVfEbRslefAPkN riTPeLSO+kWIg/OPvJ+nU9HWRRcsl1bX8pKXTfIcA9W+n9ZqQ/W1EIm2RcBZK2u5axaZ JHucxm983YR4iCkvkMS5zZqK+/GCfZz0QO/GO123qMNXVWLkB3suUrxsjdeNFm1DJhm1 bAfHz/Vzu/8IiE5mbuotMgNMJ5VGwbE8lNKmG1h8fYFOLE8RuxE1EmY45ES7hdBkO8Sk fkRPMMeQP3ekW8EbPVj7a/4SuoQduccxDsS6rucuvVUfvJgpqG/ZeDmZejYq2qyrM2LI Z6lQ== 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 r4si1654002pgt.7.2018.04.10.03.58.17; Tue, 10 Apr 2018 03:58:54 -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 S1752761AbeDJKyf convert rfc822-to-8bit (ORCPT + 99 others); Tue, 10 Apr 2018 06:54:35 -0400 Received: from gloria.sntech.de ([95.129.55.99]:49974 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752333AbeDJKyd (ORCPT ); Tue, 10 Apr 2018 06:54:33 -0400 Received: from wd0542.dip.tu-dresden.de ([141.76.110.30] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1f5qut-0003LZ-2y; Tue, 10 Apr 2018 12:54:23 +0200 From: Heiko Stuebner To: Robin Murphy Cc: Tomeu Vizoso , 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 Subject: Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes Date: Tue, 10 Apr 2018 12:54:17 +0200 Message-ID: <1720770.fWGWCFZ36p@phil> In-Reply-To: <5686492.Vgpi8vPSL1@diego> References: <20180323073814.5802-1-jeffy.chen@rock-chips.com> <2255884.b1SkkUdh3X@diego> <5686492.Vgpi8vPSL1@diego> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Montag, 9. April 2018, 23:49:58 CEST schrieb Heiko St?bner: > Am Montag, 9. April 2018, 17:55:40 CEST schrieb Heiko St?bner: > > 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 ;-) > > In any case, this does not seem to fully fix the issue ... or be more exact > seems to be the only issue. > > - With 4.16 both pinky and kevin have working displays. > - When I was merging display patches to drm-misc, I did boot-tests on > both pinky and kevin, keeping their displays in a working state. > > - With current torvalds head (iommu not merged yet) > e9092d0d9796 ("Fix subtle macro variable shadowing in min_not_zero()") > > I get display output on rk3399-kevin (edp), but not on > rk3288-pinky (edp + hdmi). [components + hdmi device+modes get > recognized correctly though] > > - With iommu changes merged I end up with the failing clock issue > which can be countered by making the iommu-clocks optional. > > - After that I get working display output again on kevin but not pinky. > > Looks like this needs bisecting. And it seems the dwc2 vbus thingy was responsible for the other issue I saw. With Tomeus fixup patch applied and the series I sent an hour ago, I now get display output again on both kevin (rk3399) and pinky (rk3288). Heiko