Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2006664imm; Sat, 18 Aug 2018 08:57:31 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw+9Ya/mqEck7353BZYGtxyeKn92l93Tfxuoxc7biLOqPpUK1llHEn7RJCYdCDZxlwlcNFY X-Received: by 2002:a17:902:4401:: with SMTP id k1-v6mr37460170pld.97.1534607850954; Sat, 18 Aug 2018 08:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534607850; cv=none; d=google.com; s=arc-20160816; b=WChVUj6GsscHDzamqsCk9d9LY2Vjz/phDJTpWgbdxHfuwhBUBznIkC3icEeCVxQcbp JjYWYeIpEaEXuB+SwPyjqJHSqZj8OZb7BqF5iPw9wHDqapXp/0ByXfZeHEdGC13jNAcj y+mrCS92CtFr5ZUFaDQ2fkGo9n6REbXyPnvk3C6EHvnCdZmGy4QSGQ0W2EAMtasbpmLA 8eie0SLN/a9xox2rhDTk/0wTlpOGN/YHtZ/6AulzhlCcimoqaTCLXW+R9wGegopuKsbr 0jRyr1dGOJdoT2I/zosoUA70ja/z0zsNileW7xIJyNH8cgIWSYyyAeE0g76iNE5F97zW OajQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=MZTAS1Iy0icNe6ggrGcyODXbMAedd10yzkGmnpxDcvk=; b=gMbJN3TAL2xENQRqplsUTnsSvksZmg69sV+iXPawKcoDFfd0NkLHjPE0lT9MU+TAvm mNoLT7pt2cRF6XGrT2dBJXhESWvagXDouCov1SqiJ9jANQOh2hd09YwpxOkjlcP1Q6Ly tFNXbupeNl4i0rBoRhhjxh9p0Xd71J1m42/q7A/C+761LEyQapVimxFjHouF2RM4PvU5 HQXyF60j56jcEs+xu1GssX9GPcU9HLZ95Cd+w4roegsjA+lYL7l8XzpYQ4QwpMeA4VCa 5LQ2D3lVIwuzC/M/KoWRpQpRlkoLjvPs8hrkzuGlvaH2O+2sZTtaM2ztFQnJQlbNqX57 f1LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C6fuKEms; 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 25-v6si4797869pgk.438.2018.08.18.08.57.15; Sat, 18 Aug 2018 08:57:30 -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=C6fuKEms; 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 S1726877AbeHRTEG (ORCPT + 99 others); Sat, 18 Aug 2018 15:04:06 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:43222 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbeHRTEF (ORCPT ); Sat, 18 Aug 2018 15:04:05 -0400 Received: by mail-ed1-f65.google.com with SMTP id j21-v6so6099028edp.10; Sat, 18 Aug 2018 08:55:56 -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:in-reply-to:references; bh=MZTAS1Iy0icNe6ggrGcyODXbMAedd10yzkGmnpxDcvk=; b=C6fuKEmsy1bn5SlPeUA9iNKVk/3xrr0/WQClmB1VenyMkT6JDI/OftPhkvEJ5cCguh HKGfY8U0RhOBbpxfNrLROhLwOoGAn0xU6T2dVQ3f6bJcXa6EevGuI+AtudpXrf95kco0 ulEo9EcAfQElcU4FgY96K1ei0kjITg4WK6NwVkWLxi/EPw8O52Yb25TpUt6d0sW+7agY RcpPs0TCp/eefKfCvFRC//Mem1hiGN89UoljipH5Ze6v+bfjXYDq8fGHdIkwmqXHFZ8S CmcxH9QNULx/6Rr4wfoN3UYNGrHsHPFIQfU04Fk2UpJBZMiOeKFeNTzoUOHMmHjDLJc4 CMhA== 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; bh=MZTAS1Iy0icNe6ggrGcyODXbMAedd10yzkGmnpxDcvk=; b=isXM3Ry8W3qI1JAq40MGGh2BZylrGnNG1NykGJ0/nuES3nIb7l4YHBCqXyws93M9no RuS9GK1cnlEopHYUpuQarL+cLR845KkAxCcVVPNWogbrD01urhWZPjsPobUiGEaw27wj sZC3q418qWJnrbrSkFfEAiHKY/cWwV4+555acP1IfIWdAW0pAKWPBFNTlCNGYbiHIbC/ C2OfeWBGAYYqzR4XPODpqIncCfYIRpCS7BjR7YAV4yiUmMLb6kXk9RTNibK2wWnrhqy7 oyVmbLhoelh/z+/2XBRw92/Pp9FmZxwr3fG97HVuQDNYPPqatQhF2GE5/lN53DYuv+8o zu3g== X-Gm-Message-State: AOUpUlER39mt8hJy4JZqDamVBIR0sn10QB7X/mH+Gd8cCcSMvvwBd7sq T8+4HmPOAR+KHUKjLq0f16I= X-Received: by 2002:a50:9704:: with SMTP id c4-v6mr47479849edb.246.1534607755525; Sat, 18 Aug 2018 08:55:55 -0700 (PDT) Received: from localhost.localdomain (109-252-90-13.nat.spd-mgts.ru. [109.252.90.13]) by smtp.gmail.com with ESMTPSA id v8-v6sm2784014edr.48.2018.08.18.08.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Aug 2018 08:55:55 -0700 (PDT) From: Dmitry Osipenko To: Joerg Roedel , Robin Murphy , Thierry Reding , Jonathan Hunter , Rob Herring Cc: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 15/19] iommu/tegra: gart: Don't use managed resources Date: Sat, 18 Aug 2018 18:54:26 +0300 Message-Id: <20180818155430.5586-16-digetx@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180818155430.5586-1-digetx@gmail.com> References: <20180818155430.5586-1-digetx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GART is a part of the Memory Controller driver that is always built-in, hence there is no benefit from the use of managed resources. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 9f7d3afb686f..d019ae8ecfc9 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -171,7 +171,7 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain, struct gart_client *client, *c; int err = 0; - client = devm_kzalloc(gart->dev, sizeof(*c), GFP_KERNEL); + client = kzalloc(sizeof(*c), GFP_KERNEL); if (!client) return -ENOMEM; client->dev = dev; @@ -197,7 +197,7 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain, return 0; fail: - devm_kfree(gart->dev, client); + kfree(client); spin_unlock(&gart->client_lock); return err; } @@ -212,7 +212,7 @@ static void __gart_iommu_detach_dev(struct iommu_domain *domain, list_for_each_entry(c, &gart->client, list) { if (c->dev == dev) { list_del(&c->list); - devm_kfree(gart->dev, c); + kfree(c); if (list_empty(&gart->client)) gart->active_domain = NULL; dev_dbg(gart->dev, "Detached %s\n", dev_name(dev)); @@ -459,7 +459,7 @@ struct gart_device *tegra_gart_probe(struct device *dev, return ERR_PTR(-ENXIO); } - gart = devm_kzalloc(dev, sizeof(*gart), GFP_KERNEL); + gart = kzalloc(sizeof(*gart), GFP_KERNEL); if (!gart) { dev_err(dev, "failed to allocate gart_device\n"); return ERR_PTR(-ENOMEM); @@ -468,7 +468,7 @@ struct gart_device *tegra_gart_probe(struct device *dev, ret = iommu_device_sysfs_add(&gart->iommu, dev, NULL, "gart"); if (ret) { dev_err(dev, "Failed to register IOMMU in sysfs\n"); - return ERR_PTR(ret); + goto free_gart; } iommu_device_set_ops(&gart->iommu, &gart_iommu_ops); @@ -506,6 +506,8 @@ struct gart_device *tegra_gart_probe(struct device *dev, iommu_device_unregister(&gart->iommu); remove_sysfs: iommu_device_sysfs_remove(&gart->iommu); +free_gart: + kfree(gart); return ERR_PTR(ret); } -- 2.18.0