From patchwork Tue Dec 3 16:19:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11271553 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 9BCF8930 for ; Tue, 3 Dec 2019 16:19:35 +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 84FDE20833 for ; Tue, 3 Dec 2019 16:19:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84FDE20833 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 5415E6E848; Tue, 3 Dec 2019 16:19:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E1AE6E846 for ; Tue, 3 Dec 2019 16:19:32 +0000 (UTC) Received: by mail-wm1-x32a.google.com with SMTP id s14so4165047wmh.4 for ; Tue, 03 Dec 2019 08:19:31 -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=pyzOe2qMdvVwhl1mEyFjGx3TYlIMn6F7cP5QiE14+H4=; b=lbZk/yVE0c1B3qpBZj6GgbF3XcnW/mo3WufgTPxM3V7i174i2bTyPFpjt7lwnqhonc ixx1kc9Ywi7bUS0k7kRujb4kKdBPobgaIl1gJXKPKOvuDBhg1w7duc+29sENGT44POLp zGVomU9fTR5t0yCwxBE0iryVWxL4w60xhnrUyUx1yFn8WNxR2Snr5nGKcD6bAK4dxS3Q zRZDduJ+WJ4DPtppwUsIW8A6FjGJnGVFwMR7lqs+MjZB62PkpeiclmLUfol/yNZlkeUV j5VIu7iP2MeUjZ3UsWJXdi8LEb8uHIOyr1PfwcrTPPeW0aYJrnTU55RAsZ2acfm+8Ppv fR4w== X-Gm-Message-State: APjAAAX1QOjBO7qDuhIBzsRMRzJSYif+SlZILs0R+qa6IB5WFmn/cZwl wruYkXwILP1CASX4dCeYEKM= X-Google-Smtp-Source: APXvYqwT/wJuzWWV2RPfPnQ7sxDm7cPpS+KNP3aqUMF36DKBCbFhDzv97wNKTeSIru/mQVG2PMmFrw== X-Received: by 2002:a05:600c:24d1:: with SMTP id 17mr25491563wmu.151.1575389970584; Tue, 03 Dec 2019 08:19:30 -0800 (PST) Received: from localhost (pD9E518ED.dip0.t-ipconnect.de. [217.229.24.237]) by smtp.gmail.com with ESMTPSA id x18sm4081958wrr.75.2019.12.03.08.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 08:19:29 -0800 (PST) From: Thierry Reding To: Thierry Reding Subject: [PATCH v2 7/9] drm/tegra: Silence expected errors on IOMMU attach Date: Tue, 3 Dec 2019 17:19:12 +0100 Message-Id: <20191203161914.1312555-7-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191203161914.1312555-1-thierry.reding@gmail.com> References: <20191203161914.1312555-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=pyzOe2qMdvVwhl1mEyFjGx3TYlIMn6F7cP5QiE14+H4=; b=qValVkF8/qyIg3bVfigaMdP6d1f9SDnhBW4ha4pbI66ZuSwMV0obJpRDLk2/GxQEyY 2DduUn4hNVmBCC7I/hq1TRg/7u7mZFbldSHl68BQYaqgzYpTsCDwFiHOKjs+qytDW5P0 SpwSOQJ3ejVxwVlzENpY3it2ox6AC4z+HhThEO5mSMlXNLD/hCwhPcolWmkOohQpLWJW BTZpMKbfTz8HxSEPNuqalfNVU0ppveFHwVcX4LvxFBu7OCIFsZyVprYJAv1gE/S75urs kxc1+uLaOk5ifq8HqdnzVuZkstGUVPGGZ0p9EdeXJFdS7SCUXmvRqUFiKSOqHO62Gfu2 /4qA== 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, Daniel Vetter , 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. Reviewed-by: Daniel Vetter 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; }