From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8274EC78850 for ; Fri, 20 Sep 2024 14:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hsLOgP3s7Y8rXD/2r0twWks5E/0ndA2MvtbD57lX80k=; b=C71Rd0uPSYvq/wHq8Sfz1xJXiO 58GE/kXRyo7l88FDByv5M2yUDlud56vcs5n7cznO5J6kcxOzq/1MwaZmvzYJlPpAaJsyNLt8pnYEI tRCjHrHKNUEdWA4MzPg4N6GskNXHl0gg8+scynNz4vHO1R7OX1P8QWt2yl0dHlrASFRr9iNHsYbmT BiQoWSw4+LtrDM25bt6KOhDQG/SPrn0k6Hgwio7rHLOvou3zgsHpuPWFmSu5ESb5V3sXaoxViPuqi A4bKqnQoz023tsYMGH5/GfKEWJSrmOJaTGo6vFizYRmf+xmxa4VoMY0hTDatirEHnHzzyrKSaNdWq TzJG0bDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sreT1-0000000CMYL-1o1B; Fri, 20 Sep 2024 14:18:39 +0000 Received: from mgamail.intel.com ([192.198.163.19]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sreRt-0000000CMST-3tSE for linux-arm-kernel@lists.infradead.org; Fri, 20 Sep 2024 14:17:31 +0000 X-CSE-ConnectionGUID: K8t4u5sGR6aM5p3AORwsYg== X-CSE-MsgGUID: uCcLZQv3RQaOXVpOiiKQ0A== X-IronPort-AV: E=McAfee;i="6700,10204,11200"; a="25368451" X-IronPort-AV: E=Sophos;i="6.10,244,1719903600"; d="scan'208";a="25368451" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2024 07:17:19 -0700 X-CSE-ConnectionGUID: am1L4D7QQGS9HGwNuge0wQ== X-CSE-MsgGUID: +qZK57IRSg2Ssk8wNh3tNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,244,1719903600"; d="scan'208";a="75259572" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa004.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2024 07:17:17 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98) (envelope-from ) id 1sreRe-0000000Aw1E-2P6q; Fri, 20 Sep 2024 17:17:14 +0300 Date: Fri, 20 Sep 2024 17:17:14 +0300 From: Andy Shevchenko To: Lorenzo Bianconi Cc: Ray Liu , Mark Brown , AngeloGioacchino Del Regno , Christian Marangi , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, upstream@airoha.com Subject: Re: [PATCH v2 2/2] spi: airoha: do not keep {tx,rx} dma buffer always mapped Message-ID: References: <20240919-airoha-spi-fixes-v2-0-cb0f0ed9920a@kernel.org> <20240919-airoha-spi-fixes-v2-2-cb0f0ed9920a@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240919-airoha-spi-fixes-v2-2-cb0f0ed9920a@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240920_071730_010116_F219D152 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 19, 2024 at 06:57:17PM +0200, Lorenzo Bianconi wrote: > DMA map txrx_buf on demand in airoha_snand_dirmap_read and > airoha_snand_dirmap_write routines and do not keep it always mapped. > This patch is not fixing any bug or introducing any functional change > to the driver, it just simplifies the code and improve code readability > without introducing any performance degradation according to the results > obtained from the mtd_speedtest kernel module test. ... > + dma_addr = dma_map_single(as_ctrl->dev, txrx_buf, SPI_NAND_CACHE_SIZE, > + DMA_FROM_DEVICE); > + if (dma_mapping_error(as_ctrl->dev, dma_addr)) > + return -ENOMEM; Shouldn't this be err = dma_mapping_error(as_ctrl->dev, dma_addr); if (err) return err; ? ... > + dma_addr = dma_map_single(as_ctrl->dev, txrx_buf, SPI_NAND_CACHE_SIZE, > + DMA_TO_DEVICE); > + if (dma_mapping_error(as_ctrl->dev, dma_addr)) > + return -ENOMEM; Ditto. -- With Best Regards, Andy Shevchenko