From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3082C4360F for ; Fri, 5 Apr 2019 12:57:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99DF6218AC for ; Fri, 5 Apr 2019 12:57:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="avp3SaXd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99DF6218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JBTLn9nQbFfQQ7RnuA5F67RBUD2zwziPDgw5yzNBH/k=; b=avp3SaXdewqs04Zw1ohU5V7XC yt/m/qvxobUb/UAlZt//LGjdww46LtZC1wQGEt6so6IpG+7t/jp2lbs0TIbLjf8SdzNGSMREBZEry B6o0y5nhv9OLp6DJ9dMM03VGXW9T3coDLHXscCe/ei/6FhDCy4/W8+apSei1D/PEd+8Le+tnqj4LK /tdmedbcnGmXX5M+T/8qFJETr/oGRohuvDEIToErJBMp/kZiGQAnNK2Y/lASMjYSzxWKwqjytjsC4 phWkGNw42FG+lLUqkmD0XtUqNrgQgYYAH1pNKGCiGveXEa1B3a2NB4Q+a7qOftaqVW0+ic5DhxRJ1 uauagDNnw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hCOPf-0006Yk-LB; Fri, 05 Apr 2019 12:57:43 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hCOPT-0006DE-0L for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2019 12:57:33 +0000 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 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-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190405_055731_231955_36C07314 X-CRM114-Status: GOOD ( 19.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lyude Paul , Tomeu Vizoso , Eric Anholt , Maxime Ripard , Maarten Lankhorst , Joerg Roedel , Neil Armstrong , Will Deacon , "linux-kernel@vger.kernel.org" , dri-devel , David Airlie , Linux IOMMU , Alyssa Rosenzweig , Daniel Vetter , "Marty E . Plummer" , Sean Paul , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel