Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5724592yba; Thu, 11 Apr 2019 04:34:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsmkzLxUhhS+swSn1Vvt7Tuptk9r2EuC10h9CHNYB8PKuGUZB03hqu7qGTai4hVboxP0L+ X-Received: by 2002:a63:e004:: with SMTP id e4mr47061126pgh.344.1554982474757; Thu, 11 Apr 2019 04:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554982474; cv=none; d=google.com; s=arc-20160816; b=OHEzCzLHkFlDP535O81WDkmQBZrV6mv9kL+c9es71SIPNx80Uha9ZlaTn9H/5IVsd0 jNkOvPdhTcwlwBFTy+KrxTIk3QsUone3roYPyVoOEVIlHKCnmrIJdJ3M7L29zHJ2Uxy+ gFqwHrWU0DKLylW2TmaDeWrd0NvNamFXtE0HjZQ89Q3sKK9AIxaYS6DVb/EgYYKan/M+ CB1wsC/sHozwgG/LqAtpEksT22Fuq1TRh8lje24nEXfNAWFBVH8JKx/so8OugdZTa1DB GjB6rNDJFS47OTu3zbwPERi5OmpxmTS5gimy8f3iEiiXvfknjDtiALWUvp7JLzvaqUqn 8hgA== 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=eobaGoWYk57pOxmjBz1z37XKx5tEVnBH0OcE4Z9OEcw=; b=q3Zx21phCQG5OhNeggW6mGpx7RZlFdf9qmR36/yk3Mb9OiHkvvFC0VWWWztglkaoTC Sp0P3R/6CQTB3BoM8jAhs7uM5L3NHAAmDh/Tn8VJCXm5wLOiSZLw82Op1u/Ny1iObCEF GGb6KJSYVrfunFcFmeErZi0CsEiVYsjwI0KOxhuRBRVEDdrBn6C0bEkdTUIvMsMHYwRF OfxbduXQ/RoXYAus1/6FcUw8rGmlVH4vEuuxU6kiInZn7LZge1WWYPcjPnPhaKqgMboJ w7Xvd7LmfrEzz+n9/MZqQ2MAoUo/uynULzjGF/WY185VEhFZXV+j5x3y1WhLEJ01gWnp 2sQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tw5NrQAD; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s61si12796330plb.0.2019.04.11.04.34.18; Thu, 11 Apr 2019 04:34:34 -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=pass header.i=@gmail.com header.s=20161025 header.b=Tw5NrQAD; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbfDKLbw (ORCPT + 99 others); Thu, 11 Apr 2019 07:31:52 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42345 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbfDKLbw (ORCPT ); Thu, 11 Apr 2019 07:31:52 -0400 Received: by mail-lf1-f68.google.com with SMTP id w23so4404153lfc.9; Thu, 11 Apr 2019 04:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eobaGoWYk57pOxmjBz1z37XKx5tEVnBH0OcE4Z9OEcw=; b=Tw5NrQADK5KlSnOZvSE7YnKTY+29BX95CXv/Kua502MlpLLK0/C+0JBTtL/uI0Fj1j ch3zvwMy6wognmnTGkn52xIzOnNK6YmYubZFnteXOWdvHJoPKs2DxE2tEL+KvRqUMjJU lO/ZMbFQD207eFCy/Lx5grQVw6Oni6wpx+ZfHhM6dLkV0mRDBXivR/ptya0GDgs6iEQr TEz35P73LM4TjViDkiNvHik+SjU8ZFCbTIHSUmWGHDMwuhFgLkVkAwT8lTOowGD/+cML DF8toIWUnBYgt3c+UL1M7ThRJ16Vsk+w3FXDDI4QS3SKfyjT3fHS6XLK+2tOt/jpl3dW 6Odw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eobaGoWYk57pOxmjBz1z37XKx5tEVnBH0OcE4Z9OEcw=; b=i33DIvx7DKV27cGOWd1pZ5PD4xpRyLWivZEZ5c5pAYoRBvBJ8nSb0ueZHNKGinykTz A8ODVa8to81Yu6VLc574sp+AXK9n9wdjMi7a/9xdvt5IqNKRVwIGdh3zx/d57WUeWyVZ DwHAE4v80apcruWEk6UkF/uNuGSeZZiZ2PIS/OOif5ux8wx/lHoZY9QMY/aNU+J9bsaN ZRH9Zo8K3gKGFhFLDkoOzCJYqSgV0tME4ZPExhlMtGtE5HJ8QQyD+qaHDvhg/Bf9L/02 VGYA6cxdkTCgRvyUyIYI9T5AisWkoTYCfuqGd3OgOEoFqquDgYhS6uKgIy1NEe6WketM psTQ== X-Gm-Message-State: APjAAAVFzEJCjpRVrJjAOPiaSrrUn36FxGtRM5QJAUgDG3MnOWME6v3u K545uNMH58VKo/6ZHpEvwsni2dTH X-Received: by 2002:ac2:420b:: with SMTP id y11mr27199272lfh.104.1554982310220; Thu, 11 Apr 2019 04:31:50 -0700 (PDT) Received: from [192.168.2.145] (ppp94-29-35-107.pppoe.spdop.ru. [94.29.35.107]) by smtp.googlemail.com with ESMTPSA id p14sm434877lfk.6.2019.04.11.04.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 04:31:49 -0700 (PDT) Subject: Re: [PATCH] gpu: host1x: fix compile error when IOMMU API is not available To: Mikko Perttunen , Thierry Reding , Ben Dooks , Stefan Agner Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-tegra-owner@vger.kernel.org References: <4c3d021c73c001f633803e364cfbc6ace3381205.1554936354.git.stefan@agner.ch> <7371b1573ddd0b127713724ef5051a6f@codethink.co.uk> <20190411083017.GB4633@ulmo> From: Dmitry Osipenko Message-ID: Date: Thu, 11 Apr 2019 14:31:48 +0300 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 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 11.04.2019 13:06, Mikko Perttunen пишет: > 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. For the record.. here is that patch https://patchwork.ozlabs.org/patch/1052364/