From patchwork Mon Oct 24 11:29:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp424046wru; Mon, 24 Oct 2022 05:26:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4sRpmfCC8oAX0BMZyvZLZr5kNW9IafDO+AxAI/KbIixOa1Mx5xjRASSwAlJo8IU0xgzSiE X-Received: by 2002:a17:902:8642:b0:186:6740:dfd4 with SMTP id y2-20020a170902864200b001866740dfd4mr21416627plt.18.1666614391339; Mon, 24 Oct 2022 05:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614391; cv=none; d=google.com; s=arc-20160816; b=aiD965g5kuSuSCq3xB3SOFZZaTm1LD81d8w8r9lU7/5KH4PYbgx8KvxbIpSznmIuMk LEufA1b2V9m3TovugItU/JnKAS2IAkfeYcP0XtQ2hA3L3aJ3vjwq/uoa1e1v9vuTfKjC e0NBM99lrvVipN4ZOyjzza7ymWUPJy0J8uJhpWZNRslqi7OdwCYA8UHuLMN6rHpUQ1Jr vfcS3E7Vjkc71kLzF8JIiWgiQPLU84f71g0JBryrZvOygbEBBoEWwbyRnVrc2asxx259 oZSU3oHVxjxaiIvKVINxPKkEbGg4QkCnSNily1Ch+WreddwT9kszlXXQRRtVUAFOzCVn DZyw== 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=d9+VQVnfw/LLAzgWElOjsZ5JayxdB2p/rzl1QjzdOdM=; b=HVfQpFUU8rL8JcCR0oIqCXq8sPlMQLwu8ENIoWwfwjJXtMwBRwZHbW+SAVqVi0ONxd L7Lpu8CQhW5cjf3sUrHwi4qPQLQ6sOTXJ0QKphyrimxakoKew3Hl52BHvNH6qw0LMsDG UP/Oi2UmHIW0YPcpPKAZWd1gRfiGamKNqM16rLeajoJPiS75brKK6WYsocX2eZ77pNtc sNdaVHf1jFQ1KE+gR76DItflC9e0CoXGyIRhxoQYDuvkeF7nUf7ZjQfRqxh2+6BowIbO +nbcxfyj5+0K/r2P9RyTOJeJkRPyisvBpimQ/UVSN2m328K6Yp99ZfpjOQRh8PC03cGz fi4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sz6U8loa; 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 k3-20020a170902ce0300b0017492fb90b0si34907485plg.182.2022.10.24.05.26.15; Mon, 24 Oct 2022 05:26: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=sz6U8loa; 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 S233619AbiJXMZw (ORCPT + 99 others); Mon, 24 Oct 2022 08:25:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233786AbiJXMYS (ORCPT ); Mon, 24 Oct 2022 08:24:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A2F85FA8; Mon, 24 Oct 2022 05:00:24 -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 1A048B811E6; Mon, 24 Oct 2022 11:56:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B084C433B5; Mon, 24 Oct 2022 11:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612571; bh=MPx8MYZaOpRhJircYdIbMtxUIK98qNQOL2IsJCYo8Pk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sz6U8loaYMgwSKHqpZ71LGpQcWIP+nMdiOXq1Oh7amVNN/XtX8Smpx3c/dXlB/TIk 8MfxGBMxfnm241msD4iiE9w54yPoG6UNCZ8ptDjDS6DZwP6BO8HlmynWa1NzHUJVpo EoPLInAtPDH1Ki4yxmR+YD62Eh0iJu8MOsciyb60= 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 4.19 037/229] mtd: rawnand: atmel: Unmap streaming DMA mappings Date: Mon, 24 Oct 2022 13:29:16 +0200 Message-Id: <20221024113000.304537542@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747571852172056470?= X-GMAIL-MSGID: =?utf-8?q?1747571852172056470?= 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 @@ -398,6 +398,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;