Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp275740pxx; Wed, 28 Oct 2020 04:46:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymW1DsCzEgRWYiAy+TpQcCucWNxtGjSA+BZvD1LoZT/b0nzsf/0/A2dpWm3MzcgsAvU7N0 X-Received: by 2002:a50:e40c:: with SMTP id d12mr7112559edm.35.1603885600362; Wed, 28 Oct 2020 04:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885600; cv=none; d=google.com; s=arc-20160816; b=e5jfCUQQQJGRgCiIs0IVyXgCqtWGd41rnOsKAXTbvRrVHaBn1lAbp+d+G2+MNabO5/ 6X5rghXwekd1UFRLU7x9Aviz+PyWloz5IrSVoxKdPcUPVCVzzgqzjCm+fZKtVRCD27EX lCKnxzv2Q4DiemK1Kpuhj92KiuENhrQuIMCxztBTwsQ32yTYmqg1J6aqb54JUXjyge0C yTdD0xy0sqF9RSn8HoNMxwo50ugzoTAMQC27CitmuQepGi7RvEO2lKMEb5KCUs1Mj/CM 7HRdCtkL7h8MR3z0XkgW31VElosvI2FZk7lhvhCiNjJ/x2WvSJ5IItlKJK/E13XEd3XQ FErg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kef8L6ONNIgTI3aZZzJ9fJfOV0jEQ2RhrJ3FGjXR2J4=; b=OoIQwb0glPJZPW3W1FPGoJfpJhCvq8XfQW8SKMxpxIs1I7bjnFJImWy8LgeuNJchMj SXoc84JtymGZJec60aDh5UvRnOApCC062mA6XAac8EJGgZdM6KGpYtKpsQX4XJaUM+U2 Fs0LsPCEdiwuvqB/cnf5myHjTqGfxhWQdFS5LqMf/s9yV1oFgeW1n8zSOp5GcdMdfNJu CStzTkeBy5qD2Fl4UJzf7dSjgTkSi2sqGZEd//gHz525aXULzETML6RFaAh5JsclZLWo akAVV5+iNK1RZpRZYt6guzoEK1B/0z1hs+o+A6UqIXQpxrVaESkpA7g9O1DTKp9WJ2ke TS3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wzM6X6FC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si2719069ejq.533.2020.10.28.04.46.17; Wed, 28 Oct 2020 04:46:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wzM6X6FC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794407AbgJ0PLl (ORCPT + 99 others); Tue, 27 Oct 2020 11:11:41 -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