Re: [BUG 2.6.29-rc8-git2] generic-usb: probe of 0003:06A3:0006.0001 failed with error -32 (Saitek joystick)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 17 Mar 2009, Melchior FRANZ wrote:

> * Alan Stern -- Tuesday 17 March 2009:
> > The trace shows the joystick working under 2.6.28, but it's not working
> > _right_.
> 
> I didn't notice any problems, so I'd prefer that state to not having
> it work at all, like under 2.6.29.  :-}
> 
> 
> 
> > 	rmmod usbhid ; modprobe usbhid
> 
> Haven't tried that as I have all that compiled in. If you actually want
> to know, then I'd recompile and try. 

You don't have to recompile.  Just do this:

	cd /sys/bus/usb/drivers/usbhid
	echo -n 1-3.3:1.0 >unbind ; echo -n 1-3.3:1.0 >bind

It will have about the same effect.

> > There's clearly a bug in the device.  One way around it might be to add 
> > an entry in drivers/usb/core/quirks.c for it, with the 
> > USB_QUIRK_STRING_FETCH_255 flag.  That might or might not do the trick, 
> 
> Thanks. No, it didn't do the trick. So it's either sticking with 2.6.28
> forever, or buying a new js or a new computer.  :-|

Why do you say that?  There are other approaches.  You can try this 
patch.

Alan Stern



Index: usb-2.6/include/linux/usb/quirks.h
===================================================================
--- usb-2.6.orig/include/linux/usb/quirks.h
+++ usb-2.6/include/linux/usb/quirks.h
@@ -16,4 +16,7 @@
 /* device can't handle Set-Interface requests */
 #define USB_QUIRK_NO_SET_INTF		0x00000004
 
+/* device can't handle its Configuration or Interface strings */
+#define USB_QUIRK_CONFIG_INTF_STRINGS	0x00000008
+
 #endif /* __LINUX_USB_QUIRKS_H */
Index: usb-2.6/drivers/usb/core/quirks.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/quirks.c
+++ usb-2.6/drivers/usb/core/quirks.c
@@ -54,6 +54,10 @@ static const struct usb_device_id usb_qu
 	{ USB_DEVICE(0x0638, 0x0a13), .driver_info =
 	  USB_QUIRK_STRING_FETCH_255 },
 
+	/* Saitek Cyborg Gold Joystick */
+	{ USB_DEVICE(0x06a3, 0x0006), .driver_info =
+			USB_QUIRK_CONFIG_INTF_STRINGS },
+
 	/* M-Systems Flash Disk Pioneers */
 	{ USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
 
Index: usb-2.6/drivers/usb/core/message.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/message.c
+++ usb-2.6/drivers/usb/core/message.c
@@ -1719,7 +1719,8 @@ free_interfaces:
 	}
 	kfree(new_interfaces);
 
-	if (cp->string == NULL)
+	if (cp->string == NULL &&
+			!(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
 		cp->string = usb_cache_string(dev, cp->desc.iConfiguration);
 
 	/* Now that all the interfaces are set up, register them
Index: usb-2.6/drivers/usb/core/sysfs.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/sysfs.c
+++ usb-2.6/drivers/usb/core/sysfs.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/usb.h>
+#include <linux/usb/quirks.h>
 #include "usb.h"
 
 /* Active configuration fields */
@@ -813,7 +814,8 @@ int usb_create_sysfs_intf_files(struct u
 	if (intf->sysfs_files_created || intf->unregistering)
 		return 0;
 
-	if (alt->string == NULL)
+	if (alt->string == NULL &&
+			!(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
 		alt->string = usb_cache_string(udev, alt->desc.iInterface);
 	if (alt->string)
 		retval = device_create_file(&intf->dev, &dev_attr_interface);

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux