From patchwork Wed Mar 6 13:57:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 159745 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp6198255jad; Wed, 6 Mar 2019 05:58:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxFnQbOmU7LRKyZ6WplfkwF2OXosXt4OfmCVAphmE13CORHf4w9+SkxHceQ+W2ixM9OZkao X-Received: by 2002:a17:902:7a2:: with SMTP id 31mr101026plj.246.1551880695393; Wed, 06 Mar 2019 05:58:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551880695; cv=none; d=google.com; s=arc-20160816; b=jF/IJxoDSbSLGsDcRw69hSUSYq+PmbGRyrCQoMiiCTKK0ojo9ZcMrHrVoEhmH0CbCE hSQkl3yIbTrg6pu41jpau6+Xqyz+XOHBIjpmYqf4J4LuEWoHXE1WqqP8LeLaL4Du341R qOzBPMazM0sIER42Ni/79X01epQ61oONgh6LsPO8zDdXN1PpeM0ZheXdoECZReohxfx+ Dv1mblNrWtUMomk7axtlm8mQJE75b2j7BDZw7J9AI3gr6l4fg8e9HEOoXXVE5vVZYfj3 wVJGiHNOMPbH0U8SVhCjzPWunc0oX+Tc8aPPd0X4zl+iEAa04G2aekWsKTP78msy9tSz crxA== 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 :message-id:date:subject:cc:to:from; bh=Jbn5wrebVrOa+iWdcvMythAtPF3KPe3d7yu3+RqH2V4=; b=A2PiRe1fApLoIv6e21fVqumTZ3bzYYdIL8wrhXNiXYfmqH/VAL6LGyQlROP9nvZFhp OZXHL5f5kXSy0PHP+jW5vV5psV4VlH9vXLqaS/wNenoJ4YUpJM5q0AkO5rYeBv+U+OOy 1XKgk2PmohCekvHAuGUQ3+jZv+prnqr36LwTRvC8N7axaGFnKwybpsqLNZGgbhVmYX/y tLdYn+r8zqW0pUQHK6Ow0IxPFUUMiyk0bKacMpUSJWewr1ZzxJCkbfHXt89bx4pJIr2v eUrEsz8PTtgWhwGryJqabryZMiS0tXh0WVuKSNSDCsB+jDZP4YwO5Vnz4LiZ2DU4Ug8f 5heA== 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 t3si1495029plq.430.2019.03.06.05.58.15; Wed, 06 Mar 2019 05:58:15 -0800 (PST) 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 S1726860AbfCFN6N (ORCPT + 31 others); Wed, 6 Mar 2019 08:58:13 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:52191 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbfCFN6N (ORCPT ); Wed, 6 Mar 2019 08:58:13 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mvbr4-1hHHSR1m8U-00sduC; Wed, 06 Mar 2019 14:58:01 +0100 From: Arnd Bergmann To: Thierry Reding , Mikko Perttunen Cc: Arnd Bergmann , Dmitry Osipenko , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v2] gpu: host1x: avoid IOMMU_API build error Date: Wed, 6 Mar 2019 14:57:43 +0100 Message-Id: <20190306135800.3982681-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:xvKcHd6PvYh7acwo26CW8xOVhQciHOtPMkcgEiMsl2IH70PTok9 zok150Tb1Ztpp+YZF40KXv+SqMit6hh/mQ9/V8X2Pu7tkaxk8my2ejc5m1aDXulh1/xYNDb h4nzt9AXHKXxQv/YIDF7QbEiOWa8EKHtxwwCJSWttvTvNpUYogIOPtR1ko54QuxnS/Ch7QO MxfSIasYZvK1C9vO5zw3Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:zLwu35DqAgc=:m2Y5Jq0qxPPYcjka5jTums poo7bvG+WN8c3vENfefE6la4Ccm0+GLpZ9Flx4T3zd7TVAJkj7MaNUi9MjI8uIHfEdB4XPhss zCoX7C96trMQlVWAj1xTAbHLd1jeuPGreb6Lizl4tD3oWPjJQJWmZwJOuclt2JPFgYzNWcBZR 0PzE6fFtF7eTeqGyxX7vfGKtdC5HvA7EoLprHck/4N1Ui8m4aDgteKnTotgQ1ug7GMMKl8BUy Kcne9l/Anbuz4gGsyJoTc4ZkOvHGqXQITilybEYVZOJrWHpcbRw+iabRI7TE3zVGCydc7p9e8 lYR87TFc/DqPoF+HJtymPuZKqPsTIpINKdY1XsuIKiqcomSEtsg7nA9IEHlwgfNHk2OI0YxDM pX3gi896G7xNrX4Uvd4GmocI6M6+kFTGuy4fmZqwMobWSulG0OuF816b4hZbrBMAJz8LSbqpU LJNNnzFFW8cxKdQOnSKlGWMuQS9RNPcqxnIbjb+VS1QwnrGYj6YSsR0eZMyCTiQezyBGloszh CnHOFh2w2iddmV55g9MxlisUoHa55svJSJL17QL6GR4QxTVt8FpaRYes1jujVZ8iGu9CrBWIa HMqiU17fr3M/0FOxPLbZqA/DMSf/Ae7bfQ4/w0TNrd/nSS86bPrPDuQX5JyZ7+YklDpexomPM TxFBjcV1AQP9KusQYU0oUNc8ncQspNmputpHVzQKPXVdf1yoTgCEad58bIT8g/okZsy105jC5 eCQc47Lnex9XQXeTmwf5NEwte+KYSDEGuv6Olg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the iommu API is disabled, the host1x driver fails to build: drivers/gpu/host1x/hw/channel_hw.c: In function 'host1x_channel_set_streamid': drivers/gpu/host1x/hw/channel_hw.c:118:30: error: implicit declaration of function 'dev_iommu_fwspec_get'; did you mean 'iommu_fwspec_free'? [-Werror=implicit-function-declaration] struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent); ^~~~~~~~~~~~~~~~~~~~ iommu_fwspec_free drivers/gpu/host1x/hw/channel_hw.c:118:30: error: initialization of 'struct iommu_fwspec *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion] drivers/gpu/host1x/hw/channel_hw.c:119:23: error: 'struct iommu_fwspec' has no member named 'ids' u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f; ^~ cc1: all warnings being treated as errors As Mikko explains, we should program SMMU bypass (0x7f) if that happens. Fixes: de5469c21ff9 ("gpu: host1x: Program the channel stream ID") Suggested-by: Mikko Perttunen Signed-off-by: Arnd Bergmann ---- v2: fall back to 0x7f sid --- drivers/gpu/host1x/hw/channel_hw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.20.0 Reviewed-by: Mikko Perttunen diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index 27101c04a827..0c0eb43abf65 100644 --- a/drivers/gpu/host1x/hw/channel_hw.c +++ b/drivers/gpu/host1x/hw/channel_hw.c @@ -115,8 +115,12 @@ static inline void synchronize_syncpt_base(struct host1x_job *job) static void host1x_channel_set_streamid(struct host1x_channel *channel) { #if HOST1X_HW >= 6 + u32 sid = 0x7f; +#ifdef CONFIG_IOMMU_API struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent); - u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f; + if (spec) + sid = spec->ids[0] & 0xffff; +#endif host1x_ch_writel(channel, sid, HOST1X_CHANNEL_SMMU_STREAMID); #endif