Skip to content

Commit a8d1200

Browse files
Alan Coxtorvalds
authored andcommitted
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>
1 parent 1ea6b8f commit a8d1200

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎drivers/tty/n_gsm.c‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,16 @@
6666
static int debug;
6767
module_param(debug, int, 0600);
6868

69-
#define T1 (HZ/10)
70-
#define T2 (HZ/3)
71-
#define N2 3
69+
/* Defaults: these are from the specification */
70+
71+
#define T1 10 /* 100mS */
72+
#define T2 34 /* 333mS */
73+
#define N2 3 /* Retry 3 times */
7274

7375
/* Use long timers for testing at low speed with debug on */
7476
#ifdef DEBUG_TIMING
75-
#define T1 HZ
76-
#define T2 (2 * HZ)
77+
#define T1 100
78+
#define T2 200
7779
#endif
7880

7981
/*

0 commit comments

Comments
 (0)