mbox

[GIT,PULL] Renesas ARM Based SoC Init Delay Updates For v3.18

Message ID cover.1408927601.git.horms+renesas@verge.net.au
State New
Headers show

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-init-delay-for-v3.18

Message

Simon Horman Aug. 25, 2014, 1:10 a.m. UTC
Hi Olof, Hi Kevin, Hi Arnd,

Please consider these Renesas ARM based SoC init delay updates for v3.18.

This pull request is based on a merge of:

* Renesas ARM Based SoC Boards Updates for v3.18,
  tagged as renesas-boards-for-v3.18,
  which I have previously sent a pull-request for

* Renesas ARM Based SoC Updates for v3.18,
  tagged as renesas-soc-for-v3.18,
  which I have previously sent a pull-request for


The following changes since commit 93acbd2cd2482cb51bec70a1494fddf2c172c073:

  Merge branch 'boards-for-v3.18' into soc-init-delay-for-v3.18.base (2014-08-22 11:31:47 +0900)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-init-delay-for-v3.18

for you to fetch changes up to fc35ca258c079411b64ed94e517eb04e7d89bc44:

  ARM: shmobile: kzm9g: Use shmobile_init_delay() (2014-08-22 11:32:13 +0900)

----------------------------------------------------------------
Renesas ARM Based SoC Init Delay Updates For v3.18

* Use shmobile_init_delay across a wider range of SoCs

----------------------------------------------------------------
Magnus Damm (10):
      ARM: shmobile: sh7372: Update DTS to include CPU frequency
      ARM: shmobile: sh73a0: Update DTS to include CPU frequency
      ARM: shmobile: r8a7778: Update DTS to include CPU frequency
      ARM: shmobile: sh7372: Use shmobile_init_delay()
      ARM: shmobile: r8a73a4: Use shmobile_init_delay()
      ARM: shmobile: Remove shmobile_setup_delay()
      ARM: shmobile: sh73a0: Use shmobile_init_delay()
      ARM: shmobile: r8a7778: Use shmobile_init_delay()
      ARM: shmobile: bockw: Use shmobile_init_delay()
      ARM: shmobile: kzm9g: Use shmobile_init_delay()

 arch/arm/boot/dts/r8a7778.dtsi                 |  6 ++++++
 arch/arm/boot/dts/sh7372.dtsi                  |  1 +
 arch/arm/boot/dts/sh73a0.dtsi                  |  2 ++
 arch/arm/mach-shmobile/board-bockw-reference.c |  2 +-
 arch/arm/mach-shmobile/board-bockw.c           |  2 +-
 arch/arm/mach-shmobile/board-kzm9g-reference.c |  2 +-
 arch/arm/mach-shmobile/common.h                |  2 --
 arch/arm/mach-shmobile/r8a73a4.h               |  1 -
 arch/arm/mach-shmobile/setup-r8a73a4.c         |  9 +--------
 arch/arm/mach-shmobile/setup-r8a7778.c         |  2 +-
 arch/arm/mach-shmobile/setup-sh7372.c          |  2 +-
 arch/arm/mach-shmobile/setup-sh73a0.c          |  2 +-
 arch/arm/mach-shmobile/timer.c                 | 21 ++-------------------
 13 files changed, 18 insertions(+), 36 deletions(-)

Comments

Arnd Bergmann Sept. 5, 2014, 3:27 p.m. UTC | #1
On Monday 25 August 2014, Simon Horman wrote:
> Hi Olof, Hi Kevin, Hi Arnd,
> 
> Please consider these Renesas ARM based SoC init delay updates for v3.18.
> 

While looking at your branches, I noticed that you go to great lengths
to compute the correct lpj value and avoid the calibration.

However, I believe the "modern" way to do this is to call
register_current_timer_delay() in order to base the delay loop
on the hardware timer instead of looping in the CPU. This is
more accurate and more robust against CPU frequency scaling.

