Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3478396rwb; Tue, 16 Aug 2022 03:56:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ywVgSofBWtMwB8AChpPipsobVSfiX0zbaaKJvShCXl8Q2NX2/d0o4DiH98rhvn46iYRrV X-Received: by 2002:a17:907:9710:b0:731:67b1:dc3b with SMTP id jg16-20020a170907971000b0073167b1dc3bmr13267424ejc.709.1660647407060; Tue, 16 Aug 2022 03:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660647407; cv=none; d=google.com; s=arc-20160816; b=L9015yn2lXfDw3D69HENZ82fV8EeJcIp7ANcQcFtjSLPnva4FoXU9AHNSYTLz3gxwv 1PddcGqVB/e6pV/h7D15hDvegYSav0Xjv9r9yK1lTn2ZU2siAgVZ5rouHvIVJW4uOxBF Ad0728R4KBiKBx324ONR9HP4VNkc9Haw6YSLE9iG50IvEh0wLWjHTRUKVHSg0xhfNWZ4 8VXMnfk4KtvUPlTV9dXj3CpKLT3anXr/ts51DbTUAc6Pi2VLv/Fkw7ip3OI/SUQKOxJH 77l6XDBSGeLRk0JbUBRFFvppPBf7eKv99/JT/AG7/0kgOkNQZfnY2iPx+A6auBSZ0rVE 8BVg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=wKUWmCXiIM/Hng+Y1iYvvQZfs4zukk2+r7qi+th7FDA=; b=YBCU6/1ZFeCm4UzcHhVtPcqkDZ/hw7LzKSB+bX/Zwql3OzNLueiSK3VsD3JWGiiLdK tEtRG5MRXruch2rXGiSFgQd0WGM5S5X6zQ/rAjSHmVwrFtelWYueTBnLuCY4vnZiXRWW FVp1hh2aSLyB6iWve4T2sA2RKc6WV4t4rVLuP8Hinbc0l3IF3oaYBVOe5nBSQUptI113 9o3TYaOebsrz5kY+lpXe+5wf2KGyop9Ab+DnUQCZ+gwoPh8rFSBzOhw3yGMZ/hXKAe6f PgZqeXn8z8Cjbi7/TgJu/ir7yS9Z0OT3wceJfpJF3boh3rGtRLryvlqbr6UHMg6wQ7Fs svgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AosFn7pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds10-20020a170907724a00b007235473b2fbsi10422759ejc.680.2022.08.16.03.56.21; Tue, 16 Aug 2022 03:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AosFn7pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234333AbiHPKIQ (ORCPT + 99 others); Tue, 16 Aug 2022 06:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234194AbiHPKHy (ORCPT ); Tue, 16 Aug 2022 06:07:54 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF23DCE5; Tue, 16 Aug 2022 02:09:57 -0700 (PDT) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9CDC96600363; Tue, 16 Aug 2022 10:09:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1660640996; bh=UwVGjoVej6+DPEt5C/pkEjitJeLt0M/cBydSA/bfdQQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AosFn7pt+1QLjDkVNSdhDB41d34g7CimXuprljhvI4FPZzI/laLs4D7OYOoDW36HS dOu6VsOLip5jf3+BQYcKxmFeS00kV++m/EStvYtkOpLTaM7BYTaVP5WknUdN6m9VAs 65C0t5G+EYsLoqJhAHp38iC5F/L5ypYw4cFpL4NMifsE8ffzL+P+xNE9AU85EI2Fyu th6t3OcJIFVpGOyBfjYDss2KPSrGNjB7gqMERN7M8eqTqd9QIdRuL7VXjVwnkX2XNd chHsM/k9URQXyEceZkksJXFEm4wbSUA5eG7TGAlnSe6/gKFI54MqHzQcrhBkU94HU/ IB/mHt905bmsA== Date: Tue, 16 Aug 2022 11:09:52 +0200 From: Boris Brezillon To: Tudor Ambarus Cc: , , , , , , , , , , , Subject: Re: [PATCH] mtd: rawnand: atmel: Unmap streaming DMA mappings Message-ID: <20220816110952.31cf212b@collabora.com> In-Reply-To: <20220728074014.145406-1-tudor.ambarus@microchip.com> References: <20220728074014.145406-1-tudor.ambarus@microchip.com> Organization: Collabora X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Jul 2022 10:40:14 +0300 Tudor Ambarus wrote: > Every dma_map_single() call should have its dma_unmap_single() counterpart, > because the DMA address space is a shared resource and one could render the > machine unusable by consuming all DMA addresses. > > Cc: stable@vger.kernel.org > Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") > Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon > --- > drivers/mtd/nand/raw/atmel/nand-controller.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c > index 6ef14442c71a..330d2dafdd2d 100644 > --- a/drivers/mtd/nand/raw/atmel/nand-controller.c > +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c > @@ -405,6 +405,7 @@ static int atmel_nand_dma_transfer(struct atmel_nand_controller *nc, > > dma_async_issue_pending(nc->dmac); > wait_for_completion(&finished); > + dma_unmap_single(nc->dev, buf_dma, len, dir); > > return 0; >