Commit 3dfedcfe authored by Duncan Sands's avatar Duncan Sands Committed by Linus Torvalds

[PATCH] USB speedtouch: spin_lock_irqsave -> spin_lock_irq in tasklets

Replace spin_lock_irqsave/spin_unlock_irqrestore with
spin_lock_irq/spin_unlock_irq in tasklet actions, since
these are always called with local irqs enabled.
parent 704500ef
...@@ -534,7 +534,6 @@ static void udsl_process_receive (unsigned long data) ...@@ -534,7 +534,6 @@ static void udsl_process_receive (unsigned long data)
{ {
struct udsl_instance_data *instance = (struct udsl_instance_data *) data; struct udsl_instance_data *instance = (struct udsl_instance_data *) data;
struct udsl_receiver *rcv; struct udsl_receiver *rcv;
unsigned long flags;
unsigned char *data_start; unsigned char *data_start;
struct sk_buff *skb; struct sk_buff *skb;
struct urb *urb; struct urb *urb;
...@@ -544,11 +543,11 @@ static void udsl_process_receive (unsigned long data) ...@@ -544,11 +543,11 @@ static void udsl_process_receive (unsigned long data)
dbg ("udsl_process_receive entered"); dbg ("udsl_process_receive entered");
spin_lock_irqsave (&instance->completed_receivers_lock, flags); spin_lock_irq (&instance->completed_receivers_lock);
while (!list_empty (&instance->completed_receivers)) { while (!list_empty (&instance->completed_receivers)) {
rcv = list_entry (instance->completed_receivers.next, struct udsl_receiver, list); rcv = list_entry (instance->completed_receivers.next, struct udsl_receiver, list);
list_del (&rcv->list); list_del (&rcv->list);
spin_unlock_irqrestore (&instance->completed_receivers_lock, flags); spin_unlock_irq (&instance->completed_receivers_lock);
urb = rcv->urb; urb = rcv->urb;
dbg ("udsl_process_receive: got packet %p with length %d and status %d", urb, urb->actual_length, urb->status); dbg ("udsl_process_receive: got packet %p with length %d and status %d", urb, urb->actual_length, urb->status);
...@@ -606,15 +605,15 @@ static void udsl_process_receive (unsigned long data) ...@@ -606,15 +605,15 @@ static void udsl_process_receive (unsigned long data)
/* fall through */ /* fall through */
default: /* error or urb unlinked */ default: /* error or urb unlinked */
dbg ("udsl_process_receive: adding to spare_receivers"); dbg ("udsl_process_receive: adding to spare_receivers");
spin_lock_irqsave (&instance->spare_receivers_lock, flags); spin_lock_irq (&instance->spare_receivers_lock);
list_add (&rcv->list, &instance->spare_receivers); list_add (&rcv->list, &instance->spare_receivers);
spin_unlock_irqrestore (&instance->spare_receivers_lock, flags); spin_unlock_irq (&instance->spare_receivers_lock);
break; break;
} /* switch */ } /* switch */
spin_lock_irqsave (&instance->completed_receivers_lock, flags); spin_lock_irq (&instance->completed_receivers_lock);
} /* while */ } /* while */
spin_unlock_irqrestore (&instance->completed_receivers_lock, flags); spin_unlock_irq (&instance->completed_receivers_lock);
dbg ("udsl_process_receive successful"); dbg ("udsl_process_receive successful");
} }
...@@ -684,7 +683,6 @@ static void udsl_process_send (unsigned long data) ...@@ -684,7 +683,6 @@ static void udsl_process_send (unsigned long data)
{ {
struct udsl_send_buffer *buf; struct udsl_send_buffer *buf;
int err; int err;
unsigned long flags;
struct udsl_instance_data *instance = (struct udsl_instance_data *) data; struct udsl_instance_data *instance = (struct udsl_instance_data *) data;
unsigned int num_written; unsigned int num_written;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -693,7 +691,7 @@ static void udsl_process_send (unsigned long data) ...@@ -693,7 +691,7 @@ static void udsl_process_send (unsigned long data)
dbg ("udsl_process_send entered"); dbg ("udsl_process_send entered");
made_progress: made_progress:
spin_lock_irqsave (&instance->send_lock, flags); spin_lock_irq (&instance->send_lock);
while (!list_empty (&instance->spare_senders)) { while (!list_empty (&instance->spare_senders)) {
if (!list_empty (&instance->filled_buffers)) { if (!list_empty (&instance->filled_buffers)) {
buf = list_entry (instance->filled_buffers.next, struct udsl_send_buffer, list); buf = list_entry (instance->filled_buffers.next, struct udsl_send_buffer, list);
...@@ -707,7 +705,7 @@ static void udsl_process_send (unsigned long data) ...@@ -707,7 +705,7 @@ static void udsl_process_send (unsigned long data)
snd = list_entry (instance->spare_senders.next, struct udsl_sender, list); snd = list_entry (instance->spare_senders.next, struct udsl_sender, list);
list_del (&snd->list); list_del (&snd->list);
spin_unlock_irqrestore (&instance->send_lock, flags); spin_unlock_irq (&instance->send_lock);
snd->buffer = buf; snd->buffer = buf;
usb_fill_bulk_urb (snd->urb, usb_fill_bulk_urb (snd->urb,
...@@ -722,16 +720,16 @@ static void udsl_process_send (unsigned long data) ...@@ -722,16 +720,16 @@ static void udsl_process_send (unsigned long data)
if ((err = usb_submit_urb(snd->urb, GFP_ATOMIC)) < 0) { if ((err = usb_submit_urb(snd->urb, GFP_ATOMIC)) < 0) {
dbg ("submission failed (%d)!", err); dbg ("submission failed (%d)!", err);
spin_lock_irqsave (&instance->send_lock, flags); spin_lock_irq (&instance->send_lock);
list_add (&snd->list, &instance->spare_senders); list_add (&snd->list, &instance->spare_senders);
spin_unlock_irqrestore (&instance->send_lock, flags); spin_unlock_irq (&instance->send_lock);
list_add (&buf->list, &instance->filled_buffers); list_add (&buf->list, &instance->filled_buffers);
return; return;
} }
spin_lock_irqsave (&instance->send_lock, flags); spin_lock_irq (&instance->send_lock);
} /* while */ } /* while */
spin_unlock_irqrestore (&instance->send_lock, flags); spin_unlock_irq (&instance->send_lock);
if (!instance->current_skb && !(instance->current_skb = skb_dequeue (&instance->sndqueue))) { if (!instance->current_skb && !(instance->current_skb = skb_dequeue (&instance->sndqueue))) {
dbg ("done - no more skbs"); dbg ("done - no more skbs");
...@@ -741,16 +739,16 @@ static void udsl_process_send (unsigned long data) ...@@ -741,16 +739,16 @@ static void udsl_process_send (unsigned long data)
skb = instance->current_skb; skb = instance->current_skb;
if (!(buf = instance->current_buffer)) { if (!(buf = instance->current_buffer)) {
spin_lock_irqsave (&instance->send_lock, flags); spin_lock_irq (&instance->send_lock);
if (list_empty (&instance->spare_buffers)) { if (list_empty (&instance->spare_buffers)) {
instance->current_buffer = NULL; instance->current_buffer = NULL;
spin_unlock_irqrestore (&instance->send_lock, flags); spin_unlock_irq (&instance->send_lock);
dbg ("done - no more buffers"); dbg ("done - no more buffers");
return; return;
} }
buf = list_entry (instance->spare_buffers.next, struct udsl_send_buffer, list); buf = list_entry (instance->spare_buffers.next, struct udsl_send_buffer, list);
list_del (&buf->list); list_del (&buf->list);
spin_unlock_irqrestore (&instance->send_lock, flags); spin_unlock_irq (&instance->send_lock);
buf->free_start = buf->base; buf->free_start = buf->base;
buf->free_cells = UDSL_SND_BUFFER_SIZE; buf->free_cells = UDSL_SND_BUFFER_SIZE;
......
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