From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34AACC56202 for ; Tue, 27 Oct 2020 16:56:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D68FB20790 for ; Tue, 27 Oct 2020 16:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603817793; bh=UiLXTqD7WoMnhmIwPNnT8EloUA+a6xiI7oDA2OKNmD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AQ+x7sicwaqXYHP1V0O3BSch1PKzNjw2iM31DGIEK3HcOenOrzpaN5yMYm6oFVgwX hdtWESHtrBT8cSiZZLntV46/qfXnluTx+Dtlkt3gbtmqKGM1U2lyCB5mRj8lDW9a4n hYiCB4GkZZD25ybIo1a+wDBquDbQUsglJDTKdeoE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794413AbgJ0PLm (ORCPT ); Tue, 27 Oct 2020 11:11:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:35840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1789273AbgJ0PBw (ORCPT ); Tue, 27 Oct 2020 11:01:52 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E804020715; Tue, 27 Oct 2020 15:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810911; bh=UiLXTqD7WoMnhmIwPNnT8EloUA+a6xiI7oDA2OKNmD8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wzM6X6FCY/U+jzMqkfSKgm+fns3ShtzHsm4P1iH+QFVvBWXq18xI8mop5LxO49a5T XDs4BzRnKXwpp1TJFuYag77n2DaB/JHRneEpC5i+0CrFVKeqqwgvZmC8In0TzARjnR dA64kSjw5yX5dEaZqm8qoP+JKyLgbI1tg7HSN8RU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robin Murphy , Logan Gunthorpe , Dave Jiang , Vinod Koul , Dan Williams , Sasha Levin Subject: [PATCH 5.8 306/633] dmaengine: ioat: Allocate correct size for descriptor chunk Date: Tue, 27 Oct 2020 14:50:49 +0100 Message-Id: <20201027135537.029189670@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Logan Gunthorpe [ Upstream commit 028926e4ac8f21af343c25794117fd13c08b1712 ] dma_alloc_coherent() is called with a fixed SZ_2M size, but frees happen with IOAT_CHUNK_SIZE. Recently, IOAT_CHUNK_SIZE was reduced to 512M but the allocation did not change. To fix, change to using the IOAT_CHUNK_SIZE define. This was caught with the upcoming patchset for converting Intel platforms to the dma-iommu implementation. It has a warning when the unmapped size differs from the mapped size. Fixes: a02254f8a676 ("dmaengine: ioat: Decreasing allocation chunk size 2M->512K") Suggested-by: Robin Murphy Signed-off-by: Logan Gunthorpe Acked-by: Dave Jiang Cc: Vinod Koul Cc: Dave Jiang Cc: Dan Williams Link: https://lore.kernel.org/intel-gfx/776771a2-247a-d1be-d882-bee02d919ae0@deltatee.com/ Link: https://lore.kernel.org/r/20200922200844.2982-1-logang@deltatee.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ioat/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c index fd782aee02d92..98c56606ab1a9 100644 --- a/drivers/dma/ioat/dma.c +++ b/drivers/dma/ioat/dma.c @@ -389,7 +389,7 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) struct ioat_descs *descs = &ioat_chan->descs[i]; descs->virt = dma_alloc_coherent(to_dev(ioat_chan), - SZ_2M, &descs->hw, flags); + IOAT_CHUNK_SIZE, &descs->hw, flags); if (!descs->virt) { int idx; -- 2.25.1