Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2069732pxt; Sun, 8 Aug 2021 10:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMWTaondY3kScxrvYvZka/m0SWD8B7DCC0UmxrQzt93C49zw+ikiyzLrOPco8COqs2gBUe X-Received: by 2002:a92:dac9:: with SMTP id o9mr234710ilq.124.1628443558899; Sun, 08 Aug 2021 10:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628443558; cv=none; d=google.com; s=arc-20160816; b=BXuEi12zV5ym7Ab3SAs3r2Ribe9iZHkJj2rU6h/MUbt3F07YbOs5wLLwu6RMLafooA miE0TGhquXuDynXtgKAaLGRnxOdAGe29Er2rw0F6nf8Rx8vFl3R8DTPbn4d2qK234koM hTsYoc24UCnwDQCnLK+7+W/DHu/IPasFn+mBY4tyG+h16AdQz6tcMRsj5EAnksYnbO41 9bzJJxuz8U/2Ije+Zcuce3lAblu478PmHkiLWqPwHryEpfSD6uY5TCdqfqx8bjH1dd4l OjYiEpq1+rzOquWzkWKjBcd58Cp9WUyLsdDM3D/VIPxx5iMg7BdCqg03uJih9SOufH2h F5KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wGp9oslcYn/4MPbEEh0iFKyJg/ieb0O1ieOAiKIaJ8o=; b=RgVqKWeyBId3iS7Vd7xj2Vz+F/K+ltTTHJv3aHftFIiH7LUolpVRzXHDrkEpwccauV neLLiaUSlKDYL8EaHI+CwKgkc1+KjXV75QpEVMkUbEew+faYiInJSfHny7V9JLomKjoq ylTGl+1SEHwSqyDqOqaV6GPBk89YpGMVtfVjozlfW7ijfNcEqLyChEr2uRuMH+bxsK/6 rdmkuB9SLhZqaW85s5fcPdYimfiS3FL4VcaV2J1wFmkJSqpybLLy0W+ANx7/sV3Bel8y VDCqfVtmByTOowzfSYkwWDjIsti1LGLxRLNxMd9BqpgS1u3j1jgcUsJjLg11fklsR08M RH3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b=uBY1PLvy; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mail.ustc.edu.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si16863207ilf.57.2021.08.08.10.25.46; Sun, 08 Aug 2021 10:25:58 -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; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b=uBY1PLvy; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mail.ustc.edu.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbhHHQh4 (ORCPT + 99 others); Sun, 8 Aug 2021 12:37:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbhHHQhx (ORCPT ); Sun, 8 Aug 2021 12:37:53 -0400 Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6B14CC061760 for ; Sun, 8 Aug 2021 09:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ustc.edu.cn; s=dkim; h=Received:Date:From:To:Cc:Subject: Message-ID:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=wGp9oslcYn/4MPbEEh0iFKyJg/ieb0O1ie OAiKIaJ8o=; b=uBY1PLvyiJOE6fi1IN0UXQ7jXSbwP/K2ndIOgF1zG8A7L0bkRT +Tcaqhh5EH8CCW7B28zlDhvnF0grM/pi6FP8negVZhf8W6563sLCIqtbDIhjpYDJ lKp9USkrEtCxtG9MoW0t5btxTMnJqFBgk5lqrv6L+le7KzplMqlxVjaqg= Received: from xhacker (unknown [101.86.20.15]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygD3xjgkCBBhk60MAA--.4994S2; Mon, 09 Aug 2021 00:36:54 +0800 (CST) Date: Mon, 9 Aug 2021 00:30:44 +0800 From: Jisheng Zhang To: Xianting Tian Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: add ARCH_DMA_MINALIGN support Message-ID: <20210809003044.6692ddce@xhacker> In-Reply-To: <20210807145537.124744-1-xianting.tian@linux.alibaba.com> References: <20210807145537.124744-1-xianting.tian@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CM-TRANSID: LkAmygD3xjgkCBBhk60MAA--.4994S2 X-Coremail-Antispam: 1UD129KBjvdXoWruw13Xr4kCw1fXw1xJF1rXrb_yoWfXwb_C3 yxG397Wr1xXF4xAFsrJas3Jr4Y93yvvFykXr4Yyw13G3WDuw15C39Ykr17Jr4FkayYyFs7 Ca4rt34kCryYvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbFAYjsxI4VWxJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwV C2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVAC Y4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJV W8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41l42xK82IYc2Ij64vIr41l4I8I 3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxV WUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAF wI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcI k0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_ Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU86OJ5UUUUU== X-CM-SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > + > /* > * RISC-V requires the stack pointer to be 16-byte aligned, so ensure that > * the flat loader aligns it accordingly.