Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp243045yba; Fri, 5 Apr 2019 05:58:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNgWFlR5dSYnSGnKgF+Js8b+oI59SQI/7+av+7vb1axBmnNkQRzoCA9YKjRLiUKGiqmQls X-Received: by 2002:a63:66c1:: with SMTP id a184mr11819027pgc.60.1554469130185; Fri, 05 Apr 2019 05:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554469130; cv=none; d=google.com; s=arc-20160816; b=hRe7j+pbGpBKb1ao8c9LO9nXBgq88O7FfsxodqymvShNhFD6otKpuNfl1DExUCapaH UMCYCpFq6fWYOdf9da3PSRigxW9xjgju457a0DDiUtNqqauxMbRujqTeyeQ/+7M+GfTd O/1cZRJ/dA5IrV8Yqb4/WPV46CrDnc/aAB2PqHygYyOdoiNjvRNq0KjRMHUbq4hcjjtn vCB7ZCBa5Si9rVG+F7D0mCslcAiBsyRVApCJZLJQX8SdEtR+QSRZMvDu3i+49grxHkuV 3trszzu+DFOPcABczi1YLUnI4Kpc0XIsr+BCLLX960irv8YsdiJXh/mMQ8He/aa+WLp9 n8IA== 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; bh=91wepAR3rCud2Gk+lSQVCgjWMDpCy6zdlA5m1Z2+6oQ=; b=bDH4g7yLbemQaJOkWc8uA4Y0mmVkH+OTFl9hcQGNncLSsLXMNj2TDizs48rEYa5mhQ CtOZ+YittLnpmwC/8mHTRHpuGS7WYos1rfWipUpsId4VnJkaIjasklsxVe9yM5TMZSp6 Tn53Shx978DdvvqxqaNS0d7IAWFb9MlZHqHQIRZdNK+TT9nQLC9i2y8StIgWt/qB9D/+ sKQwRIrIuiHI6ubgHfg9z8/C2YhgkgP/9SpvijgGk8cqkrrRZHSdMdDNgw1iuH2PKfqn P4QN41MEs39mkXdQNXGimIS0/5oERn/kwux2vs2EbZvQlAbIU5lwRcJEaoJY/jHeeqX+ Wrzw== 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 t7si18504995plo.163.2019.04.05.05.58.34; Fri, 05 Apr 2019 05:58:50 -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 S1730650AbfDEM5b (ORCPT + 99 others); Fri, 5 Apr 2019 08:57:31 -0400 Received: from foss.arm.com ([217.140.101.70]:48226 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfDEM5b (ORCPT ); Fri, 5 Apr 2019 08:57:31 -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 A9ECE1688; Fri, 5 Apr 2019 05:57:30 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D57923F557; Fri, 5 Apr 2019 05:57:27 -0700 (PDT) Subject: Re: [PATCH v2 3/3] drm/panfrost: Add initial panfrost driver To: Rob Herring Cc: dri-devel , "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Will Deacon , Joerg Roedel , Linux IOMMU , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , Alyssa Rosenzweig , Lyude Paul , Eric Anholt , Neil Armstrong , "Marty E . Plummer" , Tomeu Vizoso References: <20190401074730.12241-1-robh@kernel.org> <20190401074730.12241-4-robh@kernel.org> <6ce32759-ea83-ee79-33d3-237737f7b866@arm.com> From: Robin Murphy Message-ID: Date: Fri, 5 Apr 2019 13:57:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/04/2019 05:57, Rob Herring wrote: [...] >>> +static int panfrost_clk_init(struct panfrost_device *pfdev) >>> +{ >>> + int err; >>> + unsigned long rate; >>> + >>> + pfdev->clock = devm_clk_get(pfdev->dev, NULL); >>> + if (IS_ERR(pfdev->clock)) { >> >> The DT binding says clocks are optional, but this doesn't treat them as >> such. > > Hum, I would think effectively clocks are always there and necessary > for thermal reasons. Should the binding be updated to move clocks from "optional" to "required" then? Juno does actually have a GPU clock for DVFS, but the clk-scmi driver didn't seem to want to play nicely with either mali_kbase or panfrost DRM, so I've just been leaving it out of my DT for now (and mali_kbase was perfectly happy without). >>> + spin_lock_init(&pfdev->mm_lock); >>> + >>> + /* 4G enough for now. can be 48-bit */ >>> + drm_mm_init(&pfdev->mm, SZ_32M >> PAGE_SHIFT, SZ_4G); >> >> You probably want a dma_set_mask_and_coherent() call for your 'real' >> output address size somewhere - the default 32-bit mask works out OK for >> RK3399, but on systems with RAM above 4GB io-pgtable will get very >> unhappy about DMA bounce-buffering. > > Yes, I have a todo for figuring out the # of physaddr bits in the mmu > setup (as this call is just relevant to the input address side). > Though maybe just calling dma_set_mask_and_coherent() is enough and I > don't need to know the exact number of output bits for the io-pgtable > setup? True, io-pgtable itself only really depends on the input size, but in order for non-coherent pagtables to work correctly in general, the DMA mask does need to be set appropriately, at which point it may as well also be propagated into OAS for completeness (as we do in arm-smmu*). FWIW I'm just gonna leave this quote here... gpu_props->mmu.va_bits = KBASE_UBFX32(raw->mmu_features, 0U, 8); gpu_props->mmu.pa_bits = KBASE_UBFX32(raw->mmu_features, 8U, 8); Robin.