From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.microchip.iphmx.com ([68.232.153.233]:59483 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964863AbeEJAte (ORCPT ); Wed, 9 May 2018 20:49:34 -0400 From: Prasanthi Chellakumar CC: =?UTF-8?q?Michel=20D=C3=A4nzer?= , , Christoph Hellwig Subject: [PATCH] swiotlb: fix inversed DMA_ATTR_NO_WARN test Date: Wed, 9 May 2018 17:49:02 -0700 Message-ID: <1525913342-3621-1-git-send-email-Prasanthi.Chellakumar@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: stable-owner@vger.kernel.org List-ID: From: Michel Dänzer The result was printing the warning only when we were explicitly asked not to. Cc: stable@vger.kernel.org Fixes: 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor coherent buffer allocation" Signed-off-by: Michel Dänzer Reviewed-by: Christian König . Signed-off-by: Christoph Hellwig --- lib/swiotlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/swiotlb.c b/lib/swiotlb.c index fece575..12fbaa4 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -737,7 +737,7 @@ swiotlb_alloc_buffer(struct device *dev, size_t size, dma_addr_t *dma_handle, swiotlb_tbl_unmap_single(dev, phys_addr, size, DMA_TO_DEVICE, DMA_ATTR_SKIP_CPU_SYNC); out_warn: - if ((attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) { + if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) { dev_warn(dev, "swiotlb: coherent allocation failed, size=%zu\n", size); -- 2.7.4