Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5599445yba; Thu, 11 Apr 2019 01:24:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJ3RllK4/j5+Eu5qmQgFTiSPrBXkFOZhOdR0I4jA5xPzK5ChDBdhHj1SBMZudHjs4T/8Gi X-Received: by 2002:a17:902:b60d:: with SMTP id b13mr49486808pls.100.1554971068584; Thu, 11 Apr 2019 01:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554971068; cv=none; d=google.com; s=arc-20160816; b=sQiyfo2Wdig+cFRpxM3PNb2DoqSHa986dVW1P7MqICdB12gSKQ3m1BMReM4Hdr39gr VHOgKXoOGjxVjlsnrYSj2m6MwkCPWgVSaqdygB8iRjHWVW1kFJdmqnVyKXDHHNNFiXid B5IoTaE6vTy2JaXRP5lPAYgq4OacL16ZN2OsXwehUDdmE+/aVm7Iqap49DkvhsI3MNfA 0aiH53wUNNi/SbelthhKffv/HVGCjQIgF0pzL2/jZiON/u2KruxsY7EUkdVT3XDa8fL2 PDp9jxS8qSsmjsEGYDhQ1MuwQKFA1O1a2h83gGGxaanWfBZv2QGcad+DivYxkh3KMDni kWqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=Mw7X0ZGiuIVlwZjNOXdPoBGdfzVncS5JhTiGCUf/N2w=; b=UL9QP92OcXcfluvYDxUmDjmEcDNskDDyvZrCbl6PvzQzLzzTMn3IWp1egMiZXoxgi/ WMMd7MMqrW0mOyImpYddI4enFde1hBNWaXYU0+203Z214dHwwjlK30e5UMVtA1VZKjGY kc9CQs3iLPX4zlqJBaAFmU8Blv/wU+3F8JHiErVK8hzcKWA/+jH/gqo9r3EaKx0d2j9L 897HE+uOa51jyoH8TqOAHJEDqSHAI/Xkc0TV45XAgBC+ozKvRynWErYYjTks0UI8nJCG JIKFQh9dhdc987vbTNHcJl711BVDXJDGkSgpv0vtV1+fEzcbIdRG0t1NXJnPydqV29qb 2yrw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ch17si28604346plb.337.2019.04.11.01.24.12; Thu, 11 Apr 2019 01:24:28 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726691AbfDKIXT (ORCPT + 99 others); Thu, 11 Apr 2019 04:23:19 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:53459 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbfDKIXT (ORCPT ); Thu, 11 Apr 2019 04:23:19 -0400 Received: from [192.168.122.135] (helo=_) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1hEUzK-000823-61; Thu, 11 Apr 2019 09:23:14 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 11 Apr 2019 09:23:13 +0100 From: Ben Dooks To: Stefan Agner Cc: thierry.reding@gmail.com, digetx@gmail.com, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra-owner@vger.kernel.org Subject: Re: [PATCH] gpu: host1x: fix compile error when IOMMU API is not available In-Reply-To: <4c3d021c73c001f633803e364cfbc6ace3381205.1554936354.git.stefan@agner.ch> References: <4c3d021c73c001f633803e364cfbc6ace3381205.1554936354.git.stefan@agner.ch> Message-ID: <7371b1573ddd0b127713724ef5051a6f@codethink.co.uk> X-Sender: ben.dooks@codethink.co.uk User-Agent: Roundcube Webmail/1.1.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-04-10 23:47, Stefan Agner wrote: > In case the IOMMU API is not available compiling host1x fails with > the following error: > In file included from drivers/gpu/host1x/hw/host1x06.c:27: > 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 > > Fixes: de5469c21ff9 ("gpu: host1x: Program the channel stream ID") > Signed-off-by: Stefan Agner would it be better to provide something like this i nthe header that defines dev_iommu_fwspec_get() to be: static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev) { return NULL; } although returning an PTR_ERR would have been better. > --- > drivers/gpu/host1x/hw/channel_hw.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/host1x/hw/channel_hw.c > b/drivers/gpu/host1x/hw/channel_hw.c > index 27101c04a827..4030d64916f0 100644 > --- a/drivers/gpu/host1x/hw/channel_hw.c > +++ b/drivers/gpu/host1x/hw/channel_hw.c > @@ -114,7 +114,7 @@ static inline void synchronize_syncpt_base(struct > host1x_job *job) > > static void host1x_channel_set_streamid(struct host1x_channel > *channel) > { > -#if HOST1X_HW >= 6 > +#if IS_ENABLED(CONFIG_IOMMU_API) && HOST1X_HW >= 6 > struct iommu_fwspec *spec = > dev_iommu_fwspec_get(channel->dev->parent); > u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;