From patchwork Mon Oct 24 11:26:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9704 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp544620wru; Mon, 24 Oct 2022 09:32:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6iOihj0qJhU1nVWq9HHv6ckxW8M1OHIQNz1oCVT21gkIz30wRoYKWjWygTjORL3ab0XP1a X-Received: by 2002:a17:906:9750:b0:798:9ccc:845d with SMTP id o16-20020a170906975000b007989ccc845dmr19149972ejy.760.1666629151700; Mon, 24 Oct 2022 09:32:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666629151; cv=none; d=google.com; s=arc-20160816; b=a0nf0rXPVIA4JFnGAAaut116GDzlvXlq4qIC4ONHuBPhvhBelNqM/S8F9X+OUljBnx DUC9yVtg6wZGaW4ZsI3f2whQEWuzWZzFe4tzrAF51eX6NeJHEEJ7768l9HPZH/Dw7CGL vaFuaxKIzqHm4f1IG+3R9LiIKB4h2y3qgWcc7TGPAjgfs/LYIvW8ehbENar56Cuv8cE7 Bi0+QdOdqzFGp9BNJiEYHYGy1L3SoFo1/2OzeK/0Vez5zgZe4O0SDa0mSZ/w7givmjB/ 4E6F4MQ5j81MwJ5gQEpZyQXi+0T6WicEgvIUfd5p6dgoC9kDt/xOJI/rVGWMiaRuUhz2 S1Cw== 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=ICerq/AfOym981P0Y+JYGeCVM6Th1jVdBD5o94nQtNY=; b=a3bx0deXPND77+tkei/NXmV4ShysYwBULl3t9d8aa23Dhko5sl5aHqHv2sPQhq4xNF nAjtMavtOgUi8aD1aG1F9ncY/AKB/wWpuhzvct9hl792FGggzB2I3tjykVpS4/msiwT6 S5brevR6himVFWwFuD6l5w5DnfQr1h2CMKFBXGSYqyewww/yadsN8xBlhKbuG5An6hLK XVYb6UlripgtR6q8cvl4wCQ4ZQYRksMOdJnQKka8iyJC9yXhJiovzqWizF21ZHAtNIGy 8IN/2ezEmsaLkukCjiz9Mu/tsYVbVNZiLZOgFoeGTPWJzH1m/f+9lia/HiXsk/N5DNWT OpLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0ZVnhIMf; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a056402440b00b00461cf92400csi218851eda.488.2022.10.24.09.32.07; Mon, 24 Oct 2022 09:32:31 -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=@linuxfoundation.org header.s=korg header.b=0ZVnhIMf; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232907AbiJXQRo (ORCPT + 99 others); Mon, 24 Oct 2022 12:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235082AbiJXQPp (ORCPT ); Mon, 24 Oct 2022 12:15:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DB4D10B70; Mon, 24 Oct 2022 08:03:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E6C08B81544; Mon, 24 Oct 2022 12:16:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45E2FC433C1; Mon, 24 Oct 2022 12:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613807; bh=0LcxMqzKBXHZAcPKt0pyDjPeM3azFWJ3SFXQ6kVQIP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0ZVnhIMfkVKTql0nbnY5j7N6fxgMEe9ZnOaTigLdCnzHqFmsXca4xnJWGVxZjWRgQ WmttXo61T7Ja6zQK9jJyV6vMvBgIvAAfilfSh7t/hRpb6SZ9C4Sd6rPCoR+npVgKvO 36pCRu9fpO6gKoCQl2kJm2gRkicBz+zvaOpfz2Zg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tudor Ambarus , Alexander Dahl , Peter Rosin , Boris Brezillon , Miquel Raynal Subject: [PATCH 5.10 009/390] mtd: rawnand: atmel: Unmap streaming DMA mappings Date: Mon, 24 Oct 2022 13:26:46 +0200 Message-Id: <20221024113022.943634207@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747587329148554794?= X-GMAIL-MSGID: =?utf-8?q?1747587329148554794?= From: Tudor Ambarus commit 1161703c9bd664da5e3b2eb1a3bb40c210e026ea upstream. 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. Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ Cc: stable@vger.kernel.org Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Signed-off-by: Tudor Ambarus Acked-by: Alexander Dahl Reported-by: Peter Rosin Tested-by: Alexander Dahl Reviewed-by: Boris Brezillon Tested-by: Peter Rosin Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220728074014.145406-1-tudor.ambarus@microchip.com Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/atmel/nand-controller.c | 1 + 1 file changed, 1 insertion(+) --- 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(struc dma_async_issue_pending(nc->dmac); wait_for_completion(&finished); + dma_unmap_single(nc->dev, buf_dma, len, dir); return 0;