From patchwork Wed Oct 19 08:21:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp202766wrs; Wed, 19 Oct 2022 01:41:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM71GT1gqaA3Sb2D6EI0PQOYoXX2BK2uZ3YokE+buDBhb/IoWmNGtxyzt5/PHrCxQBzeRSSl X-Received: by 2002:a17:907:2c75:b0:78d:c201:e9aa with SMTP id ib21-20020a1709072c7500b0078dc201e9aamr5777036ejc.235.1666168884343; Wed, 19 Oct 2022 01:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666168884; cv=none; d=google.com; s=arc-20160816; b=dBIQb8dXyuqhWDjSceku0fkIrSuwQsPLQSbEl8BmTQ6ev2OHLjIREnNeOR3YO2qUJq PDoMdPnglFAT9xI5w/lfh52cy8epCTG/6av/4FGnOnqnMHKvKn3dVbrDbNbB+jawhZnh MwvKXTsGptW4YmXxibkdKCtGp4L2tHG7p8rhwSjw/YTb7KdE5KVogX6HJzIEjzU1N7aV 0yDtAFTFyWWi0Rb5t+lAsSydRWN/MkywQMn/2s7NwCHgfmez6OE+5rJul+rPgC+JHLRN 1TXk97g1aOPweMNQkc6Xwyi3ziHH/8Cdg1kJfs5FiQFpQUNd/3u+DFaOVehZvD+x8ahR 85wg== 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=pzR2AhtuTC9swlW5J4ojU5tDJ8pD1O+HYWl3HDRhJ7+9Q8cKx34q91T1mQ9ibOhGH/ rJQTcakukk06jK1rIPT0a/5om5oMrIG5cgo0+AGAXc18uRzm9MdKMW2VBQlBu6ePO6T8 Om/qbNs48yodwxBXvXG5Y9EE/mqONG5tB/uqz8wyx6QWWWK91+x2YwiaPLUCc/wqEe+r WlZvbJkk25ZIJeJAl8Vpv43JCMJDgtbmKLsU6gidePP0nmVxnM+duRTq/kmhewEZYJrp As8dILhc/cmA8xfPtEV+IkNKREYWRfcMa6AD2Yil1gub7Z03us/rrQT8lJ5RD3CFAKdw H1bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JgGSTNNC; 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 t14-20020a056402524e00b0045dcc848b39si4795062edd.228.2022.10.19.01.40.59; Wed, 19 Oct 2022 01:41:24 -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=JgGSTNNC; 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 S230328AbiJSIkb (ORCPT + 99 others); Wed, 19 Oct 2022 04:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbiJSIj3 (ORCPT ); Wed, 19 Oct 2022 04:39:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EA6780BDA; Wed, 19 Oct 2022 01:38:49 -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 1B832617D7; Wed, 19 Oct 2022 08:38:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11568C433C1; Wed, 19 Oct 2022 08:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168728; bh=0LcxMqzKBXHZAcPKt0pyDjPeM3azFWJ3SFXQ6kVQIP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JgGSTNNCic+yDWIuNwSXH2R2meeF0U6UFhpmihyEDAEVcLD4x4f4HsdioteOV5uSa +7PnD5dLz/rrk7iabA0v1pqHCx+nwGRxVnCE1YSezhNDhkB601y72Iz30ZE9Z9f2qd sofHV23qji/Ab5FXtFd+f9I3zHAlL+WxJIpVIg/w= 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 6.0 009/862] mtd: rawnand: atmel: Unmap streaming DMA mappings Date: Wed, 19 Oct 2022 10:21:36 +0200 Message-Id: <20221019083250.416041539@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747104704221463642?= X-GMAIL-MSGID: =?utf-8?q?1747104704221463642?= 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;