Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp478498pxt; Thu, 12 Aug 2021 03:01:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuDzOI+yDDOdX62cN4IrLYzqhoy7diWtLd/39RQ7z1XlynUOmnL6bZEbrmznP/S7u6SUNI X-Received: by 2002:a50:cc0b:: with SMTP id m11mr4441302edi.96.1628762472672; Thu, 12 Aug 2021 03:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628762472; cv=none; d=google.com; s=arc-20160816; b=RgOZtJVIxK8PxbLhYZRLfcsTCLuAltPZ9AQWntpHCLgfErSJe6EjgDRHrAmePYwy+X VBr+toWsBU555AEP4d9oja5ov2gZv24kXrLhiOaDDNJEVLcnamDSvNLgbJ8fnX1CQJWY lPoNmEHpLnL/1MZ0ilT0PzpUWCQIZa0mWrhTyuXpFDCY0N2z82KCu5+qicnK7ChS/0e5 Jdt7AvhyS8s2h3pzd4MjLZ3AhFGDMQaNiIL3wsZWtJTrUJU/HznI8fW+pMXE7e+jg2ni S9FyGBoLqUMXpz8qHtBYefzlz9H9Ub/Ag9XufbM5iwcrmLBhI2/Le7OFBlbbD/KEtrun 3OuA== 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=BCHrnVZZj/xE0pJ6ZsSUReNOILdDI3fJLns8I+8VAyA=; b=Kff4n4ereJc7XSDW35Btgr4kcznt9pnIXOcwHolLcwwrN1pnKv3T6zLOS46BloHO4y T47jTmqDi+WjLJ3WFRLs2HtaFBSyJnLooKTQUc8TN1mKj+bURtEb/m7+3mooMe0M+0Kl y6DtyVbDUJco7+RuMtJiJePz666ysctoPMR3OHobadFoYFjyRNpaLbB6Kgj3ssekP1y/ Hk4HVO67MLh9H3bx+6yQnE99c+7t81qjsbbH2gf4jjLwFv6ftwyGlFLz3tsPaNC/CJ/p V+A+14eN1l+CMWBpC4YhCEqxCDF4yn/YG5r0NgX66M5sQ7fv03Jg5yZdRtrFQJs9mwoj flHw== 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 z11si2275404edq.385.2021.08.12.03.00.48; Thu, 12 Aug 2021 03:01:12 -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 S234867AbhHLJOh (ORCPT + 99 others); Thu, 12 Aug 2021 05:14:37 -0400 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:53928 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232796AbhHLJOg (ORCPT ); Thu, 12 Aug 2021 05:14:36 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=xianting.tian@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0Uim5XHy_1628759649; Received: from B-LB6YLVDL-0141.local(mailfrom:xianting.tian@linux.alibaba.com fp:SMTPD_---0Uim5XHy_1628759649) by smtp.aliyun-inc.com(127.0.0.1); Thu, 12 Aug 2021 17:14:09 +0800 Subject: Re: [PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars() To: Arnd Bergmann Cc: gregkh , Jiri Slaby , Amit Shah , Omar Sandoval , linuxppc-dev , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" , Linux Kernel Mailing List , Guo Ren References: <20210806030138.123479-1-xianting.tian@linux.alibaba.com> <20210806030138.123479-2-xianting.tian@linux.alibaba.com> From: Xianting TIan Message-ID: Date: Thu, 12 Aug 2021 17:14:09 +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: 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/12 下午4:54, Arnd Bergmann 写道: > On Thu, Aug 12, 2021 at 10:08 AM Xianting TIan > wrote: >> 在 2021/8/6 下午10:51, Arnd Bergmann 写道: >>> On Fri, Aug 6, 2021 at 5:01 AM Xianting Tian >>>> +#define __ALIGNED__ __attribute__((__aligned__(sizeof(long)))) >>> I think you need a higher alignment for DMA buffers, instead of sizeof(long), >>> I would suggest ARCH_DMA_MINALIGN. >> As some ARCH(eg, x86, riscv) doesn't define ARCH_DMA_MINALIG, so i think >> it 's better remain the code unchanged, >> >> I will send v5 patch soon. > I think you could just use "L1_CACHE_BYTES" as the alignment in this case. > This will make the structure slightly larger for architectures that do not have > alignment constraints on DMA buffers, but using a smaller alignment is > clearly wrong. Another option would be to use ARCH_KMALLOC_MINALIGN. yes, I unstand you, the align size must  L1_CACHE_BYTES at least. > > Note that there is a patch to add ARCH_DMA_MINALIGN to riscv already, yes, I summited this patch, it is discussing, seems they don't want to apply it. > as some implementations do not have coherent DMA. I had failed to > realized though that on x86 you do not get an ARCH_DMA_MINALIGN > definition. I didn't find the definition in arch/x86/include/asm/cache.h and other place, x86 is dma coherent, it may doesn't need it. > > Arnd