mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* severe ns558 joystick problems with 2.4.12
@ 2001-10-21  9:46 Jeremy M. Dolan
  2001-10-21 17:53 ` Vojtech Pavlik
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy M. Dolan @ 2001-10-21  9:46 UTC (permalink / raw)
  To: vojtech, linux-kernel

I posted to linux-kernel 10 days ago with this problem, didn't really
get any follow up, except other users having the same problem. So far
have had 6 users contact me with the same problem, seems to have
occured as early as 2.4.9 and .10, based on what I've heard from others.

To recap:

I have a 2 axis 6 button analog (ns558) gamepad. With 2.4.7,
everything is fine, as long as I pass js=gamepad, it detects the 2
axis and 6 buttons.

With 2.4.12, with js=gamepad and js=12531 (bitfield forced detection),
the kernel message SAYS it detects 2 axis and 6 buttons, however when
I use it (for example, with the jstest program), the two axis and
buttons 4/5 don't register. The first four (0-3) buttons are fine.

-- 
Jeremy M. Dolan <mailto:jmd@pobox.com> <http://turbogeek.org/>
PGP: 1024D/DC433DEE 494C 7A6E 19FB 026A 1F52  E0D5 5C5D 6228 DC43 3DEE

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

* Re: severe ns558 joystick problems with 2.4.12
  2001-10-21  9:46 severe ns558 joystick problems with 2.4.12 Jeremy M. Dolan
@ 2001-10-21 17:53 ` Vojtech Pavlik
  0 siblings, 0 replies; 2+ messages in thread
From: Vojtech Pavlik @ 2001-10-21 17:53 UTC (permalink / raw)
  To: Jeremy M. Dolan; +Cc: linux-kernel

On Sun, Oct 21, 2001 at 04:46:30AM -0500, Jeremy M. Dolan wrote:
> I posted to linux-kernel 10 days ago with this problem, didn't really
> get any follow up, except other users having the same problem. So far
> have had 6 users contact me with the same problem, seems to have
> occured as early as 2.4.9 and .10, based on what I've heard from others.
> 
> To recap:
> 
> I have a 2 axis 6 button analog (ns558) gamepad. With 2.4.7,
> everything is fine, as long as I pass js=gamepad, it detects the 2
> axis and 6 buttons.
> 
> With 2.4.12, with js=gamepad and js=12531 (bitfield forced detection),
> the kernel message SAYS it detects 2 axis and 6 buttons, however when
> I use it (for example, with the jstest program), the two axis and
> buttons 4/5 don't register. The first four (0-3) buttons are fine.

The bug was introduced in 2.4.10. I've sent a patch that fixes it to
Linus already, one before 2.4.11, and one after 2.4.12, when I noticed
the fix didn't get in it. Here it is (first chunk is the important
thing, second chunk is just to avoid nonsensical values be printed on
too fast CPUs):

--- linux/drivers/char/joystick/analog.c	Fri Sep 14 23:40:00 2001
+++ linux-fixed/drivers/char/joystick/analog.c	Thu Oct 18 17:57:06 2001
@@ -138,7 +138,7 @@
 
 #ifdef __i386__
 #define TSC_PRESENT	(test_bit(X86_FEATURE_TSC, &boot_cpu_data.x86_capability))
-#define GET_TIME(x)	do { if (TSC_PRESENT) rdtscl(x); else outb(0, 0x43); x = inb(0x40); x |= inb(0x40) << 8; } while (0)
+#define GET_TIME(x)	do { if (TSC_PRESENT) rdtscl(x); else { outb(0, 0x43); x = inb(0x40); x |= inb(0x40) << 8; } } while (0)
 #define DELTA(x,y)	(TSC_PRESENT?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0)))
 #define TIME_NAME	(TSC_PRESENT?"TSC":"PIT")
 #elif __x86_64__
@@ -499,7 +499,9 @@
 	else
 		printk(" [%s timer, %d %sHz clock, %d ns res]\n", TIME_NAME,
 		port->speed > 10000 ? (port->speed + 800) / 1000 : port->speed,
-		port->speed > 10000 ? "M" : "k", (port->loop * 1000000) / port->speed);
+		port->speed > 10000 ? "M" : "k",
+		port->speed > 10000 ? (port->loop * 1000) / (port->speed / 1000)
+				    : (port->loop * 1000000) / port->speed);
 }
 
 /*

-- 
Vojtech Pavlik
SuSE Labs

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

end of thread, other threads:[~2001-10-21 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-21  9:46 severe ns558 joystick problems with 2.4.12 Jeremy M. Dolan
2001-10-21 17:53 ` Vojtech Pavlik

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®