linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Lh Kuo 郭力豪" <lh.Kuo@sunplus.com>
Cc: "Li-hao Kuo" <lhjeff911@gmail.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Mark Brown" <broonie@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Wells Lu 呂芳騰" <wells.lu@sunplus.com>
Subject: Re: [PATCH v6 1/2] spi: Add spi driver for Sunplus SP7021
Date: Fri, 21 Jan 2022 12:09:15 +0200	[thread overview]
Message-ID: <CAHp75VcmFPCC0kDxOma6gunwFRf-eXEr6+ZxQs1dt5GH2quT4Q@mail.gmail.com> (raw)
In-Reply-To: <ee5838c307f84bb99ace070292167a26@sphcmbx02.sunplus.com.tw>

On Fri, Jan 21, 2022 at 8:54 AM Lh Kuo 郭力豪 <lh.Kuo@sunplus.com> wrote:
>
> > > > > +       if (xfer->tx_buf)
> > > > > +               dma_unmap_single(dev, xfer->tx_dma, xfer->len, DMA_TO_DEVICE);
> > > > > +       if (xfer->rx_buf)
> > > > > +               dma_unmap_single(dev, xfer->rx_dma, xfer->len,
> > > > > + DMA_FROM_DEVICE);
> > > >
> > > > Why can't you use SPI core DMA mapping code?
> > >
> > > I didn't find the SPI core DMA mapping code for single maping.
> > > The method currently used is the general DMA single-map code usage method.
> >
> > Why do you need single page mapping?
> > What's wrong with SG mapping that SPI core provides?
>
> SP7021 SPI slave dma only supports single dma in one trigger.
> It is not suitable for using SG mapping.
> If the length of the transfer is larger than the length of the SG-mapping,
> Slave-mode will get error in the transfer.

Same story for SPI DesignWare on Intel Medfield, where no SG transfers
are supported by hardware. Nevertheless, the DMA driver takes care of
this and on each interrupt recharges a channel to continue. Why can't
the same be implemented here?


-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2022-01-21 10:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18  8:42 [PATCH v6 0/2] Add spi control driver for Sunplus SP7021 SoC Li-hao Kuo
2022-01-18  8:42 ` [PATCH v6 1/2] spi: Add spi driver for Sunplus SP7021 Li-hao Kuo
2022-01-18 17:41   ` Mark Brown
2022-01-20  9:12     ` Lh Kuo 郭力豪
2022-01-19 22:08   ` Andy Shevchenko
2022-01-20  9:23     ` Lh Kuo 郭力豪
2022-01-20  9:51       ` Andy Shevchenko
2022-01-21  6:55         ` Lh Kuo 郭力豪
2022-01-21 10:09           ` Andy Shevchenko [this message]
2022-01-24  3:27             ` Lh Kuo 郭力豪
2022-01-18  8:42 ` [PATCH v6 2/2] dt-bindings:spi: Add Sunplus SP7021 schema Li-hao Kuo
2022-01-27 15:16   ` Rob Herring
2022-01-25 14:35 ` [PATCH v6 0/2] Add spi control driver for Sunplus SP7021 SoC 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=CAHp75VcmFPCC0kDxOma6gunwFRf-eXEr6+ZxQs1dt5GH2quT4Q@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lh.Kuo@sunplus.com \
    --cc=lhjeff911@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=wells.lu@sunplus.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).