summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2011-11-08 19:02:10 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-08 19:10:20 +0100
commita8d12007c795f3d69ee0b2d29f0abfefd55c6120 (patch)
treec092e9392ab8265d3e0094d7b55affafb21176c2
parentLinux 3.2-rc1 (diff)
downloadlinux-a8d12007c795f3d69ee0b2d29f0abfefd55c6120.tar.xz
linux-a8d12007c795f3d69ee0b2d29f0abfefd55c6120.zip
n_gsm: Fix timings
Alek Du reported that the code erroneously applies time to jiffies conversions twice to the t1 and t2 values. In normal use on a modem link this cases no visible problem but on a slower link it will break as with HZ=1000 as is typical we are running t1/t2 ten times too fast. Alek's original patch removed the conversion from the timer setting but we in fact have to be more careful as the contents of t1/t2 are visible via the device API and we thus need to correct the constants. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/tty/n_gsm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 4cb0d0a3e57b..fc7bbba585ce 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -66,14 +66,16 @@
static int debug;
module_param(debug, int, 0600);
-#define T1 (HZ/10)
-#define T2 (HZ/3)
-#define N2 3
+/* Defaults: these are from the specification */
+
+#define T1 10 /* 100mS */
+#define T2 34 /* 333mS */
+#define N2 3 /* Retry 3 times */
/* Use long timers for testing at low speed with debug on */
#ifdef DEBUG_TIMING
-#define T1 HZ
-#define T2 (2 * HZ)
+#define T1 100
+#define T2 200
#endif
/*