removal of work queue from whiteheat driver

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

 



Hi,

I need somebody to test this patch that removes the work queue
that's now unnecessary.

	Regards
		Oliver

---

commit 66b9169d2b3b6320033642aa9222d91e80747820
Author: Oliver Neukum <oneukum@xxxxxxxxxxxxxxx>
Date:   Wed Apr 15 21:37:59 2009 +0200

    remove work queue from whiteheat driver

diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 5335d32..c4436f2 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -236,7 +236,6 @@ struct whiteheat_private {
 	struct list_head	rx_urbs_free;
 	struct list_head	rx_urbs_submitted;
 	struct list_head	rx_urb_q;
-	struct work_struct	rx_work;
 	struct usb_serial_port	*port;
 	struct list_head	tx_urbs_free;
 	struct list_head	tx_urbs_submitted;
@@ -254,7 +253,7 @@ static int start_port_read(struct usb_serial_port *port);
 static struct whiteheat_urb_wrap *urb_to_wrap(struct urb *urb,
 						struct list_head *head);
 static struct list_head *list_first(struct list_head *head);
-static void rx_data_softint(struct work_struct *work);
+static void push_data(struct whiteheat_private *info);
 
 static int firm_send_command(struct usb_serial_port *port, __u8 command,
 						__u8 *data, __u8 datasize);
@@ -479,7 +478,6 @@ static int whiteheat_attach(struct usb_serial *serial)
 		mutex_init(&info->deathwarrant);
 		info->flags = 0;
 		info->mcr = 0;
-		INIT_WORK(&info->rx_work, rx_data_softint);
 		info->port = port;
 
 		INIT_LIST_HEAD(&info->rx_urbs_free);
@@ -671,9 +669,6 @@ static int whiteheat_open(struct tty_struct *tty,
 	if (retval)
 		goto exit;
 
-	if (tty)
-		tty->low_latency = 1;
-
 	/* send an open port command */
 	retval = firm_open(port);
 	if (retval) {
@@ -1006,7 +1001,7 @@ static void whiteheat_unthrottle(struct tty_struct *tty)
 	spin_unlock_irqrestore(&info->lock, flags);
 
 	if (actually_throttled)
-		rx_data_softint(&info->rx_work);
+		push_data(info);
 
 	return;
 }
@@ -1122,7 +1117,7 @@ static void whiteheat_read_callback(struct urb *urb)
 	}
 	spin_unlock(&info->lock);
 
-	schedule_work(&info->rx_work);
+	push_data(info);
 }
 
 
@@ -1497,10 +1492,8 @@ static struct list_head *list_first(struct list_head 
*head)
 }
 
 
-static void rx_data_softint(struct work_struct *work)
+static void push_data(struct whiteheat_private *info)
 {
-	struct whiteheat_private *info =
-		container_of(work, struct whiteheat_private, rx_work);
 	struct usb_serial_port *port = info->port;
 	struct tty_struct *tty = tty_port_tty_get(&port->port);
 	struct whiteheat_urb_wrap *wrap;
@@ -1527,13 +1520,11 @@ static void rx_data_softint(struct work_struct *work)
 		if (tty && urb->actual_length) {
 			int len = tty_buffer_request_room(tty,
 							urb->actual_length);
-			/* This stuff can go away now I suspect */
+
 			if (unlikely(len < urb->actual_length)) {
 				spin_lock_irqsave(&info->lock, flags);
 				list_add(tmp, &info->rx_urb_q);
 				spin_unlock_irqrestore(&info->lock, flags);
-				tty_flip_buffer_push(tty);
-				schedule_work(&info->rx_work);
 				goto out;
 			}
 			tty_insert_flip_string(tty, urb->transfer_buffer, len);

--
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