Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2313083pxt; Sun, 8 Aug 2021 19:29:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlPg+72wffp7xEPf4Gkctevt3widojif13IiHfoS5mhE1/BoejpwTKpDBg8ottkP3mBNwi X-Received: by 2002:a5e:d91a:: with SMTP id n26mr346759iop.96.1628476188746; Sun, 08 Aug 2021 19:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628476188; cv=none; d=google.com; s=arc-20160816; b=e9QTQcmlFPO1qxneOgUnMTTwEnlZveoJqlnMtE4WYASR+Y17Lor2Tiu3vSS7tk7q7k nUfdDtxb99OKYdaQ7hauerMD4RDLE8YUYk8Tce60EbaqyCCgrWEREvWBaulqdAF9MQIR 6H28diIRO77OCPlA4f7eYtNmD3zUp75+P08i2f8Bs4ZVOwp45bQDwOVru1WM5/6k74+0 BYDjIGQlLnpD8W6wrQmUE+g6WRAMvqUiRk0Ze7foQWmTwKyPLZ6aVxxweU/bG71EWp84 0ju2Th7EuLoemHQOfJ7xsFHt5uJ/enqSdTIlR9IAPoXu4+1AZov7nooVzGJt9JI+AGiX FPdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=VDzns3zCHQMAk2p/3JnGTgXYP/wQcxiCVZGWjOgDKHs=; b=ZV5fth3SIESVljJcbuchK7pCwz5Sy0xTAnahnxo6Vf7aEw1iKjvRRs7K7X7rqW+fkd 7xn3QcQTHb7sGj7qPkbTMQ5G3/O2U3mFZSq8vkxtF+fuDyFpeLppHIkjWucUsLTf/Nl8 HxKwQhXtYdFpN+nsLu42YFGdXv3YC4joRExX4158NdDwMTvQ8SgGjJp2ELHaYIdKlVeu 7HqMYbYZ/zY6MEJz9y5xabgzRvsSQne2/m96xGq69x7rsMnBkW86mXVh5OzwpvwpgpUd uAoBc8M6z10mVEVVtKkNSq+2p6QxqFNINYUVXpeMac3gyt779UufFlXRbqbl0+9jI9NZ AbkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si1127494ioa.67.2021.08.08.19.29.37; Sun, 08 Aug 2021 19:29:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231168AbhHIB4G (ORCPT + 99 others); Sun, 8 Aug 2021 21:56:06 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:46740 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229942AbhHIB4F (ORCPT ); Sun, 8 Aug 2021 21:56:05 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R421e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0UiL9Iwy_1628474143; Received: from B-LB6YLVDL-0141.local(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0UiL9Iwy_1628474143) by smtp.aliyun-inc.com(127.0.0.1); Mon, 09 Aug 2021 09:55:44 +0800 Subject: Re: [PATCH] riscv: add ARCH_DMA_MINALIGN support To: Jisheng Zhang Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, guoren@kernel.org, arnd@arndb.de References: <20210807145537.124744-1-xianting.tian@linux.alibaba.com> <20210809003044.6692ddce@xhacker> From: Xianting TIan Message-ID: <6a189d9d-b35d-3a15-5bfa-172c50e60c8c@linux.alibaba.com> Date: Mon, 9 Aug 2021 09:55:43 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210809003044.6692ddce@xhacker> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/8/9 上午12:30, Jisheng Zhang 写道: > On Sat, 7 Aug 2021 22:55:37 +0800 > Xianting Tian wrote: > >> Introduce ARCH_DMA_MINALIGN to riscv arch. >> >> Signed-off-by: Xianting Tian >> --- >> arch/riscv/include/asm/cache.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/arch/riscv/include/asm/cache.h b/arch/riscv/include/asm/cache.h >> index 9b58b1045..2945bbe2b 100644 >> --- a/arch/riscv/include/asm/cache.h >> +++ b/arch/riscv/include/asm/cache.h >> @@ -11,6 +11,8 @@ >> >> #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) >> >> +#define ARCH_DMA_MINALIGN L1_CACHE_BYTES > It's not a good idea to blindly set this for all riscv. For "coherent" > platforms, this is not necessary and will waste memory. > thanks for the reply, So riscv is the "coherent" platform? I submit this patch as I got a fix suggestion of another patch to use ARCH_DMA_MINALIGN, but riscv doesn't define it. https://lkml.org/lkml/2021/8/6/723 Considering the portability of the code, in my opinion, it is better to define it for riscv if it is not "coherent" platform. >> + >> /* >> * RISC-V requires the stack pointer to be 16-byte aligned, so ensure that >> * the flat loader aligns it accordingly.