From: Boris Brezillon <boris.brezillon@collabora.com>
To: Manuel Dipolt <mdipolt@robart.cc>
Cc: Roland Ruckerbauer <rruckerbauer@robart.cc>,
linux-mtd <linux-mtd@lists.infradead.org>,
maxime <maxime@cerno.tech>,
miquel raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH v7] mtd: rawnand: sunxi: Add MDMA support
Date: Wed, 28 Oct 2020 15:35:45 +0100 [thread overview]
Message-ID: <20201028153545.559ba2be@collabora.com> (raw)
In-Reply-To: <154840787.280672.1602517282173.JavaMail.zimbra@robart.cc>
On Mon, 12 Oct 2020 17:41:22 +0200 (CEST)
Manuel Dipolt <mdipolt@robart.cc> wrote:
> @@ -363,24 +364,34 @@ static int sunxi_nfc_dma_op_prepare(struct sunxi_nfc *nfc, const void *buf,
> if (!ret)
> return -ENOMEM;
>
> - dmad = dmaengine_prep_slave_sg(nfc->dmac, sg, 1, tdir, DMA_CTRL_ACK);
> - if (!dmad) {
> - ret = -EINVAL;
> - goto err_unmap_buf;
> + if (!nfc->caps->has_mdma) {
> + dmad = dmaengine_prep_slave_sg(nfc->dmac, sg, 1, tdir, DMA_CTRL_ACK);
> + if (!dmad) {
> + ret = -EINVAL;
> + goto err_unmap_buf;
> + }
> }
>
> writel(readl(nfc->regs + NFC_REG_CTL) | NFC_RAM_METHOD,
> nfc->regs + NFC_REG_CTL);
> writel(nchunks, nfc->regs + NFC_REG_SECTOR_NUM);
> writel(chunksize, nfc->regs + NFC_REG_CNT);
> - if (nfc->caps->extra_mbus_conf)
> +
> + if (nfc->caps->has_mdma) {
> + writel(readl(nfc->regs + NFC_REG_CTL) & ~NFC_DMA_TYPE_NORMAL,
> + nfc->regs + NFC_REG_CTL);
> writel(chunksize * nchunks, nfc->regs + NFC_REG_MDMA_CNT);
> + writel(sg_dma_address(sg), nfc->regs + NFC_REG_MDMA_ADDR);
> + } else {
> + writel(readl(nfc->regs + NFC_REG_CTL) | NFC_DMA_TYPE_NORMAL,
> + nfc->regs + NFC_REG_CTL);
You might want to try dropping this writel (looks like it was only done
when extra_mbus_conf was set).
>
> - dmat = dmaengine_submit(dmad);
> + dmat = dmaengine_submit(dmad);
>
> - ret = dma_submit_error(dmat);
> - if (ret)
> - goto err_clr_dma_flag;
> + ret = dma_submit_error(dmat);
> + if (ret)
> + goto err_clr_dma_flag;
> + }
>
> return 0;
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2020-10-28 14:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 15:41 [PATCH v7] mtd: rawnand: sunxi: Add MDMA support Manuel Dipolt
2020-10-28 13:42 ` Miquel Raynal
2020-10-28 14:35 ` Boris Brezillon [this message]
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=20201028153545.559ba2be@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=linux-mtd@lists.infradead.org \
--cc=maxime@cerno.tech \
--cc=mdipolt@robart.cc \
--cc=miquel.raynal@bootlin.com \
--cc=rruckerbauer@robart.cc \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.