Commit af316dea authored by Oliver Neukum's avatar Oliver Neukum Committed by Vojtech Pavlik

iforce-usb.c, iforce-packets.c:

  Fix I-Force sleeping issues.
parent c3ea202d
...@@ -166,8 +166,7 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data, ...@@ -166,8 +166,7 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data,
iforce->expect_packet = 0; iforce->expect_packet = 0;
iforce->ecmd = cmd; iforce->ecmd = cmd;
memcpy(iforce->edata, data, IFORCE_MAX_LENGTH); memcpy(iforce->edata, data, IFORCE_MAX_LENGTH);
if (waitqueue_active(&iforce->wait)) wake_up(&iforce->wait);
wake_up(&iforce->wait);
} }
#endif #endif
...@@ -264,7 +263,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet) ...@@ -264,7 +263,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&iforce->wait, &wait); add_wait_queue(&iforce->wait, &wait);
if (usb_submit_urb(iforce->ctrl, GFP_KERNEL)) { if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC)) {
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
remove_wait_queue(&iforce->wait, &wait); remove_wait_queue(&iforce->wait, &wait);
return -1; return -1;
......
...@@ -116,8 +116,7 @@ static void iforce_usb_out(struct urb *urb, struct pt_regs *regs) ...@@ -116,8 +116,7 @@ static void iforce_usb_out(struct urb *urb, struct pt_regs *regs)
iforce_usb_xmit(iforce); iforce_usb_xmit(iforce);
if (waitqueue_active(&iforce->wait)) wake_up(&iforce->wait);
wake_up(&iforce->wait);
} }
static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs) static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs)
...@@ -125,8 +124,7 @@ static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs) ...@@ -125,8 +124,7 @@ static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs)
struct iforce *iforce = urb->context; struct iforce *iforce = urb->context;
if (urb->status) return; if (urb->status) return;
iforce->ecmd = 0xff00 | urb->actual_length; iforce->ecmd = 0xff00 | urb->actual_length;
if (waitqueue_active(&iforce->wait)) wake_up(&iforce->wait);
wake_up(&iforce->wait);
} }
static int iforce_usb_probe(struct usb_interface *intf, static int iforce_usb_probe(struct usb_interface *intf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment