public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ns558 mis-detects gameport
@ 2005-07-08 20:36 Neil Darlow
  2005-07-08 21:24 ` Vojtech Pavlik
  2005-08-04 20:56 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: Neil Darlow @ 2005-07-08 20:36 UTC (permalink / raw)
  To: vojtech; +Cc: linux-kernel, linux-joystick

Hi All,

I am passing on this information at the request of Daniel Drake (Gentoo kernel 
ebuild maintainer).

My hardware is an ASRock K7S41GX motherboard with Athlon XP2200+ CPU
running 2.6.12 on Gentoo GNU/Linux 2005.0. My gamepad is an Heroic HC 3100 
2-axis, 4-button digital model with Turbo features.

The CVS version string of ns558.c is:
$Id: ns558.c,v 1.43 2002/01/24 19:23:21 vojtech Exp $

My motherboard features a generic PC/ISA gameport at BIOS-selectable
addresses of 0x200 or 0x208. I have built my kernel (using Gentoo's genkernel) 
to include the Joystick Interface, Generic PC/ISA Gameport and Analog 
Joystick support as modules which are loaded at boot by coldplug/hotplug 
logic.

If I manually modprobe ns558 (which loads gameport), analog and joydev after 
boot my gameport is detected. If I let coldplug/hotplug load the modules at 
boot then ns558 fails to detect my gameport.

If I unload, and then reload, ns558 using coldplug/hotplug at boot then ns558 
detects my gameport correctly. My module loading setup and dmesg output for a 
ns558 insert-remove-insert cycle are as follows:

  options analog map=gamepad
  above analog joydev
  pre-install analog modprobe -r ns558; modprobe ns558

  gameport: NS558 ISA Gameport is isa0200/gameport0, io 0x201, speed 806kHz
  pnp: Device 00:0a disabled.
  ns558: probe of 00:0a failed with error -16
  gameport: kgameportd exiting
  pnp: Device 00:0a activated.
  gameport: NS558 PnP Gameport is pnp00:0a/gameport0, io 0x200, speed 806kHz
  input: Analog 2-axis 4-button gamepad at pnp00:0a/gameport0 [TSC timer, 1786
    MHz clock, 1299 ns res]

At https://www.redhat.com/archives/fedora-list/2005-January/msg04967.html the 
same problem is reported for 2.6.10 on Fedora.

Is a fix or workaround, other than what I'm doing already, available for this 
problem?

Regards,
Neil Darlow
-- 
Anti-virus scanned by ClamAV-0.86.1 - http://www.clamav.net

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

* Re: ns558 mis-detects gameport
  2005-07-08 20:36 ns558 mis-detects gameport Neil Darlow
@ 2005-07-08 21:24 ` Vojtech Pavlik
  2005-07-09 11:22   ` Neil Darlow
  2005-08-04 20:56 ` Andrew Morton
  1 sibling, 1 reply; 5+ messages in thread
From: Vojtech Pavlik @ 2005-07-08 21:24 UTC (permalink / raw)
  To: Neil Darlow; +Cc: vojtech, linux-kernel, linux-joystick

On Fri, Jul 08, 2005 at 09:36:47PM +0100, Neil Darlow wrote:
> Hi All,
> 
> I am passing on this information at the request of Daniel Drake (Gentoo kernel 
> ebuild maintainer).
> 
> My hardware is an ASRock K7S41GX motherboard with Athlon XP2200+ CPU
> running 2.6.12 on Gentoo GNU/Linux 2005.0. My gamepad is an Heroic HC 3100 
> 2-axis, 4-button digital model with Turbo features.
> 
> The CVS version string of ns558.c is:
> $Id: ns558.c,v 1.43 2002/01/24 19:23:21 vojtech Exp $
> 
> My motherboard features a generic PC/ISA gameport at BIOS-selectable
> addresses of 0x200 or 0x208. I have built my kernel (using Gentoo's genkernel) 
> to include the Joystick Interface, Generic PC/ISA Gameport and Analog 
> Joystick support as modules which are loaded at boot by coldplug/hotplug 
> logic.
> 
> If I manually modprobe ns558 (which loads gameport), analog and joydev after 
> boot my gameport is detected. If I let coldplug/hotplug load the modules at 
> boot then ns558 fails to detect my gameport.
> 
> If I unload, and then reload, ns558 using coldplug/hotplug at boot then ns558 
> detects my gameport correctly. My module loading setup and dmesg output for a 
> ns558 insert-remove-insert cycle are as follows:
> 
>   options analog map=gamepad
>   above analog joydev
>   pre-install analog modprobe -r ns558; modprobe ns558
> 
>   gameport: NS558 ISA Gameport is isa0200/gameport0, io 0x201, speed 806kHz
>   pnp: Device 00:0a disabled.
>   ns558: probe of 00:0a failed with error -16
>   gameport: kgameportd exiting
>   pnp: Device 00:0a activated.
>   gameport: NS558 PnP Gameport is pnp00:0a/gameport0, io 0x200, speed 806kHz
>   input: Analog 2-axis 4-button gamepad at pnp00:0a/gameport0 [TSC timer, 1786
>     MHz clock, 1299 ns res]
> 
> At https://www.redhat.com/archives/fedora-list/2005-January/msg04967.html the 
> same problem is reported for 2.6.10 on Fedora.
> 
> Is a fix or workaround, other than what I'm doing already, available for this 
> problem?
 
ns558 first probes for legacy ISA gameports, and then for PnP gameports.
The problem, as you can see above is that in the first case it finds
your gameport as a legacy one, and then proceeds to probe for PnP
devices. That fails and causes the legacy gameport to be disabled by the
PnP subsystem.

On the second try, the gameport is disabled. The legacy probe doesn't
find it, and the PnP probe succeeds, and enables it. It then works.

In the current input GIT tree there is a patch to reverse the order of
probing (PnP first) for exactly this reason. I expect 2.6.13 should have
the fix.

As a workaround, you can try disabling the gameport in BIOS. The legacy
probe won't see it, and the PnP probe might enable it just fine.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

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

* Re: ns558 mis-detects gameport
  2005-07-08 21:24 ` Vojtech Pavlik
@ 2005-07-09 11:22   ` Neil Darlow
  2005-07-09 16:41     ` Daniel Drake
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Darlow @ 2005-07-09 11:22 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: linux-kernel, linux-joystick, Daniel Drake

Hi Vojtech,

On Friday 08 Jul 2005 22:24, Vojtech Pavlik wrote:
> In the current input GIT tree there is a patch to reverse the order of
> probing (PnP first) for exactly this reason. I expect 2.6.13 should have
> the fix.

Daniel, is it worth backporting this fix for gentoo-sources-2.6.12 so others 
aren't bitten or will we have to wait for 2.6.13?

> As a workaround, you can try disabling the gameport in BIOS. The legacy
> probe won't see it, and the PnP probe might enable it just fine.

Disabling the gameport in my BIOS seems to take it off the bus and PnP doesn't 
see it at all.

Regards,
Neil Darlow
-- 
Anti-virus scanned by ClamAV-0.86.1 - http://www.clamav.net

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

* Re: ns558 mis-detects gameport
  2005-07-09 11:22   ` Neil Darlow
@ 2005-07-09 16:41     ` Daniel Drake
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Drake @ 2005-07-09 16:41 UTC (permalink / raw)
  To: Neil Darlow; +Cc: Vojtech Pavlik, linux-kernel, linux-joystick

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

Neil Darlow wrote:
> Hi Vojtech,
> 
> On Friday 08 Jul 2005 22:24, Vojtech Pavlik wrote:
> 
>>In the current input GIT tree there is a patch to reverse the order of
>>probing (PnP first) for exactly this reason. I expect 2.6.13 should have
>>the fix.
> 
> 
> Daniel, is it worth backporting this fix for gentoo-sources-2.6.12 so others 
> aren't bitten or will we have to wait for 2.6.13?

Sure, but only after you have confirmed it fixes the problem for you. I've
attached the patch. Please let me know how you get on.

Thanks,
Daniel

[-- Attachment #2: gameport-probe.patch --]
[-- Type: text/x-patch, Size: 1211 bytes --]

From: Vojtech Pavlik <vojtech@suse.cz>
Date: Sun, 29 May 2005 07:25:01 +0000 (-0500)
Subject: Input: Probe PnP gameports first, ISA after that.
X-Git-Url: http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/dtor/input.git;a=commitdiff;h=f6397cecadc52779902bdd8f8cd3ea5af3a19ad1

  Input: Probe PnP gameports first, ISA after that.
  
  Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
  Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

--- a/drivers/input/gameport/ns558.c
+++ b/drivers/input/gameport/ns558.c
@@ -258,18 +258,18 @@ static int __init ns558_init(void)
 {
 	int i = 0;
 
+	if (pnp_register_driver(&ns558_pnp_driver) >= 0)
+		pnp_registered = 1;
+
 /*
- * Probe ISA ports first so that PnP gets to choose free port addresses
- * not occupied by the ISA ports.
+ * Probe ISA ports after PnP, so that PnP ports that are already
+ * enabled get detected as PnP. This may be suboptimal in multi-device
+ * configurations, but saves hassle with simple setups.
  */
 
 	while (ns558_isa_portlist[i])
 		ns558_isa_probe(ns558_isa_portlist[i++]);
 
-	if (pnp_register_driver(&ns558_pnp_driver) >= 0)
-		pnp_registered = 1;
-
-
 	return (list_empty(&ns558_list) && !pnp_registered) ? -ENODEV : 0;
 }
 

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

* Re: ns558 mis-detects gameport
  2005-07-08 20:36 ns558 mis-detects gameport Neil Darlow
  2005-07-08 21:24 ` Vojtech Pavlik
@ 2005-08-04 20:56 ` Andrew Morton
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2005-08-04 20:56 UTC (permalink / raw)
  To: Neil Darlow; +Cc: vojtech, linux-kernel, linux-joystick

Neil Darlow <neil@darlow.co.uk> wrote:
>
> Hi All,
> 
> I am passing on this information at the request of Daniel Drake (Gentoo kernel 
> ebuild maintainer).
> 
> My hardware is an ASRock K7S41GX motherboard with Athlon XP2200+ CPU
> running 2.6.12 on Gentoo GNU/Linux 2005.0. My gamepad is an Heroic HC 3100 
> 2-axis, 4-button digital model with Turbo features.
> 
> The CVS version string of ns558.c is:
> $Id: ns558.c,v 1.43 2002/01/24 19:23:21 vojtech Exp $
> 
> My motherboard features a generic PC/ISA gameport at BIOS-selectable
> addresses of 0x200 or 0x208. I have built my kernel (using Gentoo's genkernel) 
> to include the Joystick Interface, Generic PC/ISA Gameport and Analog 
> Joystick support as modules which are loaded at boot by coldplug/hotplug 
> logic.
> 
> If I manually modprobe ns558 (which loads gameport), analog and joydev after 
> boot my gameport is detected. If I let coldplug/hotplug load the modules at 
> boot then ns558 fails to detect my gameport.
> 
> If I unload, and then reload, ns558 using coldplug/hotplug at boot then ns558 
> detects my gameport correctly. My module loading setup and dmesg output for a 
> ns558 insert-remove-insert cycle are as follows:
> 
>   options analog map=gamepad
>   above analog joydev
>   pre-install analog modprobe -r ns558; modprobe ns558
> 
>   gameport: NS558 ISA Gameport is isa0200/gameport0, io 0x201, speed 806kHz
>   pnp: Device 00:0a disabled.
>   ns558: probe of 00:0a failed with error -16
>   gameport: kgameportd exiting
>   pnp: Device 00:0a activated.
>   gameport: NS558 PnP Gameport is pnp00:0a/gameport0, io 0x200, speed 806kHz
>   input: Analog 2-axis 4-button gamepad at pnp00:0a/gameport0 [TSC timer, 1786
>     MHz clock, 1299 ns res]
> 
> At https://www.redhat.com/archives/fedora-list/2005-January/msg04967.html the 
> same problem is reported for 2.6.10 on Fedora.
> 
> Is a fix or workaround, other than what I'm doing already, available for this 
> problem?
> 

I assume this is some sort of ordering/dependency problem.  I don't think
we're going to get onto fixing it for 2.6.13, I'm afraid.

It would really help if you could raise a bug report at bugzilla.kernel.org
so that it doesn't get forgotten.  In that report, please identify the most
recent kernel version whcih worked correctly, if any.

Thanks.

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

end of thread, other threads:[~2005-08-04 20:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-08 20:36 ns558 mis-detects gameport Neil Darlow
2005-07-08 21:24 ` Vojtech Pavlik
2005-07-09 11:22   ` Neil Darlow
2005-07-09 16:41     ` Daniel Drake
2005-08-04 20:56 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox