From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Andy Shevchenko <andy@kernel.org>
Cc: Ray Liu <ray.liu@airoha.com>, Mark Brown <broonie@kernel.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Christian Marangi <ansuelsmth@gmail.com>,
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
Date: Fri, 20 Sep 2024 16:42:24 +0200 [thread overview]
Message-ID: <Zu2J0CtZh0K0xrDJ@lore-desk> (raw)
In-Reply-To: <Zu2D6sS52DjVhWBq@smile.fi.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]
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.
>
> ...
>
> > + 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
>
>
ack, I will fix it in v3.
Rergards,
Lorenzo
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-09-20 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 16:57 [PATCH v2 0/2] spi: airoha: Fix errors reported by mtd_test kernel modules Lorenzo Bianconi
2024-09-19 16:57 ` [PATCH v2 1/2] spi: airoha: remove read cache in airoha_snand_dirmap_read() Lorenzo Bianconi
2024-09-19 16:57 ` [PATCH v2 2/2] spi: airoha: do not keep {tx,rx} dma buffer always mapped Lorenzo Bianconi
2024-09-20 14:17 ` Andy Shevchenko
2024-09-20 14:42 ` Lorenzo Bianconi [this message]
2024-09-20 9:40 ` (subset) [PATCH v2 0/2] spi: airoha: Fix errors reported by mtd_test kernel modules Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zu2J0CtZh0K0xrDJ@lore-desk \
--to=lorenzo@kernel.org \
--cc=andy@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=ansuelsmth@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=ray.liu@airoha.com \
--cc=upstream@airoha.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).