All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lh Kuo 郭力豪" <lh.Kuo@sunplus.com>
To: Andy Shevchenko <andy.shevchenko@gmail.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: Mon, 24 Jan 2022 03:27:45 +0000	[thread overview]
Message-ID: <638055e6c4dd4f66bab98c12bd5bd74a@sphcmbx02.sunplus.com.tw> (raw)
In-Reply-To: <CAHp75VcmFPCC0kDxOma6gunwFRf-eXEr6+ZxQs1dt5GH2quT4Q@mail.gmail.com>

> > > > > > +       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?
> 
> 
I think it should work in master. spi master must actively send clk and date to slave device.
And yes, in the "master" mode it can handle SG-DMA on each interrupt.
But if working in "slave" mode, the master will not know the state of the slave. Slaves work on interrupt and recharge channels.
When master send clk and date in the same time. It may lose data and errors occur



  reply	other threads:[~2022-01-24  3:27 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
2022-01-24  3:27             ` Lh Kuo 郭力豪 [this message]
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=638055e6c4dd4f66bab98c12bd5bd74a@sphcmbx02.sunplus.com.tw \
    --to=lh.kuo@sunplus.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --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 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.