From patchwork Thu Nov 28 15:37:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11266287 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7130E14B7 for ; Thu, 28 Nov 2019 15:38:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 590BC21781 for ; Thu, 28 Nov 2019 15:38:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 590BC21781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6168889C3F; Thu, 28 Nov 2019 15:38:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by gabe.freedesktop.org (Postfix) with ESMTPS id A202D89C3F for ; Thu, 28 Nov 2019 15:37:58 +0000 (UTC) Received: by mail-wr1-x434.google.com with SMTP id t2so31628468wrr.1 for ; Thu, 28 Nov 2019 07:37:58 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Dj5QeGhVIw+jJO0yySFJPhYXfPiaBftwUYyrusaKzY=; b=jWUyFPBfGaSfWfWXXtdcu6z/jTlIzflieW3a1bWaUaiINqnOkANw2GDa2Ud5dIhY0y yeB6GHGQ1PEEbQNjL2k3Jx8ttqm50aqu3L5auhIqm2AM3LRZxuNGoen3/I8AG3cnViFq 5w63J2eyu16ajI1UiwKKKpv9N+OlraYu9qZtQwnPV4nd5BtTSxEaYXkYxBqq70SfoCGO vaOkEGgZzihk3umELKEuWlZF0VlE6xt5/H/vVm7OBU4OCZpsW7gEAfv3mtLAbEGVMbk7 aLzJnc0CvtfT3ry2EOvuS7tnnRnk7A+jZ1E3scGEDf71reAHKCLWwNR10GvgnqnCEcj0 hndQ== X-Gm-Message-State: APjAAAX4ptZQaV5zUB7IjAvMi3utqEEuH2gho/5OIKZGv8IuG4nZ6b6c cDL50Va/aKubLTQsc/OymtM= X-Google-Smtp-Source: APXvYqwS6ivoSIoL1JFkfrZIU83hrx3H7cggPKDcssn9xfif+3YWxM9Ll57LI06q98frR6TkygjpZw== X-Received: by 2002:adf:9427:: with SMTP id 36mr40495496wrq.166.1574955477119; Thu, 28 Nov 2019 07:37:57 -0800 (PST) Received: from localhost (pD9E518ED.dip0.t-ipconnect.de. [217.229.24.237]) by smtp.gmail.com with ESMTPSA id 60sm23844474wrn.86.2019.11.28.07.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 07:37:56 -0800 (PST) From: Thierry Reding To: Thierry Reding Subject: [PATCH 7/9] drm/tegra: Silence expected errors on IOMMU attach Date: Thu, 28 Nov 2019 16:37:39 +0100 Message-Id: <20191128153741.2380419-8-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128153741.2380419-1-thierry.reding@gmail.com> References: <20191128153741.2380419-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+Dj5QeGhVIw+jJO0yySFJPhYXfPiaBftwUYyrusaKzY=; b=cqT7e+42pcBLNUzMN1laPcYNlu1zTORQr2TV7bJdnQlTWu4bwC9aJkxcRknC91wrVQ VMJqdr/fksMMm/pyo2cJRP8DXDjHnQk4U0xC8eQ5Q2eB1iwzJBfU3teahBAnrj/j4duT koKAM9qrs4ZmhmvRz3gK+U/6YuEeR6+gc77WUyXSY+C7VuV0DVp1+b88VZ5vGJaJYAU8 6N2HFCQ9IX+xEEfLzBBIMnFLhFRYpMCvoRZin3ZVmcQCNBtWYwBgu8aaA8w7z5j1rFHo JZPpQni4vP1rrwt1RzrOoJkVES4hkRIu2IJhyUTSHUT0fwSblrnzSV31BFMtBQSjcdNc /Trw== 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, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding Subdevices may not be hooked up to an IOMMU via device tree. Detect such situations and avoid confusing users by not emitting an error message. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/dc.c | 2 +- drivers/gpu/drm/tegra/drm.c | 4 +--- drivers/gpu/drm/tegra/vic.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 0a5f86b61fda..2b9a25c977c0 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -2027,7 +2027,7 @@ static int tegra_dc_init(struct host1x_client *client) dev_warn(dc->dev, "failed to allocate syncpoint\n"); err = host1x_client_iommu_attach(client); - if (err < 0) { + if (err < 0 && err != -ENODEV) { dev_err(client->dev, "failed to attach to domain: %d\n", err); return err; } diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 56e5e7a5c108..7a16b51eaa2d 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -920,10 +920,8 @@ int host1x_client_iommu_attach(struct host1x_client *client) if (tegra->domain) { group = iommu_group_get(client->dev); - if (!group) { - dev_err(client->dev, "failed to get IOMMU group\n"); + if (!group) return -ENODEV; - } if (domain != tegra->domain) { err = iommu_attach_group(tegra->domain, group); diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c index c4d82b8b3065..3526c2892ddb 100644 --- a/drivers/gpu/drm/tegra/vic.c +++ b/drivers/gpu/drm/tegra/vic.c @@ -167,7 +167,7 @@ static int vic_init(struct host1x_client *client) int err; err = host1x_client_iommu_attach(client); - if (err < 0) { + if (err < 0 && err != -ENODEV) { dev_err(vic->dev, "failed to attach to domain: %d\n", err); return err; }