Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4170918ybl; Tue, 20 Aug 2019 08:00:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAMdJ99CsJ86Kyi0RT81Fo6MO9HwCi7+wxnJTSgAHqFXenZwO0eHyG+mcZNtOtChhuW9xs X-Received: by 2002:aa7:988a:: with SMTP id r10mr29271786pfl.253.1566313236069; Tue, 20 Aug 2019 08:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566313236; cv=none; d=google.com; s=arc-20160816; b=wHabGELXunoPSFhp59IEBZmd0VgZA5slry/zyw+IfWJFCzVx2gohvmYlSIHm+9r57t QQyf9yLqAcv/SPFmokY/oigyInNJvnrYyWdNlMV8rvOxgZMvdxr5ES+QcgLsSXrAB48t EP8Gzge0udBaN6669Rigoyw2um8rYdKYa/CcJgSTJmvKNUCe0geAcI2mdd/JLTqWJe3Y oQxosu1Jn821G+Gk5vzpbDci4/VFH4BCoO58LjKGVm5hzMWpsFLU6O1Vl2OSM6w+JeEK cJZjqiPDv1Aj2GFxoTmR/ft8I07ICUk+bYH/B0gejcGrbjjvxqVOIOx1p6Kgx9VjVRwa 7vag== 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; bh=SIop4HE83+xcVePg3PNXaPa9aDzpOdGO7zRaOKWlMxw=; b=uTn+4ByOIkuz7XnK17/IcYFK/qWBFCkJ6cKc25nUNs93FdBGDzDxnyAKbyGnahsKxs ORoRVGowx0dwfvUvsz86kFInPAE0XoWhM1Eb4znn1cNVn8RFpR/JIUcuf0Bbtqe7FmbR X164fSqj/YUx+1YbxSosjeuGsz9cA+X3U/nAsyg35kQKpsjCDrz2fetfrXhIOtTVyIKG /5ZeZMrkMnLpvuMexRt5mgxZ+EsHlGNOgdmZAX5DdwhevucAjCNw19lzsEqoE/bCfU0A KorfBapAysoxFC8g3I8z06l+StOLNOqDPTqf87SeGBHwLlulPtGco71QqowK/bpYTYOI lpHw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q135si13193873pfc.125.2019.08.20.08.00.20; Tue, 20 Aug 2019 08:00:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730546AbfHTO6w (ORCPT + 99 others); Tue, 20 Aug 2019 10:58:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:60052 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730443AbfHTO6o (ORCPT ); Tue, 20 Aug 2019 10:58:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F4150AFD4; Tue, 20 Aug 2019 14:58:42 +0000 (UTC) From: Nicolas Saenz Julienne To: catalin.marinas@arm.com, hch@lst.de, wahrenst@gmx.net, marc.zyngier@arm.com, robh+dt@kernel.org, Robin Murphy , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: phill@raspberryi.org, f.fainelli@gmail.com, will@kernel.org, nsaenzjulienne@suse.de, eric@anholt.net, mbrugger@suse.com, linux-rpi-kernel@lists.infradead.org, akpm@linux-foundation.org, frowand.list@gmail.com, m.szyprowski@samsung.com Subject: [PATCH v2 10/11] arm64: edit zone_dma_bits to fine tune dma-direct min mask Date: Tue, 20 Aug 2019 16:58:18 +0200 Message-Id: <20190820145821.27214-11-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190820145821.27214-1-nsaenzjulienne@suse.de> References: <20190820145821.27214-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the introduction of ZONE_DMA in arm64 devices are not forced to support 32 bit DMA masks. We have to inform dma-direct of this limitation whenever it happens. Signed-off-by: Nicolas Saenz Julienne --- Changes in v2: - Make sure to filter the higher part of arm64_dma_phys_limit - Rename variable to zone_dma_bits arch/arm64/mm/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index c51ce79b692b..c5e619f21ad8 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -437,8 +438,10 @@ void __init arm64_memblock_init(void) early_init_fdt_scan_reserved_mem(); - if (IS_ENABLED(CONFIG_ZONE_DMA)) + if (IS_ENABLED(CONFIG_ZONE_DMA)) { arm64_dma_phys_limit = max_zone_dma_phys(); + zone_dma_bits = ilog2((arm64_dma_phys_limit - 1) & GENMASK_ULL(31, 0)) + 1; + } if (IS_ENABLED(CONFIG_ZONE_DMA32)) arm64_dma32_phys_limit = max_zone_dma32_phys(); -- 2.22.0