Hi!

This adds possibility to select FSBR/noFSBR and DEPTH-first
vs. BREADTH-first.

No FSBR/depth first combination is much more friendly to PCI bus (no
more 5-times slowdowns of system), and still has reasonable
performance.

In this patch I still keep default FSBR/breadth-first, but I'd like to
switch that later. Please apply.
                                                                Pavel

--- clean/drivers/usb/uhci.c    Tue Jun  5 21:38:02 2001
+++ linux/drivers/usb/uhci.c    Mon Jun 11 23:08:01 2001
@@ -85,6 +85,25 @@
 
 #include "uhci-debug.h"
 
+/* CONFIG_USB_UHCI_HIGH_BANDWITH turns on Full Speed Bandwidth 
+ * Reclamation: feature that puts loop on descriptor loop when
+ * there's some transfer going on. With FSBR, USB performance
+ * is optimal, but PCI is slowed down up-to 5 times, slowing down
+ * system performance.
+ */
+#define CONFIG_USB_UHCI_HIGH_BANDWIDTH 1
+/* *_DEPTH_FIRST puts descriptor in depth-first mode. This has 
+ * somehow similar effect to FSBR (higher speed), but does not
+ * slow PCI down. OTOH USB performace is slightly slower than
+ * in FSBR case and single device could hog whole USB, starving
+ * other devices.
+ */
+#define USE_BULK_DEPTH_FIRST 0  // 0: Breadth first, 1: Depth first
+/* Turning off both CONFIG_USB_UHCI_HIGH_BANDWITH and *_DEPTH_FIRST
+ * will lead to 64KB/sec performance over USB, max. You probably
+ * do not want to do that.
+ */
+
 static kmem_cache_t *uhci_up_cachep;   /* urb_priv */
 
 static int rh_submit_urb(struct urb *urb);
@@ -756,7 +775,8 @@
 
        spin_lock_irqsave(&uhci->frame_list_lock, flags);
 
-       if ((!(urb->transfer_flags & USB_NO_FSBR)) && !urbp->fsbr) {
+       if (CONFIG_USB_UHCI_HIGH_BANDWIDTH 
+           && (!(urb->transfer_flags & USB_NO_FSBR)) && !urbp->fsbr) {
                urbp->fsbr = 1;
                if (!uhci->fsbr++)
                        uhci->skel_term_qh->link = 
uhci->skel_hs_control_qh->dma_handle | UHCI_PTR_QH;
@@ -772,7 +792,8 @@
 
        spin_lock_irqsave(&uhci->frame_list_lock, flags);
 
-       if ((!(urb->transfer_flags & USB_NO_FSBR)) && urbp->fsbr) {
+       if (CONFIG_USB_UHCI_HIGH_BANDWIDTH
+           && (!(urb->transfer_flags & USB_NO_FSBR)) && urbp->fsbr) {
                urbp->fsbr = 0;
                if (!--uhci->fsbr)
                        uhci->skel_term_qh->link = UHCI_PTR_TERM;
@@ -1287,7 +1308,7 @@
        qh->urbp = urbp;
 
        /* Always assume breadth first */
-       uhci_insert_tds_in_qh(qh, urb, 1);
+       uhci_insert_tds_in_qh(qh, urb, (!USE_BULK_DEPTH_FIRST));
 
        if (urb->transfer_flags & USB_QUEUE_BULK && eurb)
                uhci_append_queued_urb(uhci, eurb, urb);

-- 
I'm [EMAIL PROTECTED] "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at [EMAIL PROTECTED]

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to