linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Pandy Gao <pandy.gao-3arQi8VN3Tc@public.gmane.org>
Cc: "robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Frank Li <frank.li-3arQi8VN3Tc@public.gmane.org>,
	Andy Duan <fugang.duan-3arQi8VN3Tc@public.gmane.org>
Subject: Re: [Patch V2 1/2] spi: imx: add lpspi bus driver
Date: Mon, 21 Nov 2016 17:24:15 +0000	[thread overview]
Message-ID: <20161121172415.vtx7gahbzfgxconf@sirena.org.uk> (raw)
In-Reply-To: <AM4PR0401MB1780CDE562EEA1CE202E9572F6B10-4rsfagO7TJzc3fSXliz02I3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

On Thu, Nov 17, 2016 at 09:55:41AM +0000, Pandy Gao wrote:

Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns.  Doing this makes your messages much
easier to read and reply to.

> From: Mark Brown <mailto:broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sent: Thursday, November 17, 2016 1:32 AM

> > Why are we not also unpreparing the clock when the driver is idle?

> I use clk_enable()  rather than  clk_prepare_enable() here to avoid
> potential sleeping in runtime cause by clk_prepare().  clk is prepare
> in fsl_lpspi_probe() and unprepared in fsl_lpspi_remove().

It's absolutely fine to sleep in runtime PM and in the SPI hardware
prepare and unprepare.

> > Why are we doing this linearization into a single buffer?

> For a spi  transfer transmitted by lpspi,  the clk for the last bit is
> incomplete.  The last rising edge never comes unless  we manually
> de-assert SS.  In case that a spi message contains multiple transfers,
> SS should be de-asserted for each transfer.

> However, for spi device such as m25p80, SS should keep asserted during
> a whole message.  So we need do this linearization here.

And the hardware can't do any kind of scatter/gather?  There's two
things here - one is the combining everything into one hardware
operation which isn't that uncommon a limitation (though obviously it's
disappointing) and the other is the fact that in order to do this
everything gets copied into and out of this one buffer which obviously
adds quite a bit of overhead.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  parent reply	other threads:[~2016-11-21 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 13:33 [Patch V2 1/2] spi: imx: add lpspi bus driver Gao Pan
     [not found] ` <1479216831-8709-1-git-send-email-pandy.gao-3arQi8VN3Tc@public.gmane.org>
2016-11-15 13:33   ` [Patch V2 2/2] spi: imx: add devicetree binding for lpspi Gao Pan
2016-11-16 17:32   ` [Patch V2 1/2] spi: imx: add lpspi bus driver Mark Brown
     [not found]     ` <20161116173228.cqtt5j5eczgg26gn-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-11-17  9:55       ` Pandy Gao
     [not found]         ` <AM4PR0401MB1780CDE562EEA1CE202E9572F6B10-4rsfagO7TJzc3fSXliz02I3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-11-21 17:24           ` Mark Brown [this message]
     [not found]             ` <20161121172415.vtx7gahbzfgxconf-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-11-22 13:39               ` Pandy Gao

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=20161121172415.vtx7gahbzfgxconf@sirena.org.uk \
    --to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=frank.li-3arQi8VN3Tc@public.gmane.org \
    --cc=fugang.duan-3arQi8VN3Tc@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pandy.gao-3arQi8VN3Tc@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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).