Skip to contentSkip to conversation

Alarmtimers items for 3.2

GIT PULL john stultz 2 participants 3 messages Sep 14, 2011 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

Hey Thomas,
Just wanted to get the alarmtimer rework to better match the hrtimer
code as well as some alarmtimer cleanups queued into -tip for 3.2.

Let me know if you have any thoughts or issues with these patches.

thanks
-john

Commit 8bc0dafb5cf38a19484dfb16e2c6d29e85820046 is available in my git repository at:
git://git.linaro.org/people/jstultz/linux.git fortglx/3.2/tip/timers/alarmtimers

John Stultz (8):
alarmtimers: Change alarmtimer functions to return alarmtimer_restart values
alarmtimers: Push rearming peroidic timers down into alamrtimer handler
alarmtimers: Add alarm_forward functionality
alarmtimers: Remove interval cap limit hack
alarmtimers: Remove period from alarm structure
alarmtimers: Add more refined alarm state tracking
alarmtimers: Add try_to_cancel functionality
alarmtimers: Rework RTC device selection using class interface

 include/linux/alarmtimer.h   |   51 ++++++++-
 include/linux/posix-timers.h |    5 +-
 kernel/time/alarmtimer.c     |  235 +++++++++++++++++++++++++++--------------
 3 files changed, 204 insertions(+), 87 deletions(-)
#1 lore raw
Quoted 5 lines · john stultz

Hey Thomas,
Just wanted to get the alarmtimer rework to better match the hrtimer
code as well as some alarmtimer cleanups queued into -tip for 3.2.

Let me know if you have any thoughts or issues with these patches.

They are in tip/timers/core and next already :)

Thanks,

tglx

#2 lore raw
Quoted 9 lines · Thomas Gleixner
Quoted 5 lines · john stultz

Hey Thomas,
Just wanted to get the alarmtimer rework to better match the hrtimer
code as well as some alarmtimer cleanups queued into -tip for 3.2.

Let me know if you have any thoughts or issues with these patches.

They are in tip/timers/core and next already :)

FYI, I fixed up the error handling code with the following commit:

commit 4523f6ada86853750565c68e17126af2e3df9b8a

Author: Thomas Gleixner <[email protected]>
Date:   Wed Sep 14 10:54:29 2011 +0200

alarmtimers: Fix error handling

commit 8bc0daf (alarmtimers: Rework RTC device selection using class interface) did not implement required error checks. Add them.

kernel/time/alarmtimer.c +31 -10
index 154d556..c436e79 100644
@@ -100,19 +100,25 @@ static struct class_interface alarmtimer_rtc_interface = {
 	.add_dev = &alarmtimer_rtc_add_device,
 };
 
-static void alarmtimer_rtc_interface_setup(void)
+static int alarmtimer_rtc_interface_setup(void)
 {
 	alarmtimer_rtc_interface.class = rtc_class;
-	class_interface_register(&alarmtimer_rtc_interface);
+	return class_interface_register(&alarmtimer_rtc_interface);
+}
+static void alarmtimer_rtc_interface_remove(void)
+{
+	class_interface_unregister(&alarmtimer_rtc_interface);
 }
 #else
-#define alarmtimer_get_rtcdev() (0)
-#define rtcdev (0)
-#define alarmtimer_rtc_interface_setup()
+static inline struct rtc_device *alarmtimer_get_rtcdev(void)
+{
+	return NULL;
+}
+#define rtcdev (NULL)
+static inline int alarmtimer_rtc_interface_setup(void) { return 0; }
+static inline void alarmtimer_rtc_interface_remove(void) { }
 #endif
 
-
-
 /**
  * alarmtimer_enqueue - Adds an alarm timer to an alarm_base timerqueue
  * @base: pointer to the base where the timer is being run
@@ -764,6 +770,7 @@ static struct platform_driver alarmtimer_driver = {
  */
 static int __init alarmtimer_init(void)
 {
+	struct platform_device *pdev;
 	int error = 0;
 	int i;
 	struct k_clock alarm_clock = {
@@ -793,11 +800,25 @@ static int __init alarmtimer_init(void)
 		alarm_bases[i].timer.function = alarmtimer_fired;
 	}
 
-	alarmtimer_rtc_interface_setup();
+	error = alarmtimer_rtc_interface_setup();
+	if (error)
+		return error;
+
 	error = platform_driver_register(&alarmtimer_driver);
-	platform_device_register_simple("alarmtimer", -1, NULL, 0);
+	if (error)
+		goto out_if;
 
+	pdev = platform_device_register_simple("alarmtimer", -1, NULL, 0);
+	if (IS_ERR(pdev)) {
+		error = PTR_ERR(pdev);
+		goto out_drv;
+	}
+	return 0;
+
+out_drv:
+	platform_driver_unregister(&alarmtimer_driver);
+out_if:
+	alarmtimer_rtc_interface_remove();
 	return error;
 }
 device_initcall(alarmtimer_init);
-