netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] mISDN: Bugfixes for the mISDN DSP core
@ 2012-04-24 12:51 Karsten Keil
  2012-04-24 12:51 ` [PATCH 1/4] mISDN: Fix NULL pointer bug in if-condition of mISDN_dsp Karsten Keil
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Karsten Keil @ 2012-04-24 12:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

This collection are bugfixes for the DSP functions of the mISDN
core.
Tested against net-next.

Hopeful the submission format is OK now with git send-email
(before I used sendmail).


Andreas Eversberg (2):
  mISDN: Fix NULL pointer bug in if-condition of mISDN_dsp
  mISDN: Fixed hardware bridging/conference check routine of
    mISDN_dsp.ko.

Karsten Keil (2):
  mISDN: Fix division by zero
  mISDN: DSP scheduling fix

 drivers/isdn/mISDN/dsp.h      |    4 +++-
 drivers/isdn/mISDN/dsp_cmx.c  |   19 ++++++++++++-------
 drivers/isdn/mISDN/dsp_dtmf.c |   19 ++++++++++++++-----
 3 files changed, 29 insertions(+), 13 deletions(-)

-- 
1.7.3.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] mISDN: Fix NULL pointer bug in if-condition of mISDN_dsp
  2012-04-24 12:51 [PATCH 0/4] mISDN: Bugfixes for the mISDN DSP core Karsten Keil
@ 2012-04-24 12:51 ` Karsten Keil
  2012-04-24 12:51 ` [PATCH 2/4] mISDN: Fixed hardware bridging/conference check routine of mISDN_dsp.ko Karsten Keil
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Karsten Keil @ 2012-04-24 12:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Andreas Eversberg

From: Andreas Eversberg <jolly@eversberg.eu>

Fix a bug (was introduced by a cut & paste error)
in cases when dsp->conf was NULL.

Signed-off-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
---
 drivers/isdn/mISDN/dsp_cmx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index 334feab..b7589c2 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -1328,7 +1328,7 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members)
 		}
 		if (dsp->conf && dsp->conf->software && dsp->conf->hardware)
 			tx_data_only = 1;
-		if (dsp->conf->software && dsp->echo.hardware)
+		if (dsp->echo.software && dsp->echo.hardware)
 			tx_data_only = 1;
 	}
 
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] mISDN: Fixed hardware bridging/conference check routine of mISDN_dsp.ko.
  2012-04-24 12:51 [PATCH 0/4] mISDN: Bugfixes for the mISDN DSP core Karsten Keil
  2012-04-24 12:51 ` [PATCH 1/4] mISDN: Fix NULL pointer bug in if-condition of mISDN_dsp Karsten Keil
@ 2012-04-24 12:51 ` Karsten Keil
  2012-04-24 12:51 ` [PATCH 3/4] mISDN: Fix division by zero Karsten Keil
  2012-04-24 12:51 ` [PATCH 4/4] mISDN: DSP scheduling fix Karsten Keil
  3 siblings, 0 replies; 6+ messages in thread
From: Karsten Keil @ 2012-04-24 12:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Andreas Eversberg

From: Andreas Eversberg <jolly@eversberg.eu>

In some cases the hardware bridging/conference (2-n parties) was selected,
but still pure software bridging/conference was used.

Signed-off-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
---
 drivers/isdn/mISDN/dsp_cmx.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index b7589c2..0c104b9 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -742,8 +742,8 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp)
 					       member->dsp->pcm_slot_tx,
 					       member->dsp->pcm_bank_tx,
 					       member->dsp->pcm_bank_rx);
-				conf->hardware = 0;
-				conf->software = 1;
+				conf->hardware = 1;
+				conf->software = tx_data;
 				return;
 			}
 			/* find a new slot */
@@ -834,8 +834,8 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp)
 					       nextm->dsp->name,
 					       member->dsp->pcm_slot_tx,
 					       member->dsp->pcm_slot_rx);
-				conf->hardware = 0;
-				conf->software = 1;
+				conf->hardware = 1;
+				conf->software = tx_data;
 				return;
 			}
 			/* find two new slot */
@@ -939,8 +939,11 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp)
 	/* for more than two members.. */
 
 	/* if all members already have the same conference */
-	if (all_conf)
+	if (all_conf) {
+		conf->hardware = 1;
+		conf->software = tx_data;
 		return;
+	}
 
 	/*
 	 * if there is an existing conference, but not all members have joined
@@ -1013,6 +1016,8 @@ dsp_cmx_hardware(struct dsp_conf *conf, struct dsp *dsp)
 			dsp_cmx_hw_message(member->dsp,
 					   MISDN_CTRL_HFC_CONF_JOIN, current_conf, 0, 0, 0);
 		}
+		conf->hardware = 1;
+		conf->software = tx_data;
 		return;
 	}
 
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] mISDN: Fix division by zero
  2012-04-24 12:51 [PATCH 0/4] mISDN: Bugfixes for the mISDN DSP core Karsten Keil
  2012-04-24 12:51 ` [PATCH 1/4] mISDN: Fix NULL pointer bug in if-condition of mISDN_dsp Karsten Keil
  2012-04-24 12:51 ` [PATCH 2/4] mISDN: Fixed hardware bridging/conference check routine of mISDN_dsp.ko Karsten Keil
@ 2012-04-24 12:51 ` Karsten Keil
  2012-04-24 12:51 ` [PATCH 4/4] mISDN: DSP scheduling fix Karsten Keil
  3 siblings, 0 replies; 6+ messages in thread
From: Karsten Keil @ 2012-04-24 12:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Karsten Keil

From: Karsten Keil <isdn@linux-pingi.de>

If DTMF debug is set and tresh goes under 100, the printk will cause
a division by zero.

Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
---
 drivers/isdn/mISDN/dsp_dtmf.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp_dtmf.c b/drivers/isdn/mISDN/dsp_dtmf.c
index 887860b..642f30b 100644
--- a/drivers/isdn/mISDN/dsp_dtmf.c
+++ b/drivers/isdn/mISDN/dsp_dtmf.c
@@ -222,16 +222,25 @@ coefficients:
 		goto storedigit;
 	}
 
-	if (dsp_debug & DEBUG_DSP_DTMFCOEFF)
+	if (dsp_debug & DEBUG_DSP_DTMFCOEFF) {
+		s32 tresh_100 = tresh/100;
+
+		if (tresh_100 == 0) {
+			tresh_100 = 1;
+			printk(KERN_DEBUG
+				"tresh(%d) too small set tresh/100 to 1\n",
+				tresh);
+		}
 		printk(KERN_DEBUG "a %3d %3d %3d %3d %3d %3d %3d %3d"
 		       " tr:%3d r %3d %3d %3d %3d %3d %3d %3d %3d\n",
 		       result[0] / 10000, result[1] / 10000, result[2] / 10000,
 		       result[3] / 10000, result[4] / 10000, result[5] / 10000,
 		       result[6] / 10000, result[7] / 10000, tresh / 10000,
-		       result[0] / (tresh / 100), result[1] / (tresh / 100),
-		       result[2] / (tresh / 100), result[3] / (tresh / 100),
-		       result[4] / (tresh / 100), result[5] / (tresh / 100),
-		       result[6] / (tresh / 100), result[7] / (tresh / 100));
+		       result[0] / (tresh_100), result[1] / (tresh_100),
+		       result[2] / (tresh_100), result[3] / (tresh_100),
+		       result[4] / (tresh_100), result[5] / (tresh_100),
+		       result[6] / (tresh_100), result[7] / (tresh_100));
+	}
 
 	/* calc digit (lowgroup/highgroup) */
 	lowgroup = -1;
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] mISDN: DSP scheduling fix
  2012-04-24 12:51 [PATCH 0/4] mISDN: Bugfixes for the mISDN DSP core Karsten Keil
                   ` (2 preceding siblings ...)
  2012-04-24 12:51 ` [PATCH 3/4] mISDN: Fix division by zero Karsten Keil
@ 2012-04-24 12:51 ` Karsten Keil
  2012-04-26  0:38   ` David Miller
  3 siblings, 1 reply; 6+ messages in thread
From: Karsten Keil @ 2012-04-24 12:51 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Karsten Keil

From: Karsten Keil <isdn@linux-pingi.de>

dsp_spl_jiffies need to be the same datatype as jiffies (which is ulong).
If not, on 64 bit systems it will fallback to schedule the DSP every jiffie
tic as soon jiffies become > 2^32.

Signed-off-by: Karsten Keil <kkeil@linux-pingi.de>
---
 drivers/isdn/mISDN/dsp.h     |    4 +++-
 drivers/isdn/mISDN/dsp_cmx.c |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/mISDN/dsp.h b/drivers/isdn/mISDN/dsp.h
index afe4173..e020957 100644
--- a/drivers/isdn/mISDN/dsp.h
+++ b/drivers/isdn/mISDN/dsp.h
@@ -76,7 +76,9 @@ extern u8 dsp_silence;
 #define MAX_SECONDS_JITTER_CHECK 5
 
 extern struct timer_list dsp_spl_tl;
-extern u32 dsp_spl_jiffies;
+
+/* the datatype need to match jiffies datatype */
+extern ulong dsp_spl_jiffies;
 
 /* the structure of conferences:
  *
diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index 0c104b9..3a3b3a5 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -1624,7 +1624,7 @@ send_packet:
 
 static u32	jittercount; /* counter for jitter check */
 struct timer_list dsp_spl_tl;
-u32	dsp_spl_jiffies; /* calculate the next time to fire */
+ulong	dsp_spl_jiffies; /* calculate the next time to fire */
 static u16	dsp_count; /* last sample count */
 static int	dsp_count_valid; /* if we have last sample count */
 
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 4/4] mISDN: DSP scheduling fix
  2012-04-24 12:51 ` [PATCH 4/4] mISDN: DSP scheduling fix Karsten Keil
@ 2012-04-26  0:38   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-04-26  0:38 UTC (permalink / raw)
  To: kkeil; +Cc: netdev, isdn

From: Karsten Keil <kkeil@linux-pingi.de>
Date: Tue, 24 Apr 2012 14:51:52 +0200

> -u32	dsp_spl_jiffies; /* calculate the next time to fire */
> +ulong	dsp_spl_jiffies; /* calculate the next time to fire */

Please explicitly use "unsigned long", not "ulong".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-26  0:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24 12:51 [PATCH 0/4] mISDN: Bugfixes for the mISDN DSP core Karsten Keil
2012-04-24 12:51 ` [PATCH 1/4] mISDN: Fix NULL pointer bug in if-condition of mISDN_dsp Karsten Keil
2012-04-24 12:51 ` [PATCH 2/4] mISDN: Fixed hardware bridging/conference check routine of mISDN_dsp.ko Karsten Keil
2012-04-24 12:51 ` [PATCH 3/4] mISDN: Fix division by zero Karsten Keil
2012-04-24 12:51 ` [PATCH 4/4] mISDN: DSP scheduling fix Karsten Keil
2012-04-26  0:38   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).