Received: by 10.213.65.68 with SMTP id h4csp3122609imn; Mon, 9 Apr 2018 14:55:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/MwcKZ6dUyFJZgVhTqVl2tGYtdGO+mc2devH6O4XnDCcZD9uS+b5GIL4ZqQZ9d5zwm72t3 X-Received: by 2002:a17:902:d685:: with SMTP id v5-v6mr3927842ply.284.1523310900995; Mon, 09 Apr 2018 14:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523310900; cv=none; d=google.com; s=arc-20160816; b=Bmm7/GeCRYxvT7ahPe6GUn4pPqklNGSWZw6pgDObYzjvqlmyNic2ZU63PHRXS3qikq YQw9BEsuhy97viqAbsk2DDDsjndTrdeUgg9GCV+NhP5UL+xzHvuChOTEB9tyV0Dn+1/g h12bVDjOPSqWzOquY+I+x98uVljMivsMTM2w9OV0FFo5Obdj+ePj1+z0f6P8x5W0LSI2 bY5MmrtcggHVzAf30QVa4Celg0SyyPURJftC4h6z4GMFhdpKw92flvYTEcQIMiWKKK5N E6nYPH312EIRsT3hPsqjGbQsuh8LxyNtzf/HsFbIJDosFqjCJd4P482CEzjDSwif8oh3 oj+Q== 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=ZjizZfCPH6aKL9i+s+GKKPlZQYMEoaKpNPUjFQgKtms=; b=JkT9ONdArJ/lH8Jgu+SXgU+tKgaazkOZxftRZpKl0b8JP+2ur5u3Liyvtk9BO1/qB2 D7T3Z9TPoR1MULwFzieMxHLGHDAiEjwX+hoWrElnt5p/KZLsb87AV0ucYiB3OHPh+6BS 3Vsj+m/nYPEbr0P1+IhCbNQFBNCDaP46IerYfYiKGZ6xQ4+xu06uQ2aodMHWbxb6xrP6 cUAUIkoIYyXx75h3x+qv3Z8vIC0E3G9BLBX7lseZd7rrFnDqrTgq71jf9WuSas+d69mp LACD4oiBjPzFSOQA/RnCSXMA6oD5pTCsIKT7lLIxPYU+n/8/XHmEZYe9XXwJbJiw8BFj asKQ== 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 u25si871496pfh.145.2018.04.09.14.54.21; Mon, 09 Apr 2018 14:55:00 -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 S1752369AbeDIVuL convert rfc822-to-8bit (ORCPT + 99 others); Mon, 9 Apr 2018 17:50:11 -0400 Received: from gloria.sntech.de ([95.129.55.99]:39302 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505AbeDIVuK (ORCPT ); Mon, 9 Apr 2018 17:50:10 -0400 Received: from ip9234b810.dynamic.kabel-deutschland.de ([146.52.184.16] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1f5efn-00084J-3G; Mon, 09 Apr 2018 23:49:59 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= 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: Mon, 09 Apr 2018 23:49:58 +0200 Message-ID: <5686492.Vgpi8vPSL1@diego> In-Reply-To: <2255884.b1SkkUdh3X@diego> References: <20180323073814.5802-1-jeffy.chen@rock-chips.com> <2255884.b1SkkUdh3X@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, 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.