Bug 37075

Summary: the iforce joystick driver is broken (it does not report any event)
Product: [Retired] Red Hat Linux Reporter: Alfredo Ferrari <alfredo.maria.ferrari>
Component: kernelAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED ERRATA QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-04-22 17:06:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alfredo Ferrari 2001-04-22 17:03:55 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.2.16-3smp i686)


The iforce joystick driver in RH7.1 is broken. This is a well known problem
already discussed (and solved) a couple of months ago in the USB lists, I
am puzzled RH missed it. The driver does not report any event at all after
initializing due to a missing 
      iforce->usbdev = dev;
assignment. I include below the e-mails I got from Randy Dunlap, the
second one could suggest that similar problems could be there with other
input drivers. By the way there is bug in the hotplug stuff,
it correctly loads iforce.o when the joystick is plugged in but it does not
load joydev as well ==> it cannot be used unless I manually issue "modprobe
joydev" as well


Date: Fri, 16 Feb 2001 11:52:53 -0800
From: Randy.Dunlap <randy.dunlap>
To: Alfredo Ferrari <Alfredo.Ferrari>
Cc: "'linux-usb-devel.net'"
    <linux-usb-devel.net>
Subject: Re: [linux-usb-devel] Problems with USB and a Logitech Wingman
    Force  under kernel 2.4.0
Parts/Attachments:
   1 Shown    32 lines  Text
   2 Shown    10 lines  Text
----------------------------------------


Hi-

Please try the attached iforce.c patch on 2.4.x and
let us know if it works/helps.

~Randy


Alfredo Ferrari wrote:
> 
> On Wed, 14 Feb 2001, Dunlap, Randy wrote:
> Hi Randy
> 
> I performed the checks you suggested. Enclosed please find:
> 
> c) iforce-messages.log, messages on the logs when the joystick is
>    accessed with some extra printing including those suggested by you.
>    The error code from usb_submit_urb is -19 as you can see. The
> messages
>    are exactly the same with uhci or usb-uhci, so I include them only
> once
> d) usbdevices-2.2.log, /proc/bus/usb/devices content with
>    kernel-2.2.17 and the uhci driver (backport to 2.2 as included in the
>    latest RH7 update). As I told you, the joystick works fine under
> these conditions
> 
> > Hi,
> >
> > > I already reported this problem a couple of days before but I got no
> > > answer and/or suggestion. I have a Logitech Wingman Force
> > > joystick which
> > > works nicely under 2.2 kernels with the wmforce modules. It
> > > is recognized and properly configured.
    [ Part 2: "Attached Text" ]

--- linux/drivers/char/joystick/iforce.c.org    Thu Jan  4 13:15:32 2001
+++ linux/drivers/char/joystick/iforce.c        Fri Feb 16 11:46:41 2001
@@ -196,6 +196,7 @@
        iforce->dev.idvendor = dev->descriptor.idVendor;
        iforce->dev.idproduct = dev->descriptor.idProduct;
        iforce->dev.idversion = dev->descriptor.bcdDevice;
+       iforce->usbdev = dev;
 
        FILL_INT_URB(&iforce->irq, dev, usb_rcvintpipe(dev,
endpoint->bEndpointAddress),
                        iforce->data, 8, iforce_usb_irq, iforce,
endpoint->bInterval);

Date: Sun, 18 Feb 2001 10:27:51 -0800
From: "Dunlap, Randy" <randy.dunlap>
To: 'Alfredo Ferrari' <Alfredo.Ferrari>
Cc: "'linux-usb-devel.net'"
    <linux-usb-devel.net>
Subject: RE: [linux-usb-devel] Problems with USB and a Logitech Wingman Fo
    rce under kernel 2.4.0

> From: Alfredo Ferrari [alfredo.ferrari]
> 
> of course you are right! With that extra line it works. By the way, I
> don't understand how it could ever work without...
> 
> What's next? Do I have to send a message to the driver 
> mantainer (Vojtech
> Pavlik I assume), or you already sent him the pacth?

Hi Alfredo-
After I sent that 1-line patch to you, I found that
and several other patches in Vojtech's "input" subsystem
CVS, so I don't think that he needs it, although the
kernel source code does need it.

That code could have worked once upon a time, before we
added setting usbdev = NULL in completion routines and
"urb.usbdev = dev" before any/all calls to usb_submit_urb().

~Randy



Reproducible: Always
Steps to Reproduce:
1.Plug in a Logitech usb joystick or similar
2.Run a testing program (ie jstest) after inserting all relevant modules
3.Move/press buttons 
	

Actual Results:  No event is reported

Expected Results:  The events should be reported

Comment 1 Pete Zaitcev 2001-04-23 05:10:42 UTC
Thanks for the bug report that allowed me to fix
the problem without having the hardware. If only
every bug submitter worked like that!

The bug is real, though Randy's explanation is not
complete. When we started to zap urb->dev, many
assignments needed assignments added there before
a repeated submit_urb(). Here a kind soul added
that assignment, but used an unutialized variable
for that. The iforce->usbdev is it.

The fix will come up in the next errata
(actually, first errata for 7.1)

Thanks again,
-- Pete