Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2714190ybi; Mon, 17 Jun 2019 09:23:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmgSkzwIkWNshlnJVRb/SdO/kerQPt2w90POHp6dHgS6b8xmKvcrTgnscMfxtJwxndPv1N X-Received: by 2002:a17:90a:de02:: with SMTP id m2mr19100617pjv.18.1560788597145; Mon, 17 Jun 2019 09:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560788597; cv=none; d=google.com; s=arc-20160816; b=SyI6s1Rtg53+nLobfPK0GqEddWztFjfuFR4nDppTHCco51HXX4fiG+aDRNNWi5N27o 8AiwD6MtlsDAM5WaOzy6kLt8gACUW67Fo1FdY1H5w/hCIEqdZeA0rv6cePZSC4LUeuKX EW39oNM0h9x2wqCnH4Jihk3I+vztWGvILac7N2Fl9fmsgc814J7a4xy+QSOHmVD+iFAq 8ezizKcSy0DmAsZ7jwUuOsa3UTC0tnqLSjTC1RMrUGLulbLIqJ/NqP7S+hT6wR7AUHAw x7P2wtrMGFZygGcctNYaJ/RgCRtTqgSKKzVsXqB02jiRrnvbd0Mhe8+Me4JQd17cqSMz 7wtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=eUOEUs2FN5Uwhi2MuQt1URJXpUk8OgnbCirQzXoSU1I=; b=gUYe5pjqJFOkp0wH9kSy/awvLIvXhX5cfCfK8+5SqtqYk0wWs+l9z0A6jZrcwkSNOW vqNMCjZSmp7Qp/lP6PDsv9HS4rArAXMhLWUj+eSNe0DRjI4z8DaG4Kv/H4tTGa/4LcHY wauD9AlaGVdfrCHCBs7vakDOchlO+d44P/UuBQpt5UuJ/qioK9YrVps8zLoS3pZyyF5w 3kAEzCx/LL700bVeLCY6w3muyP0H+zi4xA4c0PZ2ctMDnHrF/6KFkQxuPpZb+S0L6e9B 7hTgytjD/1iKOm4OgNNmA1ewBAl+f2JGwhzFx2DEt6EqnKP9T6kKkEQyURB5ncSmfbqB nKhw== 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 bc10si10266761plb.43.2019.06.17.09.23.01; Mon, 17 Jun 2019 09:23:17 -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 S1728021AbfFQQWh (ORCPT + 99 others); Mon, 17 Jun 2019 12:22:37 -0400 Received: from foss.arm.com ([217.140.110.172]:55450 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbfFQQWh (ORCPT ); Mon, 17 Jun 2019 12:22:37 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F004A28; Mon, 17 Jun 2019 09:22:36 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B69B33F718; Mon, 17 Jun 2019 09:22:35 -0700 (PDT) Date: Mon, 17 Jun 2019 17:22:33 +0100 From: Catalin Marinas To: Zhangshaokun Cc: Masayoshi Mizuma , Robin Murphy , Will Deacon , linux-arm-kernel@lists.infradead.org, Masayoshi Mizuma , linux-kernel@vger.kernel.org, Hidetoshi Seto , Zhang Lei Subject: Re: [PATCH v2] arm64/mm: Correct the cache line size warning with non coherent device Message-ID: <20190617162233.GB34565@arrakis.emea.arm.com> References: <20190614131141.4428-1-msys.mizuma@gmail.com> <20190617104555.GA1367@arrakis.emea.arm.com> <7e567399-6f3d-b416-6636-c9f2f37ea407@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e567399-6f3d-b416-6636-c9f2f37ea407@hisilicon.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 07:00:34PM +0800, Zhangshaokun wrote: > On 2019/6/17 18:45, Catalin Marinas wrote: > > On Sat, Jun 15, 2019 at 10:44:33AM +0800, Zhangshaokun wrote: > >> On 2019/6/14 21:11, Masayoshi Mizuma wrote: > >>> diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c > >>> index 1669618db08a..379589dc7113 100644 > >>> --- a/arch/arm64/mm/dma-mapping.c > >>> +++ b/arch/arm64/mm/dma-mapping.c > >>> @@ -38,10 +38,6 @@ void arch_dma_prep_coherent(struct page *page, size_t size) > >>> > >>> static int __init arm64_dma_init(void) > >>> { > >>> - WARN_TAINT(ARCH_DMA_MINALIGN < cache_line_size(), > >>> - TAINT_CPU_OUT_OF_SPEC, > >>> - "ARCH_DMA_MINALIGN smaller than CTR_EL0.CWG (%d < %d)", > >>> - ARCH_DMA_MINALIGN, cache_line_size()); > >>> return dma_atomic_pool_init(GFP_DMA32, __pgprot(PROT_NORMAL_NC)); > >>> } > >>> arch_initcall(arm64_dma_init); > >>> @@ -56,7 +52,17 @@ void arch_teardown_dma_ops(struct device *dev) > >>> void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, > >>> const struct iommu_ops *iommu, bool coherent) > >>> { > >>> + int cls = cache_line_size_of_cpu(); > >> > >> whether we need this local variable, how about use cache_line_size_of_cpu > >> directly in WARN_TAINT just like before. > > > > The reason being? > > Since it is inline function, maybe it is unnecessary, it is trivial. OTOH, you end up with two reads from the CTR_EL0 register. -- Catalin