From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9EC2C2D0CD for ; Tue, 17 Dec 2019 10:59:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0E6C2146E for ; Tue, 17 Dec 2019 10:59:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lj1Xrahb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbfLQK7R (ORCPT ); Tue, 17 Dec 2019 05:59:17 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:59560 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727489AbfLQK7Q (ORCPT ); Tue, 17 Dec 2019 05:59:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576580355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tAVUgYEbOKAmbmGHd4mLJpWS0BdtmbZWYoTyqnMHjpM=; b=Lj1XrahblT7yT6L0KhG7O/uPLzA4d8+4dd6lFPL2dmen4zji7mMgqCt4XMmOh9ztw5zgCN msYIPEsa9ZnL6BHpEoyRUM4syT+3kGCAyJWoOvjDPEPFhIPxfeAf3tHwlKjBGuEG5mkTSl 6QBYQ3Bqa+CaDjGY4FZx1nklxZv1qxc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-toc7B--iMgaH3SihD5o5Wg-1; Tue, 17 Dec 2019 05:59:12 -0500 X-MC-Unique: toc7B--iMgaH3SihD5o5Wg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D132618FF662; Tue, 17 Dec 2019 10:59:08 +0000 (UTC) Received: from [10.36.116.117] (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1D465D9C9; Tue, 17 Dec 2019 10:59:04 +0000 (UTC) Subject: Re: [PATCH v3 01/13] iommu/arm-smmu-v3: Drop __GFP_ZERO flag from DMA allocation To: Jean-Philippe Brucker , 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, jonathan.cameron@huawei.com, zhangfei.gao@linaro.org References: <20191209180514.272727-1-jean-philippe@linaro.org> <20191209180514.272727-2-jean-philippe@linaro.org> From: Auger Eric Message-ID: <2917e0a3-e351-69fe-5e67-adeda9d40617@redhat.com> Date: Tue, 17 Dec 2019 11:59:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20191209180514.272727-2-jean-philippe@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Jean, On 12/9/19 7:05 PM, Jean-Philippe Brucker wrote: > 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. > > Signed-off-by: Jean-Philippe Brucker Reviewed-by: Eric Auger Thanks Eric > --- > drivers/iommu/arm-smmu-v3.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > 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", >