Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp322022imn; Thu, 28 Jul 2022 01:29:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vZk48i3U7qHqSlETn1aBSypNXTV3F9dj6XDNwbRvp9rgXQyXjZyNdlo/2wtEwfsD68uBcB X-Received: by 2002:a05:6402:3302:b0:43c:33eb:79fb with SMTP id e2-20020a056402330200b0043c33eb79fbmr14369782eda.281.1658996952950; Thu, 28 Jul 2022 01:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658996952; cv=none; d=google.com; s=arc-20160816; b=CYlLxK9772v8B5Af4eqCbI0mIqdRD9WZ+A49KxCDJLq0xXnl1HRNb+0OztrwsuLdvv jkFdQJo6xEir0VDZXnU93qtPPS/yNwDwOM5L4bANwT3B8FZJhiIAsnTwyVfbM1cfOtW8 21BFSxt/bki9SkIvkiOHEzMD19R4yNBf+P1UIufS4rnd5OSx0tTZisoexEC7zcjONHL5 4aov4IEQi7HefLaNQUICAZFkTcGi1E0JmlUkNtd5S/ngzzOEI4lZKwYMPA3rZhvNaeGr 5PUzSPuCdmL6wgFs5CVC+sVXMThNoe6hcGP5EOluLYK0iys/B8zw0TZ3HDWrgl3pSjDP NcIQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dT1uH7F46urcDJJ5bDxLaZlJvB7F/3wmqxyg8PN3t0w=; b=Gn/R9Wo9f6buan/TO6/RZQhXZik8CMht4BcoiLE3WsldGrG2uRi1hVX3rLSabjslH6 Lguk0A9g6BqWwIacaDn8D+oZBiWJjTHIXMfrcCVGKVQfircaGbMOJoQTwXBjWs4zgCZ7 QN3tAAW93e2qMH/w1pLXnyN2SNPF0yU1UddTZNUbNZXtWjKfF/lPd1JSAFEFcp2HH1AC 9A2/MAezmpZoocXCeegyVKOOd2PWtzE1P4aSBXSz1y7WZlJMcLDDnT66vuWmIYHNtjvx WRNhFLCGPhcEe4v+/wQODJ4zDNDPwXeYkI2b0fDt5ja3VOJkYebjiOe2lqa+sE+oS46Z 5Zqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=yjN8wqff; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wc13-20020a170907124d00b0072b0deda68fsi186933ejb.354.2022.07.28.01.28.48; Thu, 28 Jul 2022 01:29:12 -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=@microchip.com header.s=mchp header.b=yjN8wqff; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234548AbiG1HkZ (ORCPT + 99 others); Thu, 28 Jul 2022 03:40:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233314AbiG1HkX (ORCPT ); Thu, 28 Jul 2022 03:40:23 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6D3A1147A; Thu, 28 Jul 2022 00:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1658994021; x=1690530021; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oIeSpejyFizNCjTe32oFzhYJ7T8h3L0O2WEPh4ZDXt0=; b=yjN8wqffpZBuhaeChaorjAqCNdcgcnXSAelq6SLUE4yz1SgYj7Yau/qJ jIdr2eQfGfFEcM/tql8Ml33VIBub9XPH7Q8zSfkMfbbUT/ofqECCyNY5p f9gDUQystuYDD+ZD9lXUL+T4LnWzPx2k2CnLv56+8kOucnbMsmY7IaFlD VCA8/k2an/obrWR1dioYW1b3R85BMDEPLmVSZ+rhxE8kXPL66wkXf6DhD RYGWe8LfXTca4wT6Z0f+EXy+2OEGY19W+laRlmP+F9ms3QII2+1L4jA44 H3LQAowjeTX0Vz8YT7wgc/1e9M8/os6Y5ss2fIhrJyvlj8WOPeex5Hq0r w==; X-IronPort-AV: E=Sophos;i="5.93,196,1654585200"; d="scan'208";a="166752216" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 28 Jul 2022 00:40:20 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 28 Jul 2022 00:40:18 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 28 Jul 2022 00:40:15 -0700 From: Tudor Ambarus To: , , , CC: , , , , , , , Tudor Ambarus , Subject: [PATCH] mtd: rawnand: atmel: Unmap streaming DMA mappings Date: Thu, 28 Jul 2022 10:40:14 +0300 Message-ID: <20220728074014.145406-1-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,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 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. Cc: stable@vger.kernel.org Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Signed-off-by: Tudor Ambarus --- drivers/mtd/nand/raw/atmel/nand-controller.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index 6ef14442c71a..330d2dafdd2d 100644 --- 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(struct atmel_nand_controller *nc, dma_async_issue_pending(nc->dmac); wait_for_completion(&finished); + dma_unmap_single(nc->dev, buf_dma, len, dir); return 0; -- 2.25.1