OSDN Git Service

drm/tegra: Silence expected errors on IOMMU attach
authorThierry Reding <treding@nvidia.com>
Tue, 3 Dec 2019 16:19:12 +0000 (17:19 +0100)
committerThierry Reding <treding@nvidia.com>
Wed, 4 Dec 2019 12:37:44 +0000 (13:37 +0100)
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 <daniel.vetter@ffwll.ch>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/tegra/vic.c

index 85d3c9a..714af05 100644 (file)
@@ -2017,7 +2017,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;
        }
index 56e5e7a..7a16b51 100644 (file)
@@ -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);
index c4d82b8..3526c28 100644 (file)
@@ -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;
        }