From patchwork Thu Dec 19 16:30:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 182132 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp702198iln; Thu, 19 Dec 2019 08:31:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzTzojdA88jPcWdH4tBisyhm/wWBZbWezlc3F32rwEG6/f3izsnfTS0hSx3NzZie8QiVDIO X-Received: by 2002:a05:6830:1e46:: with SMTP id e6mr6816696otj.245.1576773084117; Thu, 19 Dec 2019 08:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576773084; cv=none; d=google.com; s=arc-20160816; b=n9PdUcnOjQ2WdnnWt6qTBgeIykoDRcaO4+jU1hYwt8pQAtKnvJEg2B6ypDt/Vb3BxA uDsi5tCf3ASy2kYhvfcwSu5eQCRMR2Y1iwIrFr6laJ2Au9N7RDfy6g5gv+YN5EQ63oeR FjtnbutAs4eDgBBGx1NRK3PMFaM1HJSMeoAhmnBQ/WEZVQASAZ/x/Moj+8y4cnFvxfK+ u2V+G1yiNlljCTKWjuexr4UmWb5/vEMRyCjbDQb1J+IEbKFQS1IhDSCUYWbYdYNHqHZW kNLpJlh5Xxt4qcdnYjGMwUpa9RRQ0qjbwH3oO87xvhdJse2B8hyTDL7uU7Oij9a4Yyjv k7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qvpO6T6lCyQjsFcC/B3MAQOfFJPvli4NlBcE8bVnq2o=; b=uqWeWuQpNfbmVbb4K4dqZ5tZQeiocDQvosUE6UlO6SObjsidgTbfq3qAHEss4kiwi/ Z/qXiFD3Xp6TLhwNEDfsBhiGS1wf9PfRR6E2QurvuVStjwJqUZKIbMs5h5iTOJ4ptlnI KbSbhOUbXUK2Vv3Okq2jZM8ASfUyqJSWy3QOuiX/UHQdJP0OPMNwyY/2ZUIy4rNmpxIH 6xnCXqnkCyRFPlvT99/diJ+Ec/P/yDCZckGBFgFfOzsmjamxMgfqvYJ9p5QDG723IYIU KR6PR2sMoBvgdBNhyFsj7OJ4rQvkmhiZS2zudmI0R54JCvCbVt8hNWOnJDOQLSKpuGTO pVzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ybmj/yFM"; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25si2200080oij.175.2019.12.19.08.31.23; Thu, 19 Dec 2019 08:31:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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=@linaro.org header.s=google header.b="ybmj/yFM"; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726869AbfLSQbX (ORCPT + 7 others); Thu, 19 Dec 2019 11:31:23 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37260 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbfLSQbW (ORCPT ); Thu, 19 Dec 2019 11:31:22 -0500 Received: by mail-wm1-f65.google.com with SMTP id f129so6285476wmf.2 for ; Thu, 19 Dec 2019 08:31:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qvpO6T6lCyQjsFcC/B3MAQOfFJPvli4NlBcE8bVnq2o=; b=ybmj/yFMV4WPp7svNei7QMmCl8bEZOgf5I1OmMiNuceKiEvs5FOwc+5QNBcmfQrlON DofenBUgXZTyi4JhcRiIepGkKcdGY4BtKidQwP7/JHO1FEOJNjzrzX8jKjeJNf5cwrSN tS2rRvNKSfBvhZDS+GHaReUR5s84Sru30RnnKkOevGMAjdhnFV1FNoTdrYF5xTS2C5Pz pBv91NSiFLc4P/2cJ1BRlji6oxczL+VzlLLYhsrAz88xLoCnUc9XjeqfwlqEjDnliWJA 9uGe7CZ4PKzluz2OcGmuwW1v9QwotUUAWENXlNB7vZEd8IAreHDTExzizhbd8YlzdFMR HnXg== 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=qvpO6T6lCyQjsFcC/B3MAQOfFJPvli4NlBcE8bVnq2o=; b=SkmezmyYi8jZuaIoz/MkzG1JqeWvzWQXBX2Gahu0pYLJGRTyC0R8Bvo042I0nUrG5b xmtdAyBcwPPBVJDDvylRnBIqB1FbxUURWOICj92QXfiX2E3jBDswBRl9ole6GXKq7+6H m8dNv/q4wexJ5hYPGaRLL0478LeJHU4dMnCGIkZTziqoMtfspdFEckOcCcrS7aDlyXXI gEKcW1bZKQ8v+N6sWPgAQpZkjz/qdumg6RRGqtojXy9S5qwYfniWSUZdPzwkrjMVRIY6 wkeK3ddZPHyt7ihRcn0ZMb0ertsxVGaC0V0DTSMiHvIRuf6LQNhNhir+eJmHSGRlvbx5 2K7A== X-Gm-Message-State: APjAAAXEeD7T44YFE/zfzCeWNYmCEmElOQBItR2jwlOoD10rPpf/Fbbt h/MdyEFo2juNeslCwlZyioCd+w== X-Received: by 2002:a1c:b456:: with SMTP id d83mr10758320wmf.172.1576773080107; Thu, 19 Dec 2019 08:31:20 -0800 (PST) Received: from localhost.localdomain (adsl-84-227-176-239.adslplus.ch. [84.227.176.239]) by smtp.gmail.com with ESMTPSA id u22sm7092068wru.30.2019.12.19.08.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 08:31:19 -0800 (PST) From: Jean-Philippe Brucker To: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org Cc: joro@8bytes.org, robh+dt@kernel.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, rjw@rjwysocki.net, lenb@kernel.org, will@kernel.org, robin.murphy@arm.com, bhelgaas@google.com, eric.auger@redhat.com, jonathan.cameron@huawei.com, zhangfei.gao@linaro.org Subject: [PATCH v4 01/13] iommu/arm-smmu-v3: Drop __GFP_ZERO flag from DMA allocation Date: Thu, 19 Dec 2019 17:30:21 +0100 Message-Id: <20191219163033.2608177-2-jean-philippe@linaro.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219163033.2608177-1-jean-philippe@linaro.org> References: <20191219163033.2608177-1-jean-philippe@linaro.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Since commit 518a2f1925c3 ("dma-mapping: zero memory returned from dma_alloc_*"), dma_alloc_* always initializes memory to zero, so there is no need to use dma_zalloc_* or pass the __GFP_ZERO flag anymore. The flag was introduced by commit 04fa26c71be5 ("iommu/arm-smmu: Convert DMA buffer allocations to the managed API"), since the managed API didn't provide a dmam_zalloc_coherent() function. Reviewed-by: Eric Auger Reviewed-by: Jonathan Cameron Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/arm-smmu-v3.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.24.1 diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index effe72eb89e7..d4e8b7f8d9f4 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1675,7 +1675,7 @@ static int arm_smmu_init_l2_strtab(struct arm_smmu_device *smmu, u32 sid) desc->span = STRTAB_SPLIT + 1; desc->l2ptr = dmam_alloc_coherent(smmu->dev, size, &desc->l2ptr_dma, - GFP_KERNEL | __GFP_ZERO); + GFP_KERNEL); if (!desc->l2ptr) { dev_err(smmu->dev, "failed to allocate l2 stream table for SID %u\n", @@ -2161,8 +2161,7 @@ static int arm_smmu_domain_finalise_s1(struct arm_smmu_domain *smmu_domain, return asid; cfg->cdptr = dmam_alloc_coherent(smmu->dev, CTXDESC_CD_DWORDS << 3, - &cfg->cdptr_dma, - GFP_KERNEL | __GFP_ZERO); + &cfg->cdptr_dma, GFP_KERNEL); if (!cfg->cdptr) { dev_warn(smmu->dev, "failed to allocate context descriptor\n"); ret = -ENOMEM; @@ -2883,7 +2882,7 @@ static int arm_smmu_init_strtab_2lvl(struct arm_smmu_device *smmu) l1size = cfg->num_l1_ents * (STRTAB_L1_DESC_DWORDS << 3); strtab = dmam_alloc_coherent(smmu->dev, l1size, &cfg->strtab_dma, - GFP_KERNEL | __GFP_ZERO); + GFP_KERNEL); if (!strtab) { dev_err(smmu->dev, "failed to allocate l1 stream table (%u bytes)\n", @@ -2910,7 +2909,7 @@ static int arm_smmu_init_strtab_linear(struct arm_smmu_device *smmu) size = (1 << smmu->sid_bits) * (STRTAB_STE_DWORDS << 3); strtab = dmam_alloc_coherent(smmu->dev, size, &cfg->strtab_dma, - GFP_KERNEL | __GFP_ZERO); + GFP_KERNEL); if (!strtab) { dev_err(smmu->dev, "failed to allocate linear stream table (%u bytes)\n",