From patchwork Mon Oct 24 11:28:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8862 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp433128wru; Mon, 24 Oct 2022 05:48:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6EvWZ+WtSgVUHQ/0VFp+6EywbXsy1c8ArPdlQiwNAg0JJv6nu2Tjmufeolcir7ascSfJD5 X-Received: by 2002:a17:902:7104:b0:17f:cdc1:f4c3 with SMTP id a4-20020a170902710400b0017fcdc1f4c3mr33000690pll.149.1666615717522; Mon, 24 Oct 2022 05:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615717; cv=none; d=google.com; s=arc-20160816; b=GzFae/mLGj7qawxuFawN26b8lLgZXtH4UOrT+bD19LIYk1/YEr308E+8s2GHfvs+Q3 Nm+dQeaFP/Qmvkpy3PrgxIE9Z2H2XnTki1VhizhagzvdI6711jkNwy4A+yZ9jAJZ6SsT cfGPyzQNncbIFMPIAMfJ5qnCZBLrtxXgELgp8Rgft9/PIgEdKuCOMqGowAjLJg6QoXUs //AwC3kFhLRsWLbn8bM7U+dSLPcwgKtPgs21En2EaDnk/77FUZ/rj/KLgGy/Pk06qd2b ChQk0OwEY8uGBdNHN1TTw1wlCk8i0NDzD9YxdkLrIYlTuJ5x9A/Wal9Fxe/Ua4S2FOzB bflA== 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=9+k1eoOzcsj4j7f1eLP6uGCCZwcWZCnOBOjQDa6MEz4=; b=A4r12MZ/L+FmVqqL3+i2gciEBlUzUq1KFeIWl6QLiR9V7RNGgONByt1DsLJCLaW418 ryD2grvLKip2pdmQZVmI79DfvkJkK/kds38i7Hn4+Ot9vftvKBwWYCjTCiG93gdhNKql trWbs7OfpzSXhUiD7mH1CYrT4EmVZvm3VfLMtEonxGAGkn47aj9MGaa6kvfxnKlkP+CF qHHNNO/JDsOOQk2Doo4WaVk4tWiS6aloTFiReDzQZgaigQgVV/Ahp/J1LJjGK3w7cwqm X7G1IVbKEwdhmAIZM+0r0c/Od32Xcwp061LjRBzPd4JrryvthFj/VlpOkgRzDGGvr3rK hjrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hkc4Au0R; 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 b22-20020a63cf56000000b0046aff3cb64dsi35275228pgj.410.2022.10.24.05.48.23; Mon, 24 Oct 2022 05:48:37 -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=hkc4Au0R; 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 S233904AbiJXMla (ORCPT + 99 others); Mon, 24 Oct 2022 08:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233901AbiJXMiD (ORCPT ); Mon, 24 Oct 2022 08:38:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1E5089CF3; Mon, 24 Oct 2022 05:06:42 -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 879AD612C3; Mon, 24 Oct 2022 12:05:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99E3AC433C1; Mon, 24 Oct 2022 12:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613156; bh=QZ6pfJr0Ucw6vmD9lJggPgJH3hSM93RxrgY4K2fGqG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hkc4Au0Rdyt98qvd+NcpyEsPaSiuf/0LdB1eoCPWwToV8zsjUb0CxUC71MiMKFkjq ZoJZHDto1sXooTWvZX0EeCIaQsznkEhQ8xU+kPtds8UJrzXs0JDhmlI3W/fQcDoHH7 qVkyEL7jx3pC7dGo5F+ZdBS8KGHafoffHFMV90V0= 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.4 009/255] mtd: rawnand: atmel: Unmap streaming DMA mappings Date: Mon, 24 Oct 2022 13:28:39 +0200 Message-Id: <20221024113002.759123643@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747573242858227536?= X-GMAIL-MSGID: =?utf-8?q?1747573242858227536?= 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 @@ -402,6 +402,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;