From patchwork Sat May 19 01:07:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 10414169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F5E660365 for ; Mon, 21 May 2018 08:25:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5293E287B5 for ; Mon, 21 May 2018 08:25:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47231287C0; Mon, 21 May 2018 08:25:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D348B287B5 for ; Mon, 21 May 2018 08:25:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C916E6EFFE; Mon, 21 May 2018 08:19:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id F0B566EF78 for ; Sat, 19 May 2018 01:07:37 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id z27-v6so257645lfg.13 for ; Fri, 18 May 2018 18:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kz3PMkGRnV/IRfT4KDV43ZJ2SIc+uDpRz5GK2kWXgTs=; b=ClKt4IkPRmB2KyWidFmSRlkft6jCvxaXorhofNuf8heKGa6LStHRmy/bSnDV7yKmMO viQvFPxkB+V9ixhx13NfBwTRHUx/f/vHttGdewdiE84YFy52nk+KtNylZCi9ZHaBo/33 47QqeDBZOhxY0BCPLTAZ2svzO6O0i5BveAfprL/OCKaYj1jcg0SPxS5Kvo5mJiWKG2u/ M128QrOp9M6d6PJTadsVvNgG/tSy8xhzUq/k7+Is90oOrjIFFmRbGydljHWT3MwTyBLf qxr1QJzvn6ytcGXLi2zVzKVV7c53rSVcHEjwbeLTldSoRgJLHV3uoRmEZRCjyk2z5hen BhsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kz3PMkGRnV/IRfT4KDV43ZJ2SIc+uDpRz5GK2kWXgTs=; b=la093X6ucCBEBqATPElSmUXkTRPcuQWeMQIWh+OHkbqR+V5gZRgG287pd4AEDPb4KD O/TVTtWIgEEMW8+jvcntbqsLmqS3wgZ6JS9Ppg1z7ytl4M4C2YbQSmqDbpLGPIg2SSuJ PHanG9kBA1KLsJOaZ2DRYRDj4dG1fx74z/iSJLG2SD+6sbJ7EXnc6Vr8m7eyjvDmwDGh Wo90NfmHqG7xcKQ9FIFg+E2K9piVJTEfd5UTOgrsZmMUYHSdVG5SJ/UGuP2s9xpdfroi 19qZwLX9Yuy84UdoSLQVQ9Dv5FjBDDFkslv5nVCq00rXPVC8T03tZeiR7JIuy2MFBDpR 5HFw== X-Gm-Message-State: ALKqPwfiFuxirnTsl28HprtIoPwaY97F7rMEUU4Ogs2iYY4FrkWUFnt9 3amyjEJ2hDfXhTRzNQwOLKo= X-Google-Smtp-Source: AB8JxZp4ui0x3yrmRvUyJPDZpiZyQ1pF2w6bVpO6IwDs8VaXfA8X2gktPXP8OALNa1TW3RJQTzeUuw== X-Received: by 2002:a19:1ad5:: with SMTP id a204-v6mr23044404lfa.43.1526692056398; Fri, 18 May 2018 18:07:36 -0700 (PDT) Received: from localhost.localdomain ([109.252.91.60]) by smtp.gmail.com with ESMTPSA id x3-v6sm2144070lfd.78.2018.05.18.18.07.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 18:07:35 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen Subject: [PATCH v1] gpu: host1x: Skip IOMMU initialization if firewall is enabled Date: Sat, 19 May 2018 04:07:10 +0300 Message-Id: <20180519010710.11693-1-digetx@gmail.com> X-Mailer: git-send-email 2.17.0 X-Mailman-Approved-At: Mon, 21 May 2018 08:18:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Host1x's CDMA can't access the command buffers if IOMMU and Host1x firewall are enabled in the kernels config because firewall doesn't map the copied buffer into IOVA space. Fix this by skipping IOMMU initialization if firewall is enabled as firewall merges sparse cmdbufs into a single contiguous buffer and hence IOMMU isn't needed in this case. Signed-off-by: Dmitry Osipenko --- drivers/gpu/host1x/dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index f1d5f76e9c33..d88073e7d22d 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -218,6 +218,9 @@ static int host1x_probe(struct platform_device *pdev) return err; } + if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL)) + goto skip_iommu; + host->group = iommu_group_get(&pdev->dev); if (host->group) { struct iommu_domain_geometry *geometry;