From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Greer Subject: Re: [PATCH V8 1/5] dma-mapping: Rework dma_get_cache_alignment() Date: Wed, 18 Oct 2017 10:23:36 -0700 Message-ID: <20171018172336.GA29358@animalcreek.com> References: <1508227542-13165-1-git-send-email-chenhc@lemote.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1508227542-13165-1-git-send-email-chenhc@lemote.com> Sender: linux-kernel-owner@vger.kernel.org To: Huacai Chen Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Andrew Morton , Fuxin Zhang , linux-kernel@vger.kernel.org, Ralf Baechle , James Hogan , linux-mips@linux-mips.org, "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, Tejun Heo , linux-ide@vger.kernel.org, stable@vger.kernel.org, "Michael S . Tsirkin" , Pawel Osciak , Kyungmin Park , Michael Chan , Benjamin Herrenschmidt , Ivan List-Id: linux-ide@vger.kernel.org On Tue, Oct 17, 2017 at 04:05:38PM +0800, Huacai Chen wrote: > Make dma_get_cache_alignment() to accept a 'dev' argument. As a result, > it can return different alignments due to different devices' I/O cache > coherency. > > Currently, ARM/ARM64 and MIPS support coherent & noncoherent devices > co-exist. This may be extended in the future, so add a new function > pointer (i.e, get_cache_alignment) in 'struct dma_map_ops' as a generic > solution. Hi Huacai. > diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c > index 67ffecc..c708457 100644 > --- a/drivers/tty/serial/mpsc.c > +++ b/drivers/tty/serial/mpsc.c > @@ -81,19 +81,19 @@ > * Number of Tx & Rx descriptors must be powers of 2. > */ > #define MPSC_RXR_ENTRIES 32 > -#define MPSC_RXRE_SIZE dma_get_cache_alignment() > +#define MPSC_RXRE_SIZE dma_get_cache_alignment(dma_dev) I would much prefer that you add a parameter to the macro to avoid forcing a non-flexible and non-obvious variable definition wherever it is used. What I mean is something like: #define MPSC_RXRE_SIZE(d) dma_get_cache_alignment(d) Similarly for all of the other macros and where they're used. Thanks, Mark --