Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5691545yba; Thu, 11 Apr 2019 03:48:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdd9Cq8lh0ELzx4pibahJC65PDJYjpA5s1/8vfSyOZkyO52XOD1SlL6ZONJDh9EOCd6CY9 X-Received: by 2002:a63:1d4f:: with SMTP id d15mr19415878pgm.347.1554979680992; Thu, 11 Apr 2019 03:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554979680; cv=none; d=google.com; s=arc-20160816; b=NsOdNQFqdxVcBTfPtQcxxA2ZRBn1ZTHAY/G8ZIPCJbsGJLss5iYkw78wM/STkm/go1 2dp7VB8iU7cw5PDgx4kW0jUU0u9tMwjnOsYRM7MWSTsymt9+i5LcdPWJQ8HNrsCOg8oQ 6SRWdZJmlqWxvH3aycVHXB5i77urwPHE8dDa8Xl8J7XMFGpa3KN/GTgBrE+UKdiv9OmQ 9ZKm9Q3mg6tNnr5qekIpxiqclgfveD+jBObeYpGVVbezvsRR/eO2SenZS5XXcXg/HDvG s4JzOPJ6dkDKIg+5ipH7x91K7/uutHFh8Kufh+6o76VGmP2d2qZEyRMdr6+tm1FxYzdb hUgQ== 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:dkim-signature; bh=6KQUjfncdrsA3T/gypZ6l17eb8a3qRti+BhvKSXNdXY=; b=bIEDAZc8WiZIOPAGsJ37XhzNZMDX6t/tJRe4KCGAuCrEr+aN9hSi9/TZ5Mwio2Je8L soDsPCr9iern6+0socVPmglLF1DqO+T6mJfo58z2khcH0i3xswfu//edgA/G5zg0nXAk E9dqGXQIFzDSZUSOsEUkMoRSzZCQRiQ3iNMrISQ1mZ0OC19SH0wZ7ChBSzcFUbV/4LWu SqO/V8fvVfvA/o7wUF85ZohijSC+cpCw5jlT6VSG3R7/800Tg2X1fxidMkvouO450IPN +u690ncPMupMgvoghWGNKH/cRIs+Y/OqbtucyW/m5obpw5ZgZGkw431BTJHysQfY5xy7 wL4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=mZVlWLhb; 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 d22si33684615pls.435.2019.04.11.03.47.45; Thu, 11 Apr 2019 03:48: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; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=mZVlWLhb; 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 S1726770AbfDKKqq (ORCPT + 99 others); Thu, 11 Apr 2019 06:46:46 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:34089 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbfDKKqp (ORCPT ); Thu, 11 Apr 2019 06:46:45 -0400 X-Greylist: delayed 2412 seconds by postgrey-1.27 at vger.kernel.org; Thu, 11 Apr 2019 06:46:43 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6KQUjfncdrsA3T/gypZ6l17eb8a3qRti+BhvKSXNdXY=; b=mZVlWLhb07aa7ksCnolUZx/KZP P2sM6MGNBKIx+x3ivo/T5kfwRdKcndI8xA3pn2wuGnSl8suFvQTomU6Y9eeXffi2+FB57Dqvom0rX PqMrC5ilXQ+7HlucyFkeBh4YrjM55C7KBQ3wuUobixC4F3faLZUAxtoF9IoUZqv3Clx1bHf7EtFNO YYEyST9kshknN3psuK5Ms6zFX5hhDUjSQWMeMzgmQPmJx7NamQNOFBxkkolLbVEgomxN+SlA8zDB2 TcXApbAl3mf9gtQ7nPn29o8Czxxoy65nSWAClgy/GK7k+p3COnbFDP6Axj48boYzQ4VW8D5yDwn0v YsUSgCwg==; Received: from [193.209.96.43] (helo=[10.21.26.179]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hEWbF-0002t6-0W; Thu, 11 Apr 2019 13:06:29 +0300 Subject: Re: [PATCH] gpu: host1x: fix compile error when IOMMU API is not available To: Thierry Reding , Ben Dooks Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, digetx@gmail.com, linux-tegra-owner@vger.kernel.org References: <4c3d021c73c001f633803e364cfbc6ace3381205.1554936354.git.stefan@agner.ch> <7371b1573ddd0b127713724ef5051a6f@codethink.co.uk> <20190411083017.GB4633@ulmo> From: Mikko Perttunen Message-ID: Date: Thu, 11 Apr 2019 13:06:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190411083017.GB4633@ulmo> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 193.209.96.43 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11.4.2019 11.30, Thierry Reding wrote: > On Thu, Apr 11, 2019 at 09:23:13AM +0100, Ben Dooks wrote: >> >> >> 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. > > I don't think there's really a large number of failures here. Either > your device has an IOMMU fwspec or it doesn't. > > But yes, I think it'd be better to have the above static inline dummy in > iommu.h, but I'll apply this for now in the hopes of getting it in > before v5.1 final. A similar patch was already sent before by someone. That one also programs the bypass stream ID (0x7f) even if IOMMU is disabled. We should pick that patch instead. Thanks, Mikko > > Thierry > >> >>> --- >>> 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; >>> >>> _______________________________________________ >>> dri-devel mailing list >>> dri-devel@lists.freedesktop.org >>> https://lists.freedesktop.org/mailman/listinfo/dri-devel