From patchwork Sat Oct 22 07:18:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1087059wrr; Sat, 22 Oct 2022 00:35:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ehQSzwDb4AsEv8Amc3WHU+IyxvYyOwZWqVhrThYdeKDfaIwERiHKgOInPiTm9j6jm1lNI X-Received: by 2002:a05:6402:3508:b0:45d:c4b4:4968 with SMTP id b8-20020a056402350800b0045dc4b44968mr20458982edd.272.1666424111383; Sat, 22 Oct 2022 00:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424111; cv=none; d=google.com; s=arc-20160816; b=n2DbZrKOQO+m5gvS32GrjmOgY+hWflj4mJhhD1ufVG7JYILi1ttqLT19a8LcG1jqmn XESINY2zPAceq876q5qeluqKIK5o3mDlOxljcmDiRpUixShvWB20VdQ6gjzLV2ILBwVu 9jB4yUnSckTE2uIWcxduaePm8WpYAE3Axw9GnI6k6+wtQCDKfF2NANqOTPQCY8JCilqX TiHgTsbkcbc9oiFDdcdLshVWvWzcY+qQTZn4aTQ3a90qaYpyy4pD5shEjqdIi/LeZtun echaBEiM/ZVp+jfWsXJVQZxYb4Jkkty9C63W9xdhblk1ym0LmOM9ADm4e2PWsfE+8LKt sdzA== 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=wOwmB0QwHIDUSi6TVKa046Qmqs6o8TnmvPiho51FnTgzfEpfEEQCsmkn1F8yzNbdQL iqTztV01fU+T9L/z7n7CJKvw3NZNlBMspIRQnPbl+/KpzlxXh2PzubGvb5oSuxVRUQEV zIN1HcT2Nyd54fI5lWBFvo6Lt/RW553TuWZMiQFvjXZDysrQreDV8KRF65FHmARqcy+1 GF5dkj9it64JFc0y6W8HKtrmfTy5RqkAuvFeoYQsFTCeLGcz9GrMqA3DCqwS6Fy7ss5p cTINWbWvyWqJUmh4vPmyLSqGkVRfx+N3SU86/xqoJq7h05LzaBWUVM+q9MM6ZJ/ts8kZ vcLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yKjIxHpE; 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 dm12-20020a170907948c00b0078a802cce5dsi10361708ejc.592.2022.10.22.00.34.47; Sat, 22 Oct 2022 00:35:11 -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=yKjIxHpE; 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 S229823AbiJVHeF (ORCPT + 99 others); Sat, 22 Oct 2022 03:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbiJVHeD (ORCPT ); Sat, 22 Oct 2022 03:34:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA2B7230808; Sat, 22 Oct 2022 00:34:01 -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 48AB260A5C; Sat, 22 Oct 2022 07:34:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50187C433C1; Sat, 22 Oct 2022 07:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424040; bh=0LcxMqzKBXHZAcPKt0pyDjPeM3azFWJ3SFXQ6kVQIP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yKjIxHpEfhh993AEUH4nJu/U5WUDueWNBL+6Bj921jAty/WZEZuOKyo2pyUWSAaN5 8ba6XloYJjfpHZ7dtJ7ZPX6TRxwUD69Vay0QKRquLNmaTFuDxU6I0yCBKnKYuKV8zG mIIv94ooID3BRHF3rbsKf7/i6+6FZVtlZxnTiMaQ= 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.19 010/717] mtd: rawnand: atmel: Unmap streaming DMA mappings Date: Sat, 22 Oct 2022 09:18:09 +0200 Message-Id: <20221022072416.900873665@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747372329009326334?= X-GMAIL-MSGID: =?utf-8?q?1747372329009326334?= 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;