From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [PATCH] mmc: omap_hsmmc: fix DMA API warning Date: Tue, 11 Dec 2018 07:04:12 -0800 Message-ID: <20181211150412.GP6707@atomide.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Russell King Cc: Peter Ujfalusi , Ulf Hansson , linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-Id: linux-mmc@vger.kernel.org Hi, * Russell King [181211 14:41]: > @@ -1939,6 +1938,17 @@ static int omap_hsmmc_probe(struct platform_device *pdev) > goto err_irq; > } > > + /* > + * Limit the maximum segment size to the lower of the request size > + * and the DMA engine device segment size limits. In reality, with > + * 32-bit transfers, the DMA engine can do longer segments than this > + * but there is no way to represent that in the DMA model - if we > + * increase this figure here, we get warnings from the DMA API debug. > + */ > + mmc->max_seg_size = min(mmc->max_req_size, > + min(dma_get_max_seg_size(host->rx_chan->device->dev), > + dma_get_max_seg_size(host->tx_chan->device->dev))); > + Looks like using min3() here would be handy? Regards, Tony