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 E8449C78854 for ; Fri, 20 Sep 2024 14:43:49 +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=nZytTI6YNf1mQKIMBEouB/VEQCKCJYW3rXqp6aDyZZg=; b=3KwzdfBhQw4wCuEKv70EeWw+rb b+RN/wcqe3RxBOVuy3DZt6nV6CyhOA4jHGJvoTY/jurHs9LPwE/SonKHes8jEg+M55Ww0IIboxS5q hCW1yl6osAAwieEUMlulEap84wbCg2v9Lt7O4qgib2g5vZaOLB65j3QJuSR5GzF6FmR/T2EQ+2KHe DVMPROCzi71z4IYFaZS26nyH7dgUhBNhGFnpOtUWIDRV+p3qP4LL2VKWK+NJ1CW0kNCCDJv0k0dFp gr2SZn1qzT/vwN8ZUplCQ6yrxKY5ZpOuFsQXn9xU28A0sZBEaL4c5rYulbzsg45ViNmEvG0ppLxft qEGqngLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srerB-0000000CPNh-3lPi; Fri, 20 Sep 2024 14:43:37 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sreq4-0000000CPGz-3HBs for linux-arm-kernel@lists.infradead.org; Fri, 20 Sep 2024 14:42:30 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 6C32CA4185A; Fri, 20 Sep 2024 14:42:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F817C4CEC3; Fri, 20 Sep 2024 14:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726843347; bh=Byzt261dQ/GR0ge5mgHVVMKv2pKoBD8K6PZ6vkTEjpM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J5ALdZMB9sxFhfVJojkkcFCVh1m+QyOaHtb3W8QWp8mYqWSqkmnbCkt2fVHeCY1Sd plMzzveNUf1StABzr6xfiIz1yXkfWMpZjWXb41q+A91+qU8VXrgBdkUVjZEfUvSXxd 5aXRPmzD1fM58mcPgYeoGochH0vcRJtzEkCx1CO+7eg5LMF0tlIGz5hM54y2615spK MpoeadzQA5BZGjK5nd7GdDeACnQmn4HxqTXAEYSO62Z609l7JDHGN6jRDBHnRvk6Sw B47Lf0V6VyGRCIWvotBqegFWbMNb1lwoc6ARh8DD4+xZMYjV5vLYzPnTEb6od6EEcq E5MvYsYewZV2w== Date: Fri, 20 Sep 2024 16:42:24 +0200 From: Lorenzo Bianconi To: Andy Shevchenko 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: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pjTKbbGz/7+vpOLe" Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240920_074228_912931_573B453E X-CRM114-Status: GOOD ( 18.87 ) 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 --pjTKbbGz/7+vpOLe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sep 20, Andy Shevchenko wrote: > 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. >=20 > ... >=20 > > + dma_addr =3D dma_map_single(as_ctrl->dev, txrx_buf, SPI_NAND_CACHE_SI= ZE, > > + DMA_FROM_DEVICE); > > + if (dma_mapping_error(as_ctrl->dev, dma_addr)) > > + return -ENOMEM; >=20 > Shouldn't this be >=20 > err =3D dma_mapping_error(as_ctrl->dev, dma_addr); > if (err) > return err; >=20 > ? >=20 > ... >=20 > > + dma_addr =3D dma_map_single(as_ctrl->dev, txrx_buf, SPI_NAND_CACHE_SI= ZE, > > + DMA_TO_DEVICE); > > + if (dma_mapping_error(as_ctrl->dev, dma_addr)) > > + return -ENOMEM; >=20 > Ditto. >=20 > --=20 > With Best Regards, > Andy Shevchenko >=20 >=20 ack, I will fix it in v3. Rergards, Lorenzo --pjTKbbGz/7+vpOLe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZu2JzwAKCRA6cBh0uS2t rMDqAP9vNRdg/h86aMIz+MIO0oeMbw/00o1VpEWcFMIdRv+4IgD/atNg1EU3qL5d jC/aN8OCB4xEhNztf9ICc7I6pw7Yjwg= =/xyN -----END PGP SIGNATURE----- --pjTKbbGz/7+vpOLe--