[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tencent_164349390B49089A598FAEDB@qq.com>
Date: Mon, 11 Sep 2017 16:41:51 +0800
From: "陈华才" <chenhc@...ote.com>
To: "Christoph Hellwig" <hch@...radead.org>
Cc: "James E . J . Bottomley"
<jejb@...ux.vnet.ibm.com>,
"Martin K . Petersen"
<martin.petersen@...cle.com>,
"Fuxin Zhang" <zhangfx@...ote.com>,
"linux-scsi" <linux-scsi@...r.kernel.org>,
"linux-kernel" <linux-kernel@...r.kernel.org>,
"stable" <stable@...r.kernel.org>
Subject: Re: [PATCH 2/2] scsi: Align queue to ARCH_DMA_MINALIGN innon-coherent DMA mode
Hi, Christoph
I think we cannot modify dma_get_cache_alignment(), because existing callers may want to unconditionally return ARCH_DMA_MINALIGN.
Huacai
------------------ Original ------------------
From: "Christoph Hellwig"<hch@...radead.org>;
Date: Mon, Sep 11, 2017 03:39 PM
To: "Huacai Chen"<chenhc@...ote.com>;
Cc: "James E . J . Bottomley"<jejb@...ux.vnet.ibm.com>; "Martin K . Petersen"<martin.petersen@...cle.com>; "Fuxin Zhang"<zhangfx@...ote.com>; "linux-scsi"<linux-scsi@...r.kernel.org>; "linux-kernel"<linux-kernel@...r.kernel.org>; "stable"<stable@...r.kernel.org>;
Subject: Re: [PATCH 2/2] scsi: Align queue to ARCH_DMA_MINALIGN innon-coherent DMA mode
> + if (plat_device_is_coherent(dev))
We can't just call platform device code. We'll need a proper
DMA API call for this.
> + blk_queue_dma_alignment(q, 0x04 - 1);
> + else
> + blk_queue_dma_alignment(q, dma_get_cache_alignment() - 1);
Which we already have with dma_get_cache_alignment, except that it
doesn't take a struct device pointer and doesn't call into dma_map
ops. So please add a struct device argument to dma_get_cache_alignment,
and let it call into dma_map_ops where needed.
With that you can replace the above with:
blk_queue_dma_alignment(q,
max(0x04U, dma_get_cache_alignment(dev)) - 1);
Powered by blists - more mailing lists