From: Vojtech Pavlik <vojtech@suse.cz>
To: Riley Williams <Riley@Williams.Name>
Cc: Vojtech Pavlik <vojtech@suse.cz>,
torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [patch] input: Fix CLOCK_TICK_RATE usage ... [8/13]
Date: Sat, 14 Jun 2003 23:14:55 +0200 [thread overview]
Message-ID: <20030614231455.A26303@ucw.cz> (raw)
In-Reply-To: <BKEGKPICNAKILKJKMHCACEFDEFAA.Riley@Williams.Name>; from Riley@Williams.Name on Sat, Jun 14, 2003 at 10:05:24PM +0100
On Sat, Jun 14, 2003 at 10:05:24PM +0100, Riley Williams wrote:
> Hi.
>
> > ChangeSet@1.1215.104.25, 2003-06-09 14:41:31+02:00, vojtech@suse.cz
> > input: Change input/misc/pcspkr.c to use CLOCK_TICK_RATE instead of
> > a fixed value of 1193182. And change CLOCK_TICK_RATE and several
> > usages of a fixed value 1193180 to a slightly more correct value
> > of 1193182. (True freq is 1.193181818181...).
>
> Is there any reason why you used CLOCK_TICK_RATE in some places and
> 1193182 in others ??? I can understand your using the number in the
> definition of CLOCK_TICK_RATE but not in the other cases.
I only changed the numbers from 1193180 to 1193182 in the patch.
The presence of the number instead of CLOCK_TICK_RATE in many drivers
is most likely a bug by itself, but that'll need to be addressed in a
different patch.
The only one place where I fixed it for now is the pcspkr.c driver,
since that is the one that actually started the whole thing.
> If I'm reading it correctly, the result is a collection of bugs on the
> AMD ELAN system as that uses a different frequency (at least, according
> to the last but one hunk in your patch)...
Care to send me a patch to fix this all completely and for once?
Anyone disagrees with changing all the instances of 1193180/1193182 to
CLOCK_TICK_RATE?
> Best wishes from Riley.
> ---
> * Nothing as pretty as a smile, nothing as ugly as a frown.
>
>
>
> > drivers/char/vt_ioctl.c | 4 ++--
> > drivers/input/gameport/gameport.c | 2 +-
> > drivers/input/joystick/analog.c | 2 +-
> > drivers/input/misc/pcspkr.c | 2 +-
> > include/asm-i386/timex.h | 2 +-
> > include/asm-x86_64/timex.h | 2 +-
> > 6 files changed, 7 insertions(+), 7 deletions(-)
> >
> > ===================================================================
> >
> > diff -Nru a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
> > --- a/drivers/char/vt_ioctl.c Sat Jun 14 22:23:32 2003
> > +++ b/drivers/char/vt_ioctl.c Sat Jun 14 22:23:32 2003
> > @@ -395,7 +395,7 @@
> > if (!perm)
> > return -EPERM;
> > if (arg)
> > - arg = 1193180 / arg;
> > + arg = 1193182 / arg;
> > kd_mksound(arg, 0);
> > return 0;
> >
> > @@ -412,7 +412,7 @@
> > ticks = HZ * ((arg >> 16) & 0xffff) / 1000;
> > count = ticks ? (arg & 0xffff) : 0;
> > if (count)
> > - count = 1193180 / count;
> > + count = 1193182 / count;
> > kd_mksound(count, ticks);
> > return 0;
> > }
> > diff -Nru a/drivers/input/gameport/gameport.c
> > b/drivers/input/gameport/gameport.c
> > --- a/drivers/input/gameport/gameport.c Sat Jun 14 22:23:32 2003
> > +++ b/drivers/input/gameport/gameport.c Sat Jun 14 22:23:32 2003
> > @@ -37,7 +37,7 @@
> >
> > #ifdef __i386__
> >
> > -#define DELTA(x,y) ((y)-(x)+((y)<(x)?1193180/HZ:0))
> > +#define DELTA(x,y) ((y)-(x)+((y)<(x)?1193182/HZ:0))
> > #define GET_TIME(x) do { x = get_time_pit(); } while (0)
> >
> > static unsigned int get_time_pit(void)
> > diff -Nru a/drivers/input/joystick/analog.c
> > b/drivers/input/joystick/analog.c
> > --- a/drivers/input/joystick/analog.c Sat Jun 14 22:23:32 2003
> > +++ b/drivers/input/joystick/analog.c Sat Jun 14 22:23:32 2003
> > @@ -138,7 +138,7 @@
> >
> > #ifdef __i386__
> > #define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else x =
> get_time_pit(); } while (0)
> > -#define DELTA(x,y)
> (cpu_has_tsc?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0)))
> > +#define DELTA(x,y)
> (cpu_has_tsc?((y)-(x)):((x)-(y)+((x)<(y)?1193182L/HZ:0)))
> > #define TIME_NAME (cpu_has_tsc?"TSC":"PIT")
> > static unsigned int get_time_pit(void)
> > {
> > diff -Nru a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
> > --- a/drivers/input/misc/pcspkr.c Sat Jun 14 22:23:32 2003
> > +++ b/drivers/input/misc/pcspkr.c Sat Jun 14 22:23:32 2003
> > @@ -43,7 +43,7 @@
> > }
> >
> > if (value > 20 && value < 32767)
> > - count = 1193182 / value;
> > + count = CLOCK_TICK_RATE / value;
> >
> > spin_lock_irqsave(&i8253_beep_lock, flags);
> >
> > diff -Nru a/include/asm-i386/timex.h b/include/asm-i386/timex.h
> > --- a/include/asm-i386/timex.h Sat Jun 14 22:23:32 2003
> > +++ b/include/asm-i386/timex.h Sat Jun 14 22:23:32 2003
> > @@ -15,7 +15,7 @@
> > #ifdef CONFIG_MELAN
> > # define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency!
> */
> > #else
> > -# define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
> > +# define CLOCK_TICK_RATE 1193182 /* Underlying HZ */
> > #endif
> > #endif
> >
> > diff -Nru a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
> > --- a/include/asm-x86_64/timex.h Sat Jun 14 22:23:32 2003
> > +++ b/include/asm-x86_64/timex.h Sat Jun 14 22:23:32 2003
> > @@ -10,7 +10,7 @@
> > #include <asm/msr.h>
> > #include <asm/vsyscall.h>
> >
> > -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
> > +#define CLOCK_TICK_RATE 1193182 /* Underlying HZ */
> > #define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and
> CLOCK_TICK_RATE */
> > #define FINETUNE ((((((int)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) *
> \
> > (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.489 / Virus Database: 288 - Release Date: 10-Jun-2003
>
--
Vojtech Pavlik
SuSE Labs, SuSE CR
next prev parent reply other threads:[~2003-06-14 21:01 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-14 20:35 [patch] input: Implement device grabbing [1/13] Vojtech Pavlik
2003-06-14 20:36 ` [patch] input: Fix sunkbd keybit bitfield filling [2/13] Vojtech Pavlik
2003-06-14 20:37 ` [patch] input: Implement HID quirk for A4Tech mice [3/13] Vojtech Pavlik
2003-06-14 20:39 ` [patch] input: Add hiragana/katakana keys to atkbd.c [4/13] Vojtech Pavlik
2003-06-14 20:40 ` [patch] input: Add PCI PS/2 controller support [5/13] Vojtech Pavlik
2003-06-14 20:40 ` [patch] input: Turn numlock ON on HP HIL machines [6/13] Vojtech Pavlik
2003-06-14 20:41 ` [patch] input: Add keys for HP HIL [7/13] Vojtech Pavlik
2003-06-14 20:42 ` [patch] input: Fix CLOCK_TICK_RATE usage ... [8/13] Vojtech Pavlik
2003-06-14 20:43 ` [patch] input: Fix i8042 interrupts on I2000 ia64 machines [9/13] Vojtech Pavlik
2003-06-14 20:44 ` [patch] input: Fix sending reports in USB HID [10/13] Vojtech Pavlik
2003-06-14 20:45 ` [patch] input: Fix hiddev_ioctl() [11/13] Vojtech Pavlik
2003-06-14 20:45 ` [patch] input: Fix minor errors in input-programming.txt [12/13] Vojtech Pavlik
2003-06-14 20:46 ` [patch] input: Add Synaptics touchpad support [13/13] Vojtech Pavlik
2003-06-14 21:05 ` [patch] input: Fix CLOCK_TICK_RATE usage ... [8/13] Riley Williams
2003-06-14 21:14 ` Vojtech Pavlik [this message]
2003-06-15 10:51 ` Riley Williams
2003-06-16 18:57 ` David Mosberger
2003-06-17 22:11 ` Riley Williams
2003-06-17 22:19 ` David Mosberger
2003-06-17 22:21 ` Vojtech Pavlik
2003-06-17 22:34 ` David Mosberger
2003-06-17 22:42 ` Vojtech Pavlik
2003-06-17 22:48 ` Russell King
2003-06-17 22:53 ` Vojtech Pavlik
2003-06-19 12:13 ` David Woodhouse
2003-06-19 14:19 ` Russell King
2003-06-17 23:08 ` David Mosberger
2003-06-17 23:14 ` Vojtech Pavlik
2003-06-17 23:24 ` David Mosberger
2003-06-17 23:31 ` Vojtech Pavlik
2003-06-18 0:47 ` george anzinger
2003-06-25 8:03 ` Riley Williams
2003-06-25 17:20 ` David Mosberger
2003-06-25 17:56 ` Riley Williams
2003-06-25 18:49 ` David Mosberger
2003-06-25 19:58 ` Vojtech Pavlik
2003-06-25 20:09 ` David Mosberger
2003-06-25 20:25 ` Assorted warnings while building 2.5.73 J.C. Wren
2003-06-18 14:47 ` [patch] input: Fix CLOCK_TICK_RATE usage ... [8/13] Hollis Blanchard
2003-06-18 18:50 ` David Mosberger
2003-06-17 22:21 ` Russell King
2003-06-17 22:38 ` Vojtech Pavlik
2003-06-18 0:46 ` george anzinger
2003-06-18 1:00 ` george anzinger
2003-06-14 20:51 ` [patch] input: Add PCI PS/2 controller support [5/13] Oliver Neukum
2003-06-14 21:03 ` Vojtech Pavlik
2003-06-14 21:04 ` Russell King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030614231455.A26303@ucw.cz \
--to=vojtech@suse.cz \
--cc=Riley@Williams.Name \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®