All of lore.kernel.org
 help / color / mirror / Atom feed
From: addy ke <addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org,
	dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	amstan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	sonnyrao-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org,
	hj-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	xjq-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	yzq-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	zhenfu.fang-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	wei.luo-TNX95d0MmH7DzftRWevZcw@public.gmane.org
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 17:16:02 +0800	[thread overview]
Message-ID: <543F8CD2.1010302@rock-chips.com> (raw)
In-Reply-To: <20141015130452.GD27755-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

hi, Mark

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?

> 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.




--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: addy.ke@rock-chips.com (addy ke)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] spi/rockchip: fix bug that case spi can't go as fast as slave request
Date: Thu, 16 Oct 2014 17:16:02 +0800	[thread overview]
Message-ID: <543F8CD2.1010302@rock-chips.com> (raw)
In-Reply-To: <20141015130452.GD27755@sirena.org.uk>

hi, Mark

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?

> 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.

WARNING: multiple messages have this Message-ID (diff)
From: addy ke <addy.ke@rock-chips.com>
To: broonie@kernel.org
Cc: heiko@sntech.de, dianders@chromium.org, grant.likely@linaro.org,
	robh+dt@kernel.org, amstan@google.com, sonnyrao@google.com,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
	olof@lixom.net, hj@rock-chips.com, kever.yang@rock-chips.com,
	xjq@rock-chips.com, huangtao@rock-chips.com, zyw@rock-chips.com,
	yzq@rock-chips.com, zhenfu.fang@rock-chips.com,
	cf@rock-chips.com, zhangqing@rock-chips.com, hl@rock-chips.com,
	wei.luo@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 17:16:02 +0800	[thread overview]
Message-ID: <543F8CD2.1010302@rock-chips.com> (raw)
In-Reply-To: <20141015130452.GD27755@sirena.org.uk>

hi, Mark

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?

> 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.





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

Thread overview: 28+ 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 ` Addy Ke
2014-10-15 11:25 ` 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 11:25   ` Addy Ke
2014-10-15 13:04   ` Mark Brown
2014-10-15 13:04     ` Mark Brown
     [not found]     ` <20141015130452.GD27755-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-10-16  9:16       ` addy ke [this message]
2014-10-16  9:16         ` addy ke
2014-10-16  9:16         ` addy ke
2014-10-16  9:34         ` Mark Brown
2014-10-16  9:34           ` Mark Brown
2014-10-16  9:34           ` Mark Brown
2014-10-16  9:58           ` addy ke
2014-10-16  9:58             ` addy ke
2014-10-16 10:26             ` Mark Brown
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
2014-10-15 11:26   ` Addy Ke
     [not found]   ` <1413372378-4309-1-git-send-email-addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-10-15 13:05     ` Mark Brown
2014-10-15 13:05       ` Mark Brown
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:26           ` addy ke
2014-10-16  9:26           ` addy ke
2014-10-16  9:34           ` Mark Brown
2014-10-16  9:34             ` Mark Brown
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=543F8CD2.1010302@rock-chips.com \
    --to=addy.ke-tnx95d0mmh7dzftrwevzcw@public.gmane.org \
    --cc=amstan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=hj-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sonnyrao-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=wei.luo-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=xjq-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=yzq-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=zhenfu.fang-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=zyw-TNX95d0MmH7DzftRWevZcw@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 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.