Commit 94f991d0 authored by Johannes Erdfelt's avatar Johannes Erdfelt Committed by Greg Kroah-Hartman

uhci.c, speed improvements

Basically, the patch turns switching off FSBR into a lazy operation with
the assumption there will be another transfer shortly afterwards. This
works wonders for usb-storage for instance.
parent 29b78b5a
......@@ -53,11 +53,11 @@
#include <asm/irq.h>
#include <asm/system.h>
#include "hcd.h"
#include "uhci.h"
#include <linux/pm.h>
/*
* Version Information
*/
......@@ -65,7 +65,6 @@
#define DRIVER_AUTHOR "Linus 'Frodo Rabbit' Torvalds, Johannes Erdfelt, Randy Dunlap, Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber"
#define DRIVER_DESC "USB Universal Host Controller Interface driver"
/*
* debug = 0, no debugging messages
* debug = 1, dump failed URB's except for stalls
......@@ -100,6 +99,7 @@ static void wakeup_hc(struct uhci *uhci);
/* If a transfer is still active after this much time, turn off FSBR */
#define IDLE_TIMEOUT (HZ / 20) /* 50 ms */
#define FSBR_DELAY (HZ / 20) /* 50 ms */
#define MAX_URB_LOOP 2048 /* Maximum number of linked URB's */
......@@ -766,7 +766,7 @@ static void uhci_dec_fsbr(struct uhci *uhci, struct urb *urb)
if ((!(urb->transfer_flags & USB_NO_FSBR)) && urbp->fsbr) {
urbp->fsbr = 0;
if (!--uhci->fsbr)
uhci->skel_term_qh->link = UHCI_PTR_TERM;
uhci->fsbrtimeout = jiffies + FSBR_DELAY;
}
spin_unlock_irqrestore(&uhci->frame_list_lock, flags);
......@@ -2031,6 +2031,12 @@ static void rh_int_timer_do(unsigned long ptr)
uhci_unlink_urb(u);
}
/* Really disable FSBR */
if (!uhci->fsbr && uhci->fsbrtimeout && time_after_eq(jiffies, uhci->fsbrtimeout)) {
uhci->fsbrtimeout = 0;
uhci->skel_term_qh->link = UHCI_PTR_TERM;
}
/* enter global suspend if nothing connected */
if (!uhci->is_suspended && !ports_active(uhci))
suspend_hc(uhci);
......
......@@ -309,6 +309,7 @@ struct uhci {
spinlock_t frame_list_lock;
struct uhci_frame_list *fl; /* P: uhci->frame_list_lock */
int fsbr; /* Full speed bandwidth reclamation */
unsigned long fsbrtimeout; /* FSBR delay */
int is_suspended;
/* Main list of URB's currently controlled by this HC */
......
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