Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4233472pxk; Tue, 22 Sep 2020 13:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQayoRYIkGhHfsPqKodWxiXJE5hA5R3llLxBcciImnxg+ZzttczCGmVyz5w6TsYqZ5T6rp X-Received: by 2002:a17:906:8508:: with SMTP id i8mr7291305ejx.390.1600808373491; Tue, 22 Sep 2020 13:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600808373; cv=none; d=google.com; s=arc-20160816; b=ROmc3gA3a6hR7TDimNKGJ1+oNGGhXJFv4RcAuoyg3M302yYmZJWLyJZFc1BmCyyhy6 v553L7uMhWaL3r0E5wcDEEeSfO8WTLNv4kZk5XZfLlp1OqQTex228B6lcSHm7RfhMNEU Fnb8znUuh5pzyjLhYSekqPd3fQjxbdo7K2hT4ooPNqiVFsZFuErfTa6l56ZvAw0eYRdf 7PPGeRWGELPvOKQdgMTlvQXjcKvSYjP0Tbpkn6eTvspqMH71nOeFpy2OMPFRA9FAcacA WA6sf7kfve/ucFe344QizXAPYuav8Cao0WBj5AEknyH0LcqTFMzhZb+vMb08AWBIJbA2 Pd1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :message-id:date:cc:to:from:dkim-signature; bh=79PSozI9m8qEzrG9Klfx1TLRdoa057EVPadwK1EgUac=; b=lVq0e99rJPfGovKGYzF1ycXD3o9uYoR/xR7ZA43MgAoRnVdXM8Wf9E0/eN71PmYH/I aRolMT2liFygOwTn3Hj3qmMLSPCofRFCGETjdUo2XfFaCCQzzi2rIdQFPQJAEHIjh/r2 tLvmMeMk4ALUVD8fzE3v8OH7mYc7im+bpw2BiI+1htBvd855Nngd8YIHbtV9IzspTU+6 NPZ3Er9811C6z+11IagU3n0YMIlZbBxjAYeophVQdIMVXot6vxScMN0nb7pALyXgYUM1 6JwwLYdYWXfdOM13pvcl16BHyyliuVXzy3BkyqzGfhkHmrn5budPMttNt6x77bNIeoTu 8J3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=KW7paQGH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si11160511ejr.560.2020.09.22.13.59.09; Tue, 22 Sep 2020 13:59:33 -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=fail header.i=@deltatee.com header.s=20200525 header.b=KW7paQGH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbgIVU5l (ORCPT + 99 others); Tue, 22 Sep 2020 16:57:41 -0400 Received: from ale.deltatee.com ([204.191.154.188]:49992 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgIVU5l (ORCPT ); Tue, 22 Sep 2020 16:57:41 -0400 X-Greylist: delayed 2926 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Sep 2020 16:57:41 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=79PSozI9m8qEzrG9Klfx1TLRdoa057EVPadwK1EgUac=; b=KW7paQGHjjmNPAK1+iHprV2RrP Pjyn36ukSG61uAPUratvBrwg0QAQLCIhj6j+CwQVXDCNBhi5cV99jqm2aBMwI+AAWfQPrViRkAHR0 S3sV51L7gORzwW5hSB3WDY8YFodZWDAVdtxrwwzH62oMjvEtkrDF3gyyOAqallQSAU2lkWtFbpjB9 0LbFszfeaKVc21J5NhCNk8z5ZxFqw6G5XD9eLCQ85jmwTqMlfuiSsI4CFbY3N+wEZ8aEH3eHWUg3f AGghPAgk93qR9h8EvEtkoNh7B7YtfiStvUuhXoNsAP8Tr86tFQtwt7f9DQrQ95ApiRsFEOhDNCoyF at4/8fww==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKoar-00058z-R0; Tue, 22 Sep 2020 14:08:55 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1kKoaq-0000mq-D4; Tue, 22 Sep 2020 14:08:52 -0600 From: Logan Gunthorpe To: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Logan Gunthorpe , Robin Murphy , Vinod Koul , Dave Jiang , Dan Williams Date: Tue, 22 Sep 2020 14:08:44 -0600 Message-Id: <20200922200844.2982-1-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, logang@deltatee.com, robin.murphy@arm.com, vkoul@kernel.org, dave.jiang@intel.com, dan.j.williams@intel.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, MYRULES_FREE,MYRULES_NO_TEXT,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Subject: [PATCH] dmaengine: ioat: Allocate correct size for descriptor chunk X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Link: https://lore.kernel.org/intel-gfx/776771a2-247a-d1be-d882-bee02d919ae0@deltatee.com/ Suggested-by: Robin Murphy Signed-off-by: Logan Gunthorpe Cc: Vinod Koul Cc: Dave Jiang Cc: Dan Williams --- 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 a814b200299b..07296171e2bb 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; base-commit: ba4f184e126b751d1bffad5897f263108befc780 -- 2.20.1