From patchwork Mon Oct 24 11:25:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp462235wru; Mon, 24 Oct 2022 06:45:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5KLtJUCRCjmBTdvJXOlNp75CI4aWLgAVA9iNz3rRvs/bcWLnBVLb6AdOnS5oMlrOlMjDWb X-Received: by 2002:a17:907:2d1f:b0:78e:174d:2ce0 with SMTP id gs31-20020a1709072d1f00b0078e174d2ce0mr27849056ejc.638.1666619135444; Mon, 24 Oct 2022 06:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666619135; cv=none; d=google.com; s=arc-20160816; b=PXm0Ehkx6EAL5c0fw4FWRPRcNiRfkNNo068xhxukS1RY1tPJSKbxWnK7+sYw5j9IPC qsz9sXlJXDKASAcDXG1KQEiK+a8gAk6zcqxYSA2wj6ACOH9yrfCu0fs6TLQfKirB9lR4 LQVKVsTq4St7dr0ImBJ4Do493n2Rpjq4pcLYnCxGCBR8eQAKxQp1vYo8rDQdM4a7pwXc lGfjsDi1go99S6TRfAb2uocrfCDlGLWMNCKq/lXlI2vtnphB+F6d1vNhoqK+WfrbzIMx tc0ON1f0b7Kypa5l/llpcNgEAc8uZ/sV14lyYrUtyWqeXT/eJmnXtgB5ID/5TKHsrebt p2Rw== 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=acf6uCEqqIC37gGj+6DE9L8RxuGzKKq1gkV1O5nk29WpQ53wK4ATHHpEjjqKM8H/Nw L/LAi32heaOtXd2Xgq+bw82P9qE3j8iv5ufbOt5TgQhmIKNZpNmnlZdO0lWklkT78bPN F4Pd3lwrQJ0pD9lUy5Y0+9DE5lKdwP12BWjifm+9d2FXDvrV8bh9iWJGlH2Vm0s7sLA/ naH8qehKbl61VKGHrvYi6WYlhcq38khkgJEfiaYNTqclmN9LjByDpn9jVwtt8NWr30eO a1k0ihmkLajB69V0mN/2csv8/Y9g8+LBxDYfVVRVK+UQtjQhXiOzWDdPmZCIZTr+wxqJ WsZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BMgk2GGG; 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 dd14-20020a1709069b8e00b00797e151e571si13365022ejc.36.2022.10.24.06.45.11; Mon, 24 Oct 2022 06:45:35 -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=BMgk2GGG; 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 S233514AbiJXNg1 (ORCPT + 99 others); Mon, 24 Oct 2022 09:36:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236409AbiJXNbB (ORCPT ); Mon, 24 Oct 2022 09:31:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 276C03499D; Mon, 24 Oct 2022 05:33:48 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A6ECF6128D; Mon, 24 Oct 2022 12:33:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7AACC433C1; Mon, 24 Oct 2022 12:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614804; bh=0LcxMqzKBXHZAcPKt0pyDjPeM3azFWJ3SFXQ6kVQIP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BMgk2GGG+8IGqJ02c0QiIB+blbx9RCSny5j0Kp7aCJIi/jyJfI/xB1UXzat6viAgs 8eioe91FoKbo7odYW2Y4CmT2qhHxac5x8rLXHKhQinVG2LBefPvVf0sVxWaLtr2jHT uum5f6rlCfdEtB5S+j6oCLd3CbQQlNc0QMO+DcVI= 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.15 010/530] mtd: rawnand: atmel: Unmap streaming DMA mappings Date: Mon, 24 Oct 2022 13:25:54 +0200 Message-Id: <20221024113045.472019588@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747576826093668330?= X-GMAIL-MSGID: =?utf-8?q?1747576826093668330?= 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;