timer: vt8500: Move timer code to drivers/clocksource
Subsystems (4)
Hi Olof,
Not sure if I have done this correctly but this is the patch to move the vt8500/timer.c code into drivers/clocksource.
I based it on timer/cleanup from armsoc (hopefully this is right - if not, a few pointers in the right direction would be appreciated).
Regards
Tony P
The following changes since commit 1c2584c3a1c882fec729147a46d822522552e38c:
ARM: sunxi: fix struct sys_timer removal (2013-01-08 10:50:43 -0800)
are available in the git repository at:
git://server.prisktech.co.nz/git/linuxwmt.git tags/vt8500/timer
for you to fetch changes up to ff7ec345f0ece9ddbb28538b70ba0c7f0acc17dc:
timer: vt8500: Move timer code to drivers/clocksource (2013-01-14 17:58:21 +1300)
----------------------------------------------------------------
Move arch-vt8500/timer.c to drivers/clocksource/vt8500-timer.c
----------------------------------------------------------------
Tony Prisk (1):
timer: vt8500: Move timer code to drivers/clocksource
arch/arm/mach-vt8500/Kconfig | 1 + arch/arm/mach-vt8500/Makefile | 2 +- arch/arm/mach-vt8500/common.h | 1 - arch/arm/mach-vt8500/vt8500.c | 1 + drivers/clocksource/Kconfig | 3 +++ drivers/clocksource/Makefile | 1 + .../timer.c => drivers/clocksource/vt8500_timer.c | 0 include/linux/vt8500_timer.h | 22 ++++++++++++++++++++ 8 files changed, 29 insertions(+), 2 deletions(-) rename arch/arm/mach-vt8500/timer.c => drivers/clocksource/vt8500_timer.c (100%) create mode 100644 include/linux/vt8500_timer.h
PATCH 1/1 timer: vt8500: Move timer code to drivers/clocksource
This patch moves arch-vt8500/timer.c into drivers/clocksource and updates the necessary Kconfig/Makefile options.
--- arch/arm/mach-vt8500/Kconfig | 1 + arch/arm/mach-vt8500/Makefile | 2 +- arch/arm/mach-vt8500/common.h | 1 - arch/arm/mach-vt8500/timer.c | 184 ------------------------------------ arch/arm/mach-vt8500/vt8500.c | 1 + drivers/clocksource/Kconfig | 3 + drivers/clocksource/Makefile | 1 + drivers/clocksource/vt8500_timer.c | 184 ++++++++++++++++++++++++++++++++++++ include/linux/vt8500_timer.h | 22 +++++ 9 files changed, 213 insertions(+), 186 deletions(-) delete mode 100644 arch/arm/mach-vt8500/timer.c create mode 100644 drivers/clocksource/vt8500_timer.c create mode 100644 include/linux/vt8500_timer.h
arch/arm/mach-vt8500/Kconfig +1 -0
@@ -8,5 +8,6 @@ config ARCH_VT8500 select GENERIC_CLOCKEVENTS select GENERIC_GPIO select HAVE_CLK + select VT8500_TIMER help Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
arch/arm/mach-vt8500/Makefile +1 -1
@@ -1 +1 @@ -obj-$(CONFIG_ARCH_VT8500) += irq.o timer.o vt8500.o +obj-$(CONFIG_ARCH_VT8500) += irq.o vt8500.o
arch/arm/mach-vt8500/common.h +0 -1
@@ -18,7 +18,6 @@#include <linux/of.h> -void __init vt8500_timer_init (void );int __init vt8500_irq_init (struct device_node *node,struct device_node *parent);
arch/arm/mach-vt8500/timer.c deleted +0 -184
184 lines not on this page · raw message
arch/arm/mach-vt8500/vt8500.c +1 -0
@@ -20,6 +20,7 @@#include <linux/io.h> #include <linux/pm.h> +#include <linux/vt8500_timer.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
drivers/clocksource/Kconfig +3 -0
@@ -28,6 +28,9 @@ config ARMADA_370_XP_TIMER config SUNXI_TIMER bool +config VT8500_TIMER + bool + config CLKSRC_NOMADIK_MTU bool depends on (ARCH_NOMADIK || ARCH_U8500)
drivers/clocksource/Makefile +1 -0
@@ -17,5 +17,6 @@ obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o obj-$(CONFIG_SUNXI_TIMER) += sunxi_timer.o +obj-$(CONFIG_VT8500_TIMER) += vt8500_timer.o obj-$(CONFIG_CLKSRC_ARM_GENERIC) += arm_generic.o
drivers/clocksource/vt8500_timer.c new file +184 -0
184 lines not on this page · raw message
include/linux/vt8500_timer.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* Copyright 2012 Tony Prisk <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef __VT8500_TIMER_H +#define __VT8500_TIMER_H + +#include <asm/mach/time.h> + +void vt8500_timer_init (void ); + +#endif
Signature · 1 line
1.7.9.5
Quoted 4 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.Signed-off-by Tony Prisk <[email protected]>
Quoted 14 lines
--- arch/arm/mach-vt8500/Kconfig | 1 + arch/arm/mach-vt8500/Makefile | 2 +- arch/arm/mach-vt8500/common.h | 1 - arch/arm/mach-vt8500/timer.c | 184 ------------------------------------ arch/arm/mach-vt8500/vt8500.c | 1 + drivers/clocksource/Kconfig | 3 + drivers/clocksource/Makefile | 1 + drivers/clocksource/vt8500_timer.c | 184 ++++++++++++++++++++++++++++++++++++ include/linux/vt8500_timer.h | 22 +++++ 9 files changed, 213 insertions(+), 186 deletions(-) delete mode 100644 arch/arm/mach-vt8500/timer.c create mode 100644 drivers/clocksource/vt8500_timer.c create mode 100644 include/linux/vt8500_timer.h
Darn.. forgot the -m again. I'll await your feedback regarding the basing of the patch first (and any other feedback), then I'll redo it with the correct stats.
Regards
Tony P
Quoted 20 lines · Tony Prisk
Quoted 4 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.Signed-off-by Tony Prisk <[email protected]>Quoted 14 lines
--- arch/arm/mach-vt8500/Kconfig | 1 + arch/arm/mach-vt8500/Makefile | 2 +- arch/arm/mach-vt8500/common.h | 1 - arch/arm/mach-vt8500/timer.c | 184 ------------------------------------ arch/arm/mach-vt8500/vt8500.c | 1 + drivers/clocksource/Kconfig | 3 + drivers/clocksource/Makefile | 1 + drivers/clocksource/vt8500_timer.c | 184 ++++++++++++++++++++++++++++++++++++ include/linux/vt8500_timer.h | 22 +++++ 9 files changed, 213 insertions(+), 186 deletions(-) delete mode 100644 arch/arm/mach-vt8500/timer.c create mode 100644 drivers/clocksource/vt8500_timer.c create mode 100644 include/linux/vt8500_timer.h
Quoted 6 lines
Darn.. forgot the -m again. I'll await your feedback regarding the basing of the patch first (and any other feedback), then I'll redo it with the correct stats.
Regards
Tony P
Oh grr.. forget this completely. It doesn't take into account the patches I already sent for WM8850.
I guess it needs to be based on timer/cleanup + vt8500/wm8x50.
Need a little advise on how to handle this one please :)
Regards
Tony P
Quoted 9 lines
Oh grr.. forget this completely. It doesn't take into account the patches I already sent for WM8850.
I guess it needs to be based on timer/cleanup + vt8500/wm8x50.
Need a little advise on how to handle this one please :)
Regards
Tony P
Turns out the original patch applies cleanly on timer/cleanup + vt8500/wm8x50 anyway so maybe it doesn't need to be rebased.
Let me know if I need to do anything (other than the -m to cleanup the stats).
Regards
Tony P
Quoted 28 lines · Tony Prisk
Quoted 20 lines · Tony Prisk
Quoted 4 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.Signed-off-by Tony Prisk <[email protected]>Quoted 14 lines
--- arch/arm/mach-vt8500/Kconfig | 1 + arch/arm/mach-vt8500/Makefile | 2 +- arch/arm/mach-vt8500/common.h | 1 - arch/arm/mach-vt8500/timer.c | 184 ------------------------------------ arch/arm/mach-vt8500/vt8500.c | 1 + drivers/clocksource/Kconfig | 3 + drivers/clocksource/Makefile | 1 + drivers/clocksource/vt8500_timer.c | 184 ++++++++++++++++++++++++++++++++++++ include/linux/vt8500_timer.h | 22 +++++ 9 files changed, 213 insertions(+), 186 deletions(-) delete mode 100644 arch/arm/mach-vt8500/timer.c create mode 100644 drivers/clocksource/vt8500_timer.c create mode 100644 include/linux/vt8500_timer.hQuoted 6 lines
Darn.. forgot the -m again. I'll await your feedback regarding the basing of the patch first (and any other feedback), then I'll redo it with the correct stats.
Regards
Tony P
Quoted 6 lines
Oh grr.. forget this completely. It doesn't take into account the patches I already sent for WM8850.
I guess it needs to be based on timer/cleanup + vt8500/wm8x50.
Need a little advise on how to handle this one please :)
The normal way to handle these kind of dependencies is to base them on merges of the needed branches. Based on the later email, you only seem to need timer/cleanup, but if you would have needed the other one, then you'd merge that on top of timer/cleanup, and then add your patches.
Of course, ideally you would do the cleanup, then add the wm8x50 features, but in reality work doesn't always pan out that way, so you end up with cleanups that depend on including new features in the same (sweeping) cleanup since they have already been merged. That's when things sometimes get hairy, and we need to start a second cleanup branch that's "after" the feature branch in the sequence of topics. But it should be rare, and in your case it seems like it wasn't needed.
-Olof
Quoted 50 lines · Olof Johansson
Quoted 28 lines · Tony Prisk
Quoted 20 lines · Tony Prisk
Quoted 4 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.Signed-off-by Tony Prisk <[email protected]>Quoted 14 lines
--- arch/arm/mach-vt8500/Kconfig | 1 + arch/arm/mach-vt8500/Makefile | 2 +- arch/arm/mach-vt8500/common.h | 1 - arch/arm/mach-vt8500/timer.c | 184 ------------------------------------ arch/arm/mach-vt8500/vt8500.c | 1 + drivers/clocksource/Kconfig | 3 + drivers/clocksource/Makefile | 1 + drivers/clocksource/vt8500_timer.c | 184 ++++++++++++++++++++++++++++++++++++ include/linux/vt8500_timer.h | 22 +++++ 9 files changed, 213 insertions(+), 186 deletions(-) delete mode 100644 arch/arm/mach-vt8500/timer.c create mode 100644 drivers/clocksource/vt8500_timer.c create mode 100644 include/linux/vt8500_timer.hQuoted 6 lines
Darn.. forgot the -m again. I'll await your feedback regarding the basing of the patch first (and any other feedback), then I'll redo it with the correct stats.
Regards
Tony PQuoted 6 lines
Oh grr.. forget this completely. It doesn't take into account the patches I already sent for WM8850.
I guess it needs to be based on timer/cleanup + vt8500/wm8x50.
Need a little advise on how to handle this one please :)
The normal way to handle these kind of dependencies is to base them on merges of the needed branches. Based on the later email, you only seem to need timer/cleanup, but if you would have needed the other one, then you'd merge that on top of timer/cleanup, and then add your patches.
Of course, ideally you would do the cleanup, then add the wm8x50 features, but in reality work doesn't always pan out that way, so you end up with cleanups that depend on including new features in the same (sweeping) cleanup since they have already been merged. That's when things sometimes get hairy, and we need to start a second cleanup branch that's "after" the feature branch in the sequence of topics. But it should be rare, and in your case it seems like it wasn't needed.
Quoted 2 lines
-Olof
Just to clarify what I did (and to make sure it was as you understood it):
#1) I wrote the patch on top of timer/cleanup. This is the branch the patch was written for.
#2) I then pulled timer/cleanup and merged vt8500/wm8x50 on top, then reapplied the patch from #1 - it applied cleanly.
What I have just realised is that you might?? get a conflict when you merge vt8500/wm8x50 on top of wherever this patch ends up due to the few lines at the top of arch-vt8500/Kconfig having changed (the addition of SELECT VT8500_TIMER). This should be trivial to fix (I assume).
Regards
Tony P
Quoted 60 lines · Tony Prisk
Quoted 50 lines · Olof Johansson
Quoted 28 lines · Tony Prisk
Quoted 20 lines · Tony Prisk
Quoted 4 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.Signed-off-by Tony Prisk <[email protected]>Quoted 14 lines
--- arch/arm/mach-vt8500/Kconfig | 1 + arch/arm/mach-vt8500/Makefile | 2 +- arch/arm/mach-vt8500/common.h | 1 - arch/arm/mach-vt8500/timer.c | 184 ------------------------------------ arch/arm/mach-vt8500/vt8500.c | 1 + drivers/clocksource/Kconfig | 3 + drivers/clocksource/Makefile | 1 + drivers/clocksource/vt8500_timer.c | 184 ++++++++++++++++++++++++++++++++++++ include/linux/vt8500_timer.h | 22 +++++ 9 files changed, 213 insertions(+), 186 deletions(-) delete mode 100644 arch/arm/mach-vt8500/timer.c create mode 100644 drivers/clocksource/vt8500_timer.c create mode 100644 include/linux/vt8500_timer.hQuoted 6 lines
Darn.. forgot the -m again. I'll await your feedback regarding the basing of the patch first (and any other feedback), then I'll redo it with the correct stats.
Regards
Tony PQuoted 6 lines
Oh grr.. forget this completely. It doesn't take into account the patches I already sent for WM8850.
I guess it needs to be based on timer/cleanup + vt8500/wm8x50.
Need a little advise on how to handle this one please :)
The normal way to handle these kind of dependencies is to base them on merges of the needed branches. Based on the later email, you only seem to need timer/cleanup, but if you would have needed the other one, then you'd merge that on top of timer/cleanup, and then add your patches.
Of course, ideally you would do the cleanup, then add the wm8x50 features, but in reality work doesn't always pan out that way, so you end up with cleanups that depend on including new features in the same (sweeping) cleanup since they have already been merged. That's when things sometimes get hairy, and we need to start a second cleanup branch that's "after" the feature branch in the sequence of topics. But it should be rare, and in your case it seems like it wasn't needed.
Quoted 2 lines
-Olof
Just to clarify what I did (and to make sure it was as you understood it):
#1) I wrote the patch on top of timer/cleanup. This is the branch the patch was written for.
Quoted 7 lines
#2) I then pulled timer/cleanup and merged vt8500/wm8x50 on top, then reapplied the patch from #1 - it applied cleanly.
What I have just realised is that you might?? get a conflict when you merge vt8500/wm8x50 on top of wherever this patch ends up due to the few lines at the top of arch-vt8500/Kconfig having changed (the addition of SELECT
VT8500_TIMER). This should be trivial to fix (I assume).
Yeah, a couple of trivial conflicts are fine, but when they start to stack up we normally have to push back since some of these are exposed all the way up to Linus. We can also be a little more strategic in how we chose to pick bases for the topic branches to avoid some of this, which is what I intend to do this release cycle if it pans out.
In this case, there are no manual conflict resolution to be done, everything panned out just fine as it was.
-Olof
include/linux/vt8500_timer.h line 22
Quoted 13 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.include/linux/vt8500_timer.h +8
-0+#ifndef __VT8500_TIMER_H +#define __VT8500_TIMER_H + +#include <asm/mach/time.h> + +void vt8500_timer_init (void ); + +#endif
Is VT8500 DT-only? If so, it'd be nice not to add this header, but instead use CLOCKSOURCE_OF_DECLARE() inside the driver C file.
Quoted 6 lines · Stephen Warren
Quoted 4 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.include/linux/vt8500_timer.h +0
-0
Quoted 11 lines
include/linux/vt8500_timer.h line 22
Quoted 8 lines
include/linux/vt8500_timer.h +8
-0+#ifndef __VT8500_TIMER_H +#define __VT8500_TIMER_H + +#include <asm/mach/time.h> + +void vt8500_timer_init (void ); + +#endif Is VT8500 DT-only? If so, it'd be nice not to add this header, but instead use
CLOCKSOURCE_OF_DECLARE()inside the driver C file.
Agreed - I didn't like the header when I added it but I didn't know of another way and based in on the sunxi code.
Unfortunately Olof already pulled it into arm-soc, so I will try get another patch done to undo it :)
Regards
Tony P
Quoted 19 lines · Tony Prisk
Quoted 6 lines · Stephen Warren
Quoted 4 lines · Tony Prisk
This patch moves
arch-vt8500/timer.cintodrivers/clocksourceand updates the necessary Kconfig/Makefile options.include/linux/vt8500_timer.h +0
-0Quoted 11 lines
include/linux/vt8500_timer.h line 22
Quoted 8 lines
include/linux/vt8500_timer.h +8
-0+#ifndef __VT8500_TIMER_H +#define __VT8500_TIMER_H + +#include <asm/mach/time.h> + +void vt8500_timer_init (void ); + +#endif Is VT8500 DT-only? If so, it'd be nice not to add this header, but instead use
CLOCKSOURCE_OF_DECLARE()inside the driver C file.
Quoted 5 lines
Agreed - I didn't like the header when I added it but I didn't know of another way and based in on the sunxi code.
Unfortunately Olof already pulled it into arm-soc, so I will try get another patch done to undo it :)
Ack, I saw the comments but somehow blanked when it came to pulling it. Incremental patches on top are fine though.
Sorry Stephen, I didn't mean to ignore your comments. :)
-Olof
Quoted 12 lines · Tony Prisk
Hi Olof,
Not sure if I have done this correctly but this is the patch to move the
vt8500/timer.ccode intodrivers/clocksource.I based it on timer/cleanup from armsoc (hopefully this is right - if not, a few pointers in the right direction would be appreciated).
Regards
Tony P
Quoted 7 lines
The following changes since commit
1c2584c3a1c882fec729147a46d822522552e38c:ARM: sunxi: fix struct
sys_timerremoval (2013-01-08 10:50:43 -0800)are available in the git repository at:
git://server.prisktech.co.nz/git/linuxwmt.gittags/vt8500/timer
Thanks, pulled and merged into next/cleanup.
-Olof