[dahdi-commits] dahdi/linux.git branch "master" updated.

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Fri Jan 25 12:07:37 CST 2013


branch "master" has been updated
       via  8bf04348963b440b57e308fdec6cc57c64fcdd3f (commit)
       via  a6be60359012260610f616cda20118988529433c (commit)
       via  85e6cdde83c3edc2d2efd3dd29dfd9de1536a838 (commit)
      from  69fb09d011fd3ca746783891a19f10d900978ae1 (commit)

Summary of changes:
 drivers/dahdi/wcb4xxp/base.c    |    3 ++-
 drivers/dahdi/wctdm24xxp/base.c |   15 +++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 8bf04348963b440b57e308fdec6cc57c64fcdd3f
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Thu Jan 24 11:37:29 2013 -0600

    wctdm24xxp: Eliminate chance for channel to be stuck in RED alarm.
    
    There was a code patch where it was possible to get stuck in RED ALARM on a
    channel when debouncing the battery states. The state transitions would look
    like this:
    
    BATTERY_PRESENT -> BATTERY_DEBOUNCING_LOST -> BATTERY_DEBOUNCING_LOST_ALARM --
    (send alarm up to asterisk) --> BATTERY_LOST -> BATTERY_DEBOUNCING_PRESENT ->
    BATTERY_DEBOUNCING_PRESENT_ALARM -> BATTERY_DEBOUNCING_LOST -> BATTERY_PRESENT
    
    In the above sequence there was never any transition from
    BATTERY_DEBOUNCING_PRESENT_ALARM to BATTERY_PRESENT so the alarm to Asterisk was
    never cleared and the channel stayed stuck.
    
    Now when you loose battery when in the BATTERY_DEBOUNCING_PRESENT_ALARM go all
    the way back to the BATTERY_LOST state instead of the BATTERY_DEBOUNCING_LOST
    state so that all the events are properly sent up.
    
    This fixes a regression introduced in 2.6.0 with commit (r10169 "wctdm24xxp: Use
    interval for debouncing FXO battery." 874b76bd223313e22a773725be63c1b4b64cb274).
    
    Internal-Issue-ID: DAHDI-1019
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index c782119..df4b325 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -1962,13 +1962,13 @@ wctdm_check_battery_lost(struct wctdm *wc, struct wctdm_module *const mod)
 	*/
 	switch (fxo->battery_state) {
 	case BATTERY_DEBOUNCING_PRESENT:
+	case BATTERY_DEBOUNCING_PRESENT_ALARM: /* intentional drop through */
 		/* we were going to BATTERY_PRESENT, but
 		 * battery was lost again. */
 		fxo->battery_state = BATTERY_LOST;
 		break;
 	case BATTERY_UNKNOWN:
 		mod_hooksig(wc, mod, DAHDI_RXSIG_ONHOOK);
-	case BATTERY_DEBOUNCING_PRESENT_ALARM: /* intentional drop through */
 	case BATTERY_PRESENT:
 		fxo->battery_state = BATTERY_DEBOUNCING_LOST;
 		fxo->battdebounce_timer = wc->framecount + battdebounce;
@@ -2062,6 +2062,7 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
 	case BATTERY_PRESENT:
 		break;
 	case BATTERY_DEBOUNCING_LOST:
+	case BATTERY_DEBOUNCING_LOST_ALARM:
 		/* we were going to BATTERY_LOST, but battery appeared again,
 		 * so clear the debounce timer */
 		fxo->battery_state = BATTERY_PRESENT;
@@ -2069,7 +2070,6 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
 	case BATTERY_UNKNOWN:
 		mod_hooksig(wc, mod, DAHDI_RXSIG_OFFHOOK);
 	case BATTERY_LOST: /* intentional drop through */
-	case BATTERY_DEBOUNCING_LOST_ALARM:
 		fxo->battery_state = BATTERY_DEBOUNCING_PRESENT;
 		fxo->battdebounce_timer = wc->framecount + battdebounce;
 		break;

commit a6be60359012260610f616cda20118988529433c
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Wed Jan 23 17:16:07 2013 -0600

    wctdm24xxp: Use framecount and not jiffies when looking for battery present.
    
    The logic to check for battery lost and battery present were using different
    time bases. One was using jiffies and the other was using framecount. Since
    framecount is always in milliseconds, let's use that to stay consistent.
    
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 4c539b3..c782119 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -2023,7 +2023,7 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
 
 	switch (fxo->battery_state) {
 	case BATTERY_DEBOUNCING_PRESENT:
-		if (time_after(jiffies, fxo->battdebounce_timer)) {
+		if (time_after(wc->framecount, fxo->battdebounce_timer)) {
 			if (debug) {
 				dev_info(&wc->vb.pdev->dev,
 					 "BATTERY on %d/%d (%s)!\n",
@@ -2048,12 +2048,12 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
 			 * of its time period has already passed while
 			 * debouncing occurred */
 			fxo->battery_state = BATTERY_DEBOUNCING_PRESENT_ALARM;
-			fxo->battdebounce_timer = jiffies +
-				msecs_to_jiffies(battalarm - battdebounce);
+			fxo->battdebounce_timer = wc->framecount +
+						   battalarm - battdebounce;
 		}
 		break;
 	case BATTERY_DEBOUNCING_PRESENT_ALARM:
-		if (time_after(jiffies, fxo->battdebounce_timer)) {
+		if (time_after(wc->framecount, fxo->battdebounce_timer)) {
 			fxo->battery_state = BATTERY_PRESENT;
 			dahdi_alarm_channel(get_dahdi_chan(wc, mod),
 					    DAHDI_ALARM_NONE);
@@ -2071,8 +2071,7 @@ wctdm_check_battery_present(struct wctdm *wc, struct wctdm_module *const mod)
 	case BATTERY_LOST: /* intentional drop through */
 	case BATTERY_DEBOUNCING_LOST_ALARM:
 		fxo->battery_state = BATTERY_DEBOUNCING_PRESENT;
-		fxo->battdebounce_timer = jiffies +
-						msecs_to_jiffies(battdebounce);
+		fxo->battdebounce_timer = wc->framecount + battdebounce;
 		break;
 	}
 }

commit 85e6cdde83c3edc2d2efd3dd29dfd9de1536a838
Author: Shaun Ruffell <sruffell at digium.com>
Date:   Wed Jan 23 16:14:07 2013 -0600

    wcb4xxp: Allocate memory in hfc_decode_st_state() with GFP_ATOMIC.
    
    hfc_decode_st_state() will be called from interrupt context when the debug flag
    is set to 32. Therefore, must use GFP_ATOMIC when allocating memory.
    
    Only affects the wcb4xxp driver when called with particular debug flags set.
    
    Internal-Issue-ID: DAHLIN-314
    Reported-by: Gerald Schnabel
    Signed-off-by: Shaun Ruffell <sruffell at digium.com>

diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c
index 62e1f64..e70b7c9 100644
--- a/drivers/dahdi/wcb4xxp/base.c
+++ b/drivers/dahdi/wcb4xxp/base.c
@@ -1242,7 +1242,8 @@ static char *hfc_decode_st_state(struct b4xxp *b4, int port, unsigned char state
 			"?", "?", "?", "?", "?", "?", "?", "?" }
 	};
 
-	if (!(str = kmalloc(256, GFP_KERNEL))) {
+	str = kmalloc(256, GFP_ATOMIC);
+	if (!str) {
 		dev_warn(&b4->pdev->dev, "could not allocate mem for ST state decode string!\n");
 		return NULL;
 	}

-----------------------------------------------------------------------


-- 
dahdi/linux.git



More information about the dahdi-commits mailing list