From nobody Wed Apr 15 01:33:38 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB8F3C19F2B for ; Thu, 28 Jul 2022 07:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234606AbiG1HkZ (ORCPT ); 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Acked-by: Alexander Dahl Reported-by: Peter Rosin Reviewed-by: Boris Brezillon Tested-by: Alexander Dahl Tested-by: Peter Rosin --- 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/nan= d/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_co= ntroller *nc, =20 dma_async_issue_pending(nc->dmac); wait_for_completion(&finished); + dma_unmap_single(nc->dev, buf_dma, len, dir); =20 return 0; =20 --=20 2.25.1