[dahdi-commits] sruffell: branch linux/2.2 r6934 - in /linux/branches/2.2: ./ drivers/dahdi/
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Tue Aug 4 11:24:26 CDT 2009
Author: sruffell
Date: Tue Aug 4 11:24:24 2009
New Revision: 6934
URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=6934
Log:
Merged revisions 6933 via svnmerge from
https://origsvn.digium.com/svn/dahdi/linux/trunk
........
r6933 | sruffell | 2009-08-04 11:22:39 -0500 (Tue, 04 Aug 2009) | 10 lines
dahdi_dummy: Do not allow jumps in system time to lock up the system.
Since dahdi_dummy uses the number of milliseconds that has actually passed to
determine how many times to call dahdi_receive, it is possible that if the
system time shifts after dahdi is started, that the system can appear to lock
up while dahdi_dummy attempts to catch up. This change prevents soft lock ups
under these conditions.
(closes issue #15647)
Reported by: missnebun
........
Modified:
linux/branches/2.2/ (props changed)
linux/branches/2.2/drivers/dahdi/dahdi_dummy.c
Propchange: linux/branches/2.2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug 4 11:24:24 2009
@@ -1,1 +1,1 @@
-/linux/trunk:1-6696,6712-6713,6715-6716,6718-6759,6761-6767,6769-6770,6772-6779,6781-6784,6786-6790,6792-6793,6795-6796,6798-6803,6844-6863
+/linux/trunk:1-6696,6712-6713,6715-6716,6718-6759,6761-6767,6769-6770,6772-6779,6781-6784,6786-6790,6792-6793,6795-6796,6798-6803,6844-6863,6933
Modified: linux/branches/2.2/drivers/dahdi/dahdi_dummy.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/branches/2.2/drivers/dahdi/dahdi_dummy.c?view=diff&rev=6934&r1=6933&r2=6934
==============================================================================
--- linux/branches/2.2/drivers/dahdi/dahdi_dummy.c (original)
+++ linux/branches/2.2/drivers/dahdi/dahdi_dummy.c Tue Aug 4 11:24:24 2009
@@ -161,12 +161,31 @@
unsigned long ms_since_start;
struct timespec now;
const unsigned long MAX_INTERVAL = 100000L;
+ const unsigned long MS_LIMIT = 3000;
if (!atomic_read(&shutdown))
mod_timer(&timer, jiffies + JIFFIES_INTERVAL);
now = current_kernel_time();
ms_since_start = timespec_diff_ms(&ztd->start_interval, &now);
+
+ /*
+ * If the system time has changed, it is possible for us to be far
+ * behind. If we are more than MS_LIMIT milliseconds behind, just
+ * reset our time base and continue so that we do not hang the system
+ * here.
+ *
+ */
+ if (unlikely((ms_since_start - ztd->calls_since_start) > MS_LIMIT)) {
+ if (printk_ratelimit()) {
+ printk(KERN_INFO
+ "dahdi_dummy: Detected time shift.\n");
+ }
+ ztd->calls_since_start = 0;
+ ztd->start_interval = now;
+ return;
+ }
+
while (ms_since_start > ztd->calls_since_start) {
ztd->calls_since_start++;
dahdi_receive(&ztd->span);
More information about the dahdi-commits
mailing list