I'm applying the patches now, but it's something you may want
to look at in the future. On a related topic, your clocksource
drivers could be simplified for the DT-only case by using
CLOCKSOURCE_OF_DECLARE() instead of early_platform_init(), but
I don't know what the impact would be for the arch/sh and legacy
mach-shmobile cases.

	Arnd
Arnd Bergmann Sept. 5, 2014, 4:13 p.m. UTC | #2
On Monday 25 August 2014, Simon Horman wrote:
> Hi Olof, Hi Kevin, Hi Arnd,
> 
> Please consider these Renesas ARM based SoC init delay updates for v3.18.
> 
> This pull request is based on a merge of:
> 
> * Renesas ARM Based SoC Boards Updates for v3.18,
>   tagged as renesas-boards-for-v3.18,
>   which I have previously sent a pull-request for
> 
> * Renesas ARM Based SoC Updates for v3.18,
>   tagged as renesas-soc-for-v3.18,
>   which I have previously sent a pull-request for
> 

I merged it all into next/soc now, which means that next/boards has a duplicate copy.
If we don't get anything else for boards, we probably won't bother sending that.

	Arnd
Simon Horman Sept. 9, 2014, 2:02 a.m. UTC | #3
On Fri, Sep 05, 2014 at 05:27:18PM +0200, Arnd Bergmann wrote:
> On Monday 25 August 2014, Simon Horman wrote:
> > Hi Olof, Hi Kevin, Hi Arnd,
> > 
> > Please consider these Renesas ARM based SoC init delay updates for v3.18.
> > 
> 
> While looking at your branches, I noticed that you go to great lengths
> to compute the correct lpj value and avoid the calibration.
> 
> However, I believe the "modern" way to do this is to call
> register_current_timer_delay() in order to base the delay loop
> on the hardware timer instead of looping in the CPU. This is
> more accurate and more robust against CPU frequency scaling.

I may be wrong but my understanding is that Renesas SoCs may be
booted without a timer.

> I'm applying the patches now, but it's something you may want
> to look at in the future. On a related topic, your clocksource
> drivers could be simplified for the DT-only case by using
> CLOCKSOURCE_OF_DECLARE() instead of early_platform_init(), but
> I don't know what the impact would be for the arch/sh and legacy
> mach-shmobile cases.

Thanks, I will have that looked into.
Arnd Bergmann Sept. 9, 2014, 8:50 a.m. UTC | #4
On Tuesday 09 September 2014 11:02:18 Simon Horman wrote:
> On Fri, Sep 05, 2014 at 05:27:18PM +0200, Arnd Bergmann wrote:
> > On Monday 25 August 2014, Simon Horman wrote:
> > > Hi Olof, Hi Kevin, Hi Arnd,
> > > 
> > > Please consider these Renesas ARM based SoC init delay updates for v3.18.
> > > 
> > 
> > While looking at your branches, I noticed that you go to great lengths
> > to compute the correct lpj value and avoid the calibration.
> > 
> > However, I believe the "modern" way to do this is to call
> > register_current_timer_delay() in order to base the delay loop
> > on the hardware timer instead of looping in the CPU. This is
> > more accurate and more robust against CPU frequency scaling.
> 
> I may be wrong but my understanding is that Renesas SoCs may be
> booted without a timer.

Do you mean some of them only have a clockevent driver but no clocksource,
and use the jiffies clocksource instead?

I've looked at the three drivers/clocksource/{sh,em}_*.c files, and it seems
sh_mtu2.c indeed has no clocksource support, although the binding description
mentions that it has multiple counters that could be used for this
purpose. This timer is only used on R7S72100, so if you add
'register_current_timer_delay' calls to the other drivers, you can
decide to either keep computing the lpj value for R7S72100 but not the
others, or try to add a clocksource implementation to mtu2 as well.

Note that the read_current_timer() function for the delay implementation
doesn't have to be based on the same timer as the clocksource, but in
practice it often is.

	Arnd