linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: addy ke <addy.ke@rock-chips.com>
Cc: heiko@sntech.de, kever.yang@rock-chips.com,
	linux-kernel@vger.kernel.org, xjq@rock-chips.com,
	zyw@rock-chips.com, linux-rockchip@lists.infradead.org,
	grant.likely@linaro.org, hj@rock-chips.com,
	huangtao@rock-chips.com, devicetree@vger.kernel.org,
	amstan@google.com, yzq@rock-chips.com, zhangqing@rock-chips.com,
	cf@rock-chips.com, robh+dt@kernel.org,
	linux-arm-kernel@lists.infradead.org, hl@rock-chips.com,
	dianders@chromium.org, linux-spi@vger.kernel.org,
	wei.luo@rock-chips.com, sonnyrao@google.com, olof@lixom.net,
	zhenfu.fang@rock-chips.com
Subject: Re: [PATCH 1/2] spi/rockchip: fix bug that case spi can't go as fast as slave request
Date: Thu, 16 Oct 2014 11:34:10 +0200	[thread overview]
Message-ID: <20141016093410.GB2200@sirena.org.uk> (raw)
In-Reply-To: <543F8CD2.1010302@rock-chips.com>


[-- Attachment #1.1: Type: text/plain, Size: 1022 bytes --]

On Thu, Oct 16, 2014 at 05:16:02PM +0800, addy ke wrote:
> On 2014/10/15 21:04, Mark Brown wrote:
> > On Wed, Oct 15, 2014 at 07:25:49PM +0800, Addy Ke wrote:

> >> +	if (WARN_ON(rs->speed > MAX_SCLK_OUT))
> >> +		rs->speed = MAX_SCLK_OUT;

> >> +	/* the minimum divsor is 2 */
> >> +	if (rs->max_freq < 2 * rs->speed) {
> >> +		clk_set_rate(rs->spiclk, 2 * rs->speed);
> >> +		rs->max_freq = clk_get_rate(rs->spiclk);
> >> +	}

> > I'll apply this but you should be checking the return code from
> > clk_set_rate() here, please send a followup patch doing that.  It might

> If clk_set_rate return error, do I only put dev_warn here or return error value to spi core?

It'd be better to return an error if we need to set the rate and can't
do it.

> > also be worth consdering just setting the rate unconditionally here, it
> > seems like it should make things simpler.

> I think we need.
> If we set the rate unconditionally here, clk_set_rate() will be executed in each spi transfer.

Is that really such a high cost?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2014-10-16  9:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 11:25 [PATCH 0/2] spi: fix two bugs Addy Ke
2014-10-15 11:25 ` [PATCH 1/2] spi/rockchip: fix bug that case spi can't go as fast as slave request Addy Ke
2014-10-15 13:04   ` Mark Brown
     [not found]     ` <20141015130452.GD27755-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-10-16  9:16       ` addy ke
2014-10-16  9:34         ` Mark Brown [this message]
2014-10-16  9:58           ` addy ke
2014-10-16 10:26             ` Mark Brown
2014-10-15 11:26 ` [PATCH 2/2] spi/rockchip: fix bug that cause spi transfer timed out in DMA duplex mode Addy Ke
     [not found]   ` <1413372378-4309-1-git-send-email-addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-10-15 13:05     ` Mark Brown
     [not found]       ` <20141015130547.GE27755-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-10-16  9:26         ` addy ke
2014-10-16  9:34           ` 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=20141016093410.GB2200@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=addy.ke@rock-chips.com \
    --cc=amstan@google.com \
    --cc=cf@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=grant.likely@linaro.org \
    --cc=heiko@sntech.de \
    --cc=hj@rock-chips.com \
    --cc=hl@rock-chips.com \
    --cc=huangtao@rock-chips.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=robh+dt@kernel.org \
    --cc=sonnyrao@google.com \
    --cc=wei.luo@rock-chips.com \
    --cc=xjq@rock-chips.com \
    --cc=yzq@rock-chips.com \
    --cc=zhangqing@rock-chips.com \
    --cc=zhenfu.fang@rock-chips.com \
    --cc=zyw@rock-chips.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).