Skip to contentSkip to conversation

iforce: fix -ENOMEM check

PATCH Marek Vašut 2 participants 5 messages Jan 28, 2006 – Jan 30, 2006

lore
Share & tools
lore
#0 lore raw

I have tried that patch, but nothing changed ...
That error is still there and no new device in /dev/input appears

#1 lore raw
Quoted 2 lines · Marek Vašut

I have tried that patch, but nothing changed ...
That error is still there and no new device in /dev/input appears

You do have updated udev, don't you? Could you pease post your dmesg with the patch applied?

Signature · 1 line
Dmitry
#2 lore raw

Dne neděle 29 ledna 2006 05:14 jste napsal(a):

Quoted 6 lines · Marek Vašut
Quoted 2 lines

I have tried that patch, but nothing changed ...
That error is still there and no new device in /dev/input appears

You do have updated udev, don't you? Could you pease post your dmesg with the patch applied?

usb 4-2: new full speed USB device using uhci_hcd and address 2 usb 4-2: configuration #1 chosen from 1 choice iforce-main.c: Timeout waiting for response from device.
usbcore: registered new driver iforce

I´ve cut off the unnecessary parts. This is what shows up when I connect it. There is no js0 in /dev/input ... thats weird, isn´t it?

#3 lore raw
Quoted 8 lines · Marek Vašut

Dne neděle 29 ledna 2006 05:14 jste napsal(a):

Quoted 6 lines · Marek Vašut
Quoted 2 lines

I have tried that patch, but nothing changed ...
That error is still there and no new device in /dev/input appears

You do have updated udev, don't you? Could you pease post your dmesg with the patch applied?

Quoted 8 lines

usb 4-2: new full speed USB device using uhci_hcd and address 2 usb 4-2: configuration #1 chosen from 1 choice iforce-main.c: Timeout waiting for response from device.
usbcore: registered new driver iforce

I´ve cut off the unnecessary parts. This is what shows up when I connect it. There is no js0 in /dev/input ... thats weird, isn´t it?

OK, the patch below should get it going... Please let me know if it makes device appear.

Signature · 44 lines
Dmitry

Signed-off-by: Dmitry Torokhov <[email protected]>
---

 drivers/input/joystick/iforce/iforce-packets.c |    4 ++--
 drivers/input/joystick/iforce/iforce-usb.c     |    1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

Index: work/drivers/input/joystick/iforce/iforce-packets.c
===================================================================
--- work.orig/drivers/input/joystick/iforce/iforce-packets.c
+++ work/drivers/input/joystick/iforce/iforce-packets.c
@@ -167,9 +167,9 @@ void iforce_process_packet(struct iforce
 		iforce->expect_packet = 0;
 		iforce->ecmd = cmd;
 		memcpy(iforce->edata, data, IFORCE_MAX_LENGTH);
-		wake_up(&iforce->wait);
 	}
 #endif
+	wake_up(&iforce->wait);
 
 	if (!iforce->type) {
 		being_used--;
@@ -264,7 +264,7 @@ int iforce_get_id_packet(struct iforce *
 		wait_event_interruptible_timeout(iforce->wait,
 			iforce->ctrl->status != -EINPROGRESS, HZ);
 
-		if (iforce->ctrl->status != -EINPROGRESS) {
+		if (iforce->ctrl->status) {
 			usb_unlink_urb(iforce->ctrl);
 			return -1;
 		}
Index: work/drivers/input/joystick/iforce/iforce-usb.c
===================================================================
--- work.orig/drivers/input/joystick/iforce/iforce-usb.c
+++ work/drivers/input/joystick/iforce/iforce-usb.c
@@ -95,7 +95,6 @@ static void iforce_usb_irq(struct urb *u
 		goto exit;
 	}
 
-	wake_up(&iforce->wait);
 	iforce_process_packet(iforce,
 		(iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1, regs);
#4 lore raw

Dne pondělí 30 ledna 2006 04:26 jste napsal(a):

Quoted 2 lines

OK, the patch below should get it going... Please let me know if it makes device appear.

Yeah, it works :-)
Thanks a lot. Maybe this fix should get somehow in kernel tree.