linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]  usb: gadget: USB3 support to the legacy printer driver
@ 2014-11-17 23:19 Jorge Ramirez-Ortiz
  2014-11-18  0:30 ` Felipe Balbi
  0 siblings, 1 reply; 14+ messages in thread
From: Jorge Ramirez-Ortiz @ 2014-11-17 23:19 UTC (permalink / raw)
  To: linux-usb, linux-kernel

Hi,

This patch adds USB3 support to the legacy gadget printer driver.
Applies cleanly on fc14f9c Linux 3.18-rc5.

Please could it be considered for inclusion?

regards,
Jorge



>From f46d9b0d2160b30f14dee104657de865e9e2bc38 Mon Sep 17 00:00:00 2001
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Date: Thu, 25 Sep 2014 16:17:20 -0400
Subject: [PATCH] usb: gadget: add USB3 support to the printer driver

Add SS descriptors to support the capabilities provided by USB3 controller
drivers; unit tests run using PLX 3380 [max transfer speed measured of 1Gbps]

This driver will fallback to lower operating modes when the higher ones are
not available.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
---
 drivers/usb/gadget/legacy/printer.c | 66 +++++++++++++++++++++++++++++++++----
 1 file changed, 60 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
index 6474081..625d905 100644
--- a/drivers/usb/gadget/legacy/printer.c
+++ b/drivers/usb/gadget/legacy/printer.c
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2003-2005 David Brownell
  * Copyright (C) 2006 Craig W. Nadler
+ * Copyright (C) 2014 Linaro.org
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -208,6 +209,43 @@ static struct usb_descriptor_header *hs_printer_function[] = {
        NULL
 };
 
+/*
+ * Added endpoint descriptors for 3.0 devices
+ */
+
+static struct usb_endpoint_descriptor ss_ep_in_desc = {
+       .bLength =              USB_DT_ENDPOINT_SIZE,
+       .bDescriptorType =      USB_DT_ENDPOINT,
+       .bmAttributes =         USB_ENDPOINT_XFER_BULK,
+       .wMaxPacketSize =       cpu_to_le16(1024),
+};
+
+struct usb_ss_ep_comp_descriptor ss_ep_in_comp_desc = {
+       .bLength =              sizeof(ss_ep_in_comp_desc),
+       .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
+};
+
+static struct usb_endpoint_descriptor ss_ep_out_desc = {
+       .bLength =              USB_DT_ENDPOINT_SIZE,
+       .bDescriptorType =      USB_DT_ENDPOINT,
+       .bmAttributes =         USB_ENDPOINT_XFER_BULK,
+       .wMaxPacketSize =       cpu_to_le16(1024),
+};
+
+struct usb_ss_ep_comp_descriptor ss_ep_out_comp_desc = {
+       .bLength =              sizeof(ss_ep_out_comp_desc),
+       .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
+};
+
+static struct usb_descriptor_header *ss_printer_function[] = {
+       (struct usb_descriptor_header *) &intf_desc,
+       (struct usb_descriptor_header *) &ss_ep_in_desc,
+       (struct usb_descriptor_header *) &ss_ep_in_comp_desc,
+       (struct usb_descriptor_header *) &ss_ep_out_desc,
+       (struct usb_descriptor_header *) &ss_ep_out_comp_desc,
+       NULL
+};
+
 static struct usb_otg_descriptor otg_descriptor = {
        .bLength =              sizeof otg_descriptor,
        .bDescriptorType =      USB_DT_OTG,
@@ -220,7 +258,20 @@ static const struct usb_descriptor_header *otg_desc[] = {
 };
 
 /* maxpacket and other transfer characteristics vary by speed. */
-#define ep_desc(g, hs, fs) (((g)->speed == USB_SPEED_HIGH)?(hs):(fs))
+static inline struct usb_endpoint_descriptor *ep_desc(struct usb_gadget *gadget,
+                                       struct usb_endpoint_descriptor *fs,
+                                       struct usb_endpoint_descriptor *hs,
+                                       struct usb_endpoint_descriptor *ss)
+{
+       struct usb_endpoint_descriptor *d = fs;
+
+       if (gadget->speed == USB_SPEED_SUPER)
+               d = ss;
+       else if (gadget->speed == USB_SPEED_HIGH)
+               d = hs;
+
+       return d;
+}
 
 /*-------------------------------------------------------------------------*/
 
@@ -793,11 +844,12 @@ set_printer_interface(struct printer_dev *dev)
 {
        int                     result = 0;
 
-       dev->in_ep->desc = ep_desc(dev->gadget, &hs_ep_in_desc, &fs_ep_in_desc);
+       dev->in_ep->desc = ep_desc(dev->gadget, &fs_ep_in_desc, &hs_ep_in_desc,
+                                                               &ss_ep_in_desc);
        dev->in_ep->driver_data = dev;
 
-       dev->out_ep->desc = ep_desc(dev->gadget, &hs_ep_out_desc,
-                                   &fs_ep_out_desc);
+       dev->out_ep->desc = ep_desc(dev->gadget, &fs_ep_out_desc,
+                                       &hs_ep_out_desc, &ss_ep_out_desc);
        dev->out_ep->driver_data = dev;
 
        result = usb_ep_enable(dev->in_ep);
@@ -1016,9 +1068,11 @@ autoconf_fail:
        /* assumes that all endpoints are dual-speed */
        hs_ep_in_desc.bEndpointAddress = fs_ep_in_desc.bEndpointAddress;
        hs_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress;
+       ss_ep_in_desc.bEndpointAddress = fs_ep_in_desc.bEndpointAddress;
+       ss_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress;
 
        ret = usb_assign_descriptors(f, fs_printer_function,
-                       hs_printer_function, NULL);
+                                    hs_printer_function, ss_printer_function);
        if (ret)
                return ret;
 
@@ -1253,7 +1307,7 @@ static __refdata struct usb_composite_driver printer_driver = {
        .name           = shortname,
        .dev            = &device_desc,
        .strings        = dev_strings,
-       .max_speed      = USB_SPEED_HIGH,
+       .max_speed      = USB_SPEED_SUPER,
        .bind           = printer_bind,
        .unbind         = printer_unbind,
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-17 23:19 [PATCH] usb: gadget: USB3 support to the legacy printer driver Jorge Ramirez-Ortiz
@ 2014-11-18  0:30 ` Felipe Balbi
  2014-11-18  0:54   ` Greg KH
  2014-11-18 14:19   ` Jorge Ramirez-Ortiz
  0 siblings, 2 replies; 14+ messages in thread
From: Felipe Balbi @ 2014-11-18  0:30 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz, Greg KH; +Cc: linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 5198 bytes --]

Hi,

On Mon, Nov 17, 2014 at 06:19:54PM -0500, Jorge Ramirez-Ortiz wrote:
> Hi,
> 
> This patch adds USB3 support to the legacy gadget printer driver.
> Applies cleanly on fc14f9c Linux 3.18-rc5.
> 
> Please could it be considered for inclusion?

sure, if you send it properly (see Documentation/SubmittingPatches),
provide logs of your tests with a recent kernel (v3.18-rc5 would be just
awesome) and Cc myself on your resubmission.

> diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
> index 6474081..625d905 100644
> --- a/drivers/usb/gadget/legacy/printer.c
> +++ b/drivers/usb/gadget/legacy/printer.c
> @@ -3,6 +3,7 @@
>   *
>   * Copyright (C) 2003-2005 David Brownell
>   * Copyright (C) 2006 Craig W. Nadler
> + * Copyright (C) 2014 Linaro.org

I don't think the minimal change below constitutes enough to merit the
copyright. If your lawyers tell you otherwise, let me know.

Greg, what's Linux Foundation's lawyers take on this ?

> @@ -208,6 +209,43 @@ static struct usb_descriptor_header *hs_printer_function[] = {
>         NULL
>  };
>  
> +/*
> + * Added endpoint descriptors for 3.0 devices
> + */
> +
> +static struct usb_endpoint_descriptor ss_ep_in_desc = {
> +       .bLength =              USB_DT_ENDPOINT_SIZE,
> +       .bDescriptorType =      USB_DT_ENDPOINT,
> +       .bmAttributes =         USB_ENDPOINT_XFER_BULK,
> +       .wMaxPacketSize =       cpu_to_le16(1024),
> +};
> +
> +struct usb_ss_ep_comp_descriptor ss_ep_in_comp_desc = {
> +       .bLength =              sizeof(ss_ep_in_comp_desc),
> +       .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
> +};
> +
> +static struct usb_endpoint_descriptor ss_ep_out_desc = {
> +       .bLength =              USB_DT_ENDPOINT_SIZE,
> +       .bDescriptorType =      USB_DT_ENDPOINT,
> +       .bmAttributes =         USB_ENDPOINT_XFER_BULK,
> +       .wMaxPacketSize =       cpu_to_le16(1024),
> +};
> +
> +struct usb_ss_ep_comp_descriptor ss_ep_out_comp_desc = {
> +       .bLength =              sizeof(ss_ep_out_comp_desc),
> +       .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
> +};
> +
> +static struct usb_descriptor_header *ss_printer_function[] = {
> +       (struct usb_descriptor_header *) &intf_desc,
> +       (struct usb_descriptor_header *) &ss_ep_in_desc,
> +       (struct usb_descriptor_header *) &ss_ep_in_comp_desc,
> +       (struct usb_descriptor_header *) &ss_ep_out_desc,
> +       (struct usb_descriptor_header *) &ss_ep_out_comp_desc,
> +       NULL
> +};
> +
>  static struct usb_otg_descriptor otg_descriptor = {
>         .bLength =              sizeof otg_descriptor,
>         .bDescriptorType =      USB_DT_OTG,
> @@ -220,7 +258,20 @@ static const struct usb_descriptor_header *otg_desc[] = {
>  };
>  
>  /* maxpacket and other transfer characteristics vary by speed. */
> -#define ep_desc(g, hs, fs) (((g)->speed == USB_SPEED_HIGH)?(hs):(fs))
> +static inline struct usb_endpoint_descriptor *ep_desc(struct usb_gadget *gadget,
> +                                       struct usb_endpoint_descriptor *fs,
> +                                       struct usb_endpoint_descriptor *hs,
> +                                       struct usb_endpoint_descriptor *ss)
> +{
> +       struct usb_endpoint_descriptor *d = fs;
> +
> +       if (gadget->speed == USB_SPEED_SUPER)
> +               d = ss;
> +       else if (gadget->speed == USB_SPEED_HIGH)
> +               d = hs;

what happened to good old switch ?

> +       return d;
> +}
>  
>  /*-------------------------------------------------------------------------*/
>  
> @@ -793,11 +844,12 @@ set_printer_interface(struct printer_dev *dev)
>  {
>         int                     result = 0;
>  
> -       dev->in_ep->desc = ep_desc(dev->gadget, &hs_ep_in_desc, &fs_ep_in_desc);
> +       dev->in_ep->desc = ep_desc(dev->gadget, &fs_ep_in_desc, &hs_ep_in_desc,
> +                                                               &ss_ep_in_desc);

Fix your indentation.

>         dev->in_ep->driver_data = dev;
>  
> -       dev->out_ep->desc = ep_desc(dev->gadget, &hs_ep_out_desc,
> -                                   &fs_ep_out_desc);
> +       dev->out_ep->desc = ep_desc(dev->gadget, &fs_ep_out_desc,
> +                                       &hs_ep_out_desc, &ss_ep_out_desc);
>         dev->out_ep->driver_data = dev;
>  
>         result = usb_ep_enable(dev->in_ep);
> @@ -1016,9 +1068,11 @@ autoconf_fail:
>         /* assumes that all endpoints are dual-speed */
>         hs_ep_in_desc.bEndpointAddress = fs_ep_in_desc.bEndpointAddress;
>         hs_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress;
> +       ss_ep_in_desc.bEndpointAddress = fs_ep_in_desc.bEndpointAddress;
> +       ss_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress;
>  
>         ret = usb_assign_descriptors(f, fs_printer_function,
> -                       hs_printer_function, NULL);
> +                                    hs_printer_function, ss_printer_function);

why do you change indentation when adding just one extra argument ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18  0:30 ` Felipe Balbi
@ 2014-11-18  0:54   ` Greg KH
  2014-11-18  1:14     ` Jorge Ramirez-Ortiz
  2014-11-18 14:19   ` Jorge Ramirez-Ortiz
  1 sibling, 1 reply; 14+ messages in thread
From: Greg KH @ 2014-11-18  0:54 UTC (permalink / raw)
  To: Felipe Balbi, Jorge Ramirez-Ortiz; +Cc: linux-usb, linux-kernel

On Mon, Nov 17, 2014 at 06:30:28PM -0600, Felipe Balbi wrote:
> Hi,
> 
> On Mon, Nov 17, 2014 at 06:19:54PM -0500, Jorge Ramirez-Ortiz wrote:
> > Hi,
> > 
> > This patch adds USB3 support to the legacy gadget printer driver.
> > Applies cleanly on fc14f9c Linux 3.18-rc5.
> > 
> > Please could it be considered for inclusion?
> 
> sure, if you send it properly (see Documentation/SubmittingPatches),
> provide logs of your tests with a recent kernel (v3.18-rc5 would be just
> awesome) and Cc myself on your resubmission.
> 
> > diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
> > index 6474081..625d905 100644
> > --- a/drivers/usb/gadget/legacy/printer.c
> > +++ b/drivers/usb/gadget/legacy/printer.c
> > @@ -3,6 +3,7 @@
> >   *
> >   * Copyright (C) 2003-2005 David Brownell
> >   * Copyright (C) 2006 Craig W. Nadler
> > + * Copyright (C) 2014 Linaro.org
> 
> I don't think the minimal change below constitutes enough to merit the
> copyright. If your lawyers tell you otherwise, let me know.
> 
> Greg, what's Linux Foundation's lawyers take on this ?

I'm not going to speak for the Linux Foundation here (we have no
in-house lawyers), but I have been advised that you need to modify/add
at least 1/3 of the file before you can add your copyright notice to a
file.  That's the rule I go by, and numerous lawyers I have asked about
this say it is a safe rule to follow.

Linaro should also be following those rules, last I checked with them,
so Jorge, you should go back and ask for clarification.

But then there's the issue that copyright notices in files really don't
mean anything, but I'm not going to get into that discussion right now :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18  0:54   ` Greg KH
@ 2014-11-18  1:14     ` Jorge Ramirez-Ortiz
  0 siblings, 0 replies; 14+ messages in thread
From: Jorge Ramirez-Ortiz @ 2014-11-18  1:14 UTC (permalink / raw)
  To: Greg KH, Felipe Balbi; +Cc: linux-usb, linux-kernel

On 11/17/2014 07:54 PM, Greg KH wrote:
> On Mon, Nov 17, 2014 at 06:30:28PM -0600, Felipe Balbi wrote:
>> Hi,
>>
>> On Mon, Nov 17, 2014 at 06:19:54PM -0500, Jorge Ramirez-Ortiz wrote:
>>> Hi,
>>>
>>> This patch adds USB3 support to the legacy gadget printer driver.
>>> Applies cleanly on fc14f9c Linux 3.18-rc5.
>>>
>>> Please could it be considered for inclusion?
>> sure, if you send it properly (see Documentation/SubmittingPatches),
>> provide logs of your tests with a recent kernel (v3.18-rc5 would be just
>> awesome) and Cc myself on your resubmission.
>>
>>> diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
>>> index 6474081..625d905 100644
>>> --- a/drivers/usb/gadget/legacy/printer.c
>>> +++ b/drivers/usb/gadget/legacy/printer.c
>>> @@ -3,6 +3,7 @@
>>>   *
>>>   * Copyright (C) 2003-2005 David Brownell
>>>   * Copyright (C) 2006 Craig W. Nadler
>>> + * Copyright (C) 2014 Linaro.org
>> I don't think the minimal change below constitutes enough to merit the
>> copyright. If your lawyers tell you otherwise, let me know.
>>
>> Greg, what's Linux Foundation's lawyers take on this ?
> I'm not going to speak for the Linux Foundation here (we have no
> in-house lawyers), but I have been advised that you need to modify/add
> at least 1/3 of the file before you can add your copyright notice to a
> file.  That's the rule I go by, and numerous lawyers I have asked about
> this say it is a safe rule to follow.
>
> Linaro should also be following those rules, last I checked with them,
> so Jorge, you should go back and ask for clarification.

Yes, let's drop the copyright - my fault.

>
> But then there's the issue that copyright notices in files really don't
> mean anything, but I'm not going to get into that discussion right now :)
>
> thanks,
>
> greg k-h


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18  0:30 ` Felipe Balbi
  2014-11-18  0:54   ` Greg KH
@ 2014-11-18 14:19   ` Jorge Ramirez-Ortiz
  2014-11-18 15:17     ` Felipe Balbi
  1 sibling, 1 reply; 14+ messages in thread
From: Jorge Ramirez-Ortiz @ 2014-11-18 14:19 UTC (permalink / raw)
  To: balbi, Greg KH; +Cc: linux-usb, linux-kernel

Hi Felipe/Greg

Thanks for your comments on my previous attempt.
I think I addressed them here.
I added some logs of a run captured on a recent kernel, fixed the indentations,
replaced the if/else with a switch statement and removed the copyright.

Note that the tests seem to indicate a performance issue on the net2280 driver: the
exact same tests using the usb338x.c driver from PLX allows for transfer speeds of 1Gbps.

cheers
Jorge

File transfer test using g_printer on 10b5:3380
================================================

The host will transfer a file to the device using the g_printer driver.

0) enable the net2280 on the g_printer:
--------------------------------------

        From 8e306693839a77bfe3411a842d4d20acb9dae9e3 Mon Sep 17 00:00:00 2001
        From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
        Date: Mon, 17 Nov 2014 22:31:59 -0500
        Subject: [PATCH] use the 338x
      
        ---
         drivers/usb/gadget/legacy/printer.c | 4 ++--
         1 file changed, 2 insertions(+), 2 deletions(-)
      
       diff --git a/drivers/usb/gadget/legacy/printer.c
b/drivers/usb/gadget/legacy/printer.c
       index 456730b..ba919a0 100644
       --- a/drivers/usb/gadget/legacy/printer.c
       +++ b/drivers/usb/gadget/legacy/printer.c
       @@ -99,8 +99,8 @@ static struct printer_dev usb_printer_gadget;
      
        /* Thanks to NetChip Technologies for donating this product ID.
         */
       -#define PRINTER_VENDOR_NUM     0x0525          /* NetChip */
       -#define PRINTER_PRODUCT_NUM    0xa4a8          /* Linux-USB Printer Gadget */
       +#define PRINTER_VENDOR_NUM     0x10B5        
       +#define PRINTER_PRODUCT_NUM    0x3380        
      
        /* Some systems will want different product identifiers published in the
         * device descriptor, either numbers or strings or both.  These string
       --
       1.9.1


1) Host logs:
-------------

[jramirez@miro ~]$ lsusb
Bus 002 Device 006: ID 05ac:1303 Apple, Inc. iPod Shuffle 4.Gen
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 007: ID 10b5:3380 Comodo (PLX?)
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232
USB-Serial (UART) IC
Bus 001 Device 003: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

[jramirez@miro ~]$ lsusb -s 004:007 -v

Bus 004 Device 007: ID 10b5:3380 Comodo (PLX?)
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         9
  idVendor           0x10b5 Comodo (PLX?)
  idProduct          0x3380
  bcdDevice            3.18
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           44
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         7 Printer
      bInterfaceSubClass      1 Printer
      bInterfaceProtocol      2 Bidirectional
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0

 
[jramirez@miro host.git (master%)]$ sudo ./usbhost file.wav
[sudo] password for jramirez:
Opening device 10B5:3380...

Device properties:
        bus number: 4
         port path: 2 (from root hub)
 device speed: 5000 Mbit/s (USB SuperSpeed)

Reading device descriptor:
            length: 18
      device class: 0
               S/N: 3
           VID:PID: 10B5:3380
         bcdDevice: 0318
   iMan:iProd:iSer: 1:2:3
          nb confs: 1

Reading BOS descriptor: 2 caps
    USB 2.0 extension:
      attributes             : 06
    USB 3.0 capabilities:
      attributes             : 00
      supported speeds       : 000F
      supported functionality: 01

Reading first configuration descriptor:
             nb interfaces: 1
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 07.01.02
       endpoint[0].address: 81
           max packet size: 0400
          polling interval: 00
                 max burst: 00   (USB 3.0)
        bytes per interval: 0000 (USB 3.0)
       endpoint[1].address: 01
           max packet size: 0400
          polling interval: 00
                 max burst: 00   (USB 3.0)
        bytes per interval: 0000 (USB 3.0)

Claiming interface 0...

Reading string descriptors:
   String (0x01): "Linux 3.18.0-rc5+ with net2280"
   String (0x02): "Printer Gadget"
Transfering: endpoint_out 1, size 61387314
 - number of bulk transfers : 7494
 - max user transfer size   : 8192 bytes
 - max usb transfer size    : 1024 bytes

2) Device Logs:
--------------

[jramirez@dali ~]$ cat /proc/version
Linux version 3.18.0-rc5+ (jramirez@localhost.localdomain) (gcc version 4.8.3
20140911 (Red Hat 4.8.3-7) (GCC) ) #1 SMP Mon Nov 17 21:59:22 EST 2014


[   72.345683] net2280 0000:02:00.0: usb_reset_338x: Defect 7374 FsmValue 0xf0000000
[   72.345706] net2280 0000:02:00.0: usb_reinit_338x: Defect 7374 FsmValue f0000000
[   72.345748] net2280 0000:02:00.0: irq 35 for MSI/MSI-X
[   72.345798] net2280 0000:02:00.0: PLX NET228x/USB338x USB Peripheral Controller
[   72.345801] net2280 0000:02:00.0: irq 35, pci mem ffffc90004960000, chip rev 00ab
[   72.345803] net2280 0000:02:00.0: version: 2005 Sept 27/v3.0; dma enabled legacy mode
[   86.630589] printer gadget: Printer Gadget, version: 2007 OCT 06
[   86.630593] printer gadget: printer ready
[   86.630599] net2280 0000:02:00.0: Operate Defect 7374 workaround soft this time
[   86.630600] net2280 0000:02:00.0: It will operate on cold-reboot and SS connect
[   86.630709] net2280 0000:02:00.0: ep0_start_338x: Defect 7374 FsmValue 10000000
[   86.870669] net2280 0000:02:00.0: INFO: Defect 7374 workaround waited about
[   86.875065] printer gadget: super-speed config #1: printer
[   86.875077] printer gadget: Using interface 0


[jramirez@dali device.git (master%)]$ sudo ./usbdevice
Receiving file

Transfer rate => 462 Mbits/sec [57MB/sec]
 - file size : 58 MB
 - time      : 1.12 sec


As mentioned above, using the usb338x driver from PLX instead of the net2280 from
kernel.org, the effective file transfer rate increases 1Gbps.


3) Patch:
---------



>From 9b5ee9330c5c02cf51328c350036c1dac998b732 Mon Sep 17 00:00:00 2001
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Date: Thu, 25 Sep 2014 16:17:20 -0400
Subject: [PATCH 2/3] usb: gadget: add USB3 support to the printer driver

Add SS descriptors to support the capabilities provided by USB3 controller
drivers; unit tests run using a PLX 3380 [max transfer speed measured of 1Gbps]

This driver shall fallback to lower operating modes when the higher ones are
not available.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
---
 drivers/usb/gadget/legacy/printer.c | 65 +++++++++++++++++++++++++++++++++----
 1 file changed, 59 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
index 6474081..456730b 100644
--- a/drivers/usb/gadget/legacy/printer.c
+++ b/drivers/usb/gadget/legacy/printer.c
@@ -208,6 +208,43 @@ static struct usb_descriptor_header *hs_printer_function[] = {
     NULL
 };
 
+/*
+ * Added endpoint descriptors for 3.0 devices
+ */
+
+static struct usb_endpoint_descriptor ss_ep_in_desc = {
+    .bLength =              USB_DT_ENDPOINT_SIZE,
+    .bDescriptorType =      USB_DT_ENDPOINT,
+    .bmAttributes =         USB_ENDPOINT_XFER_BULK,
+    .wMaxPacketSize =       cpu_to_le16(1024),
+};
+
+struct usb_ss_ep_comp_descriptor ss_ep_in_comp_desc = {
+    .bLength =              sizeof(ss_ep_in_comp_desc),
+    .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
+};
+
+static struct usb_endpoint_descriptor ss_ep_out_desc = {
+    .bLength =              USB_DT_ENDPOINT_SIZE,
+    .bDescriptorType =      USB_DT_ENDPOINT,
+    .bmAttributes =         USB_ENDPOINT_XFER_BULK,
+    .wMaxPacketSize =       cpu_to_le16(1024),
+};
+
+struct usb_ss_ep_comp_descriptor ss_ep_out_comp_desc = {
+    .bLength =              sizeof(ss_ep_out_comp_desc),
+    .bDescriptorType =      USB_DT_SS_ENDPOINT_COMP,
+};
+
+static struct usb_descriptor_header *ss_printer_function[] = {
+    (struct usb_descriptor_header *) &intf_desc,
+    (struct usb_descriptor_header *) &ss_ep_in_desc,
+    (struct usb_descriptor_header *) &ss_ep_in_comp_desc,
+    (struct usb_descriptor_header *) &ss_ep_out_desc,
+    (struct usb_descriptor_header *) &ss_ep_out_comp_desc,
+    NULL
+};
+
 static struct usb_otg_descriptor otg_descriptor = {
     .bLength =              sizeof otg_descriptor,
     .bDescriptorType =      USB_DT_OTG,
@@ -220,7 +257,20 @@ static const struct usb_descriptor_header *otg_desc[] = {
 };
 
 /* maxpacket and other transfer characteristics vary by speed. */
-#define ep_desc(g, hs, fs) (((g)->speed == USB_SPEED_HIGH)?(hs):(fs))
+static inline struct usb_endpoint_descriptor *ep_desc(struct usb_gadget *gadget,
+                    struct usb_endpoint_descriptor *fs,
+                    struct usb_endpoint_descriptor *hs,
+                    struct usb_endpoint_descriptor *ss)
+{
+    switch(gadget->speed) {
+    case USB_SPEED_SUPER:
+        return ss;
+    case USB_SPEED_HIGH:
+        return hs;
+    default:
+        return fs;
+    }
+}
 
 /*-------------------------------------------------------------------------*/
 
@@ -793,11 +843,12 @@ set_printer_interface(struct printer_dev *dev)
 {
     int            result = 0;
 
-    dev->in_ep->desc = ep_desc(dev->gadget, &hs_ep_in_desc, &fs_ep_in_desc);
+    dev->in_ep->desc = ep_desc(dev->gadget, &fs_ep_in_desc, &hs_ep_in_desc,
+                &ss_ep_in_desc);
     dev->in_ep->driver_data = dev;
 
-    dev->out_ep->desc = ep_desc(dev->gadget, &hs_ep_out_desc,
-                    &fs_ep_out_desc);
+    dev->out_ep->desc = ep_desc(dev->gadget, &fs_ep_out_desc,
+                    &hs_ep_out_desc, &ss_ep_out_desc);
     dev->out_ep->driver_data = dev;
 
     result = usb_ep_enable(dev->in_ep);
@@ -1016,9 +1067,11 @@ autoconf_fail:
     /* assumes that all endpoints are dual-speed */
     hs_ep_in_desc.bEndpointAddress = fs_ep_in_desc.bEndpointAddress;
     hs_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress;
+    ss_ep_in_desc.bEndpointAddress = fs_ep_in_desc.bEndpointAddress;
+    ss_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress;
 
     ret = usb_assign_descriptors(f, fs_printer_function,
-            hs_printer_function, NULL);
+            hs_printer_function, ss_printer_function);
     if (ret)
         return ret;
 
@@ -1253,7 +1306,7 @@ static __refdata struct usb_composite_driver printer_driver = {
     .name           = shortname,
     .dev            = &device_desc,
     .strings        = dev_strings,
-    .max_speed      = USB_SPEED_HIGH,
+    .max_speed      = USB_SPEED_SUPER,
     .bind        = printer_bind,
     .unbind        = printer_unbind,
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 14:19   ` Jorge Ramirez-Ortiz
@ 2014-11-18 15:17     ` Felipe Balbi
  2014-11-18 17:52       ` Jorge Ramirez-Ortiz
  0 siblings, 1 reply; 14+ messages in thread
From: Felipe Balbi @ 2014-11-18 15:17 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz; +Cc: balbi, Greg KH, linux-usb, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 10553 bytes --]

Hi,

On Tue, Nov 18, 2014 at 09:19:36AM -0500, Jorge Ramirez-Ortiz wrote:
> Hi Felipe/Greg
> 
> Thanks for your comments on my previous attempt.
> I think I addressed them here.

no you haven't. Read Documentation/SubmittingPatches, read the mailing
list archives and you'll see your basic mistake.

> I added some logs of a run captured on a recent kernel, fixed the indentations,
> replaced the if/else with a switch statement and removed the copyright.
> 
> Note that the tests seem to indicate a performance issue on the net2280 driver: the
> exact same tests using the usb338x.c driver from PLX allows for transfer speeds of 1Gbps.
> 
> cheers
> Jorge
> 
> File transfer test using g_printer on 10b5:3380
> ================================================
> 
> The host will transfer a file to the device using the g_printer driver.
> 
> 0) enable the net2280 on the g_printer:
> --------------------------------------
> 
>         From 8e306693839a77bfe3411a842d4d20acb9dae9e3 Mon Sep 17 00:00:00 2001
>         From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>         Date: Mon, 17 Nov 2014 22:31:59 -0500
>         Subject: [PATCH] use the 338x
>       
>         ---
>          drivers/usb/gadget/legacy/printer.c | 4 ++--
>          1 file changed, 2 insertions(+), 2 deletions(-)
>       
>        diff --git a/drivers/usb/gadget/legacy/printer.c
> b/drivers/usb/gadget/legacy/printer.c
>        index 456730b..ba919a0 100644
>        --- a/drivers/usb/gadget/legacy/printer.c
>        +++ b/drivers/usb/gadget/legacy/printer.c
>        @@ -99,8 +99,8 @@ static struct printer_dev usb_printer_gadget;
>       
>         /* Thanks to NetChip Technologies for donating this product ID.
>          */
>        -#define PRINTER_VENDOR_NUM     0x0525          /* NetChip */
>        -#define PRINTER_PRODUCT_NUM    0xa4a8          /* Linux-USB Printer Gadget */
>        +#define PRINTER_VENDOR_NUM     0x10B5        
>        +#define PRINTER_PRODUCT_NUM    0x3380        

you have no clue what these mean, do you ? How about reading the USB
specification of even http://www.beyondlogic.org/usbnutshell/usb1.shtml

Changing these will not cause you to use usb338x driver, you're just
using a vendor/product ID you don't own.

>       
>         /* Some systems will want different product identifiers published in the
>          * device descriptor, either numbers or strings or both.  These string
>        --
>        1.9.1
> 
> 
> 1) Host logs:
> -------------
> 
> [jramirez@miro ~]$ lsusb
> Bus 002 Device 006: ID 05ac:1303 Apple, Inc. iPod Shuffle 4.Gen
> Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
> Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 004 Device 007: ID 10b5:3380 Comodo (PLX?)
> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232
> USB-Serial (UART) IC
> Bus 001 Device 003: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
> Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> 
> [jramirez@miro ~]$ lsusb -s 004:007 -v
> 
> Bus 004 Device 007: ID 10b5:3380 Comodo (PLX?)
> Couldn't open device, some information will be missing
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               3.00
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0         9
>   idVendor           0x10b5 Comodo (PLX?)
>   idProduct          0x3380
>   bcdDevice            3.18
>   iManufacturer           1
>   iProduct                2
>   iSerial                 3
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           44
>     bNumInterfaces          1
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0xc0
>       Self Powered
>     MaxPower                2mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass         7 Printer
>       bInterfaceSubClass      1 Printer
>       bInterfaceProtocol      2 Bidirectional
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0400  1x 1024 bytes
>         bInterval               0
>         bMaxBurst               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x01  EP 1 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0400  1x 1024 bytes
>         bInterval               0
>         bMaxBurst               0
> 
>  
> [jramirez@miro host.git (master%)]$ sudo ./usbhost file.wav
> [sudo] password for jramirez:
> Opening device 10B5:3380...
> 
> Device properties:
>         bus number: 4
>          port path: 2 (from root hub)
>  device speed: 5000 Mbit/s (USB SuperSpeed)
> 
> Reading device descriptor:
>             length: 18
>       device class: 0
>                S/N: 3
>            VID:PID: 10B5:3380
>          bcdDevice: 0318
>    iMan:iProd:iSer: 1:2:3
>           nb confs: 1
> 
> Reading BOS descriptor: 2 caps
>     USB 2.0 extension:
>       attributes             : 06
>     USB 3.0 capabilities:
>       attributes             : 00
>       supported speeds       : 000F
>       supported functionality: 01
> 
> Reading first configuration descriptor:
>              nb interfaces: 1
>               interface[0]: id = 0
> interface[0].altsetting[0]: num endpoints = 2
>    Class.SubClass.Protocol: 07.01.02
>        endpoint[0].address: 81
>            max packet size: 0400
>           polling interval: 00
>                  max burst: 00   (USB 3.0)
>         bytes per interval: 0000 (USB 3.0)
>        endpoint[1].address: 01
>            max packet size: 0400
>           polling interval: 00
>                  max burst: 00   (USB 3.0)
>         bytes per interval: 0000 (USB 3.0)
> 
> Claiming interface 0...
> 
> Reading string descriptors:
>    String (0x01): "Linux 3.18.0-rc5+ with net2280"
>    String (0x02): "Printer Gadget"
> Transfering: endpoint_out 1, size 61387314
>  - number of bulk transfers : 7494
>  - max user transfer size   : 8192 bytes
>  - max usb transfer size    : 1024 bytes
> 
> 2) Device Logs:
> --------------
> 
> [jramirez@dali ~]$ cat /proc/version
> Linux version 3.18.0-rc5+ (jramirez@localhost.localdomain) (gcc version 4.8.3
> 20140911 (Red Hat 4.8.3-7) (GCC) ) #1 SMP Mon Nov 17 21:59:22 EST 2014
> 
> 
> [   72.345683] net2280 0000:02:00.0: usb_reset_338x: Defect 7374 FsmValue 0xf0000000
> [   72.345706] net2280 0000:02:00.0: usb_reinit_338x: Defect 7374 FsmValue f0000000
> [   72.345748] net2280 0000:02:00.0: irq 35 for MSI/MSI-X
> [   72.345798] net2280 0000:02:00.0: PLX NET228x/USB338x USB Peripheral Controller
> [   72.345801] net2280 0000:02:00.0: irq 35, pci mem ffffc90004960000, chip rev 00ab
> [   72.345803] net2280 0000:02:00.0: version: 2005 Sept 27/v3.0; dma enabled legacy mode
> [   86.630589] printer gadget: Printer Gadget, version: 2007 OCT 06
> [   86.630593] printer gadget: printer ready
> [   86.630599] net2280 0000:02:00.0: Operate Defect 7374 workaround soft this time
> [   86.630600] net2280 0000:02:00.0: It will operate on cold-reboot and SS connect
> [   86.630709] net2280 0000:02:00.0: ep0_start_338x: Defect 7374 FsmValue 10000000
> [   86.870669] net2280 0000:02:00.0: INFO: Defect 7374 workaround waited about
> [   86.875065] printer gadget: super-speed config #1: printer
> [   86.875077] printer gadget: Using interface 0
> 
> 
> [jramirez@dali device.git (master%)]$ sudo ./usbdevice
> Receiving file
> 
> Transfer rate => 462 Mbits/sec [57MB/sec]
>  - file size : 58 MB
>  - time      : 1.12 sec
> 
> 
> As mentioned above, using the usb338x driver from PLX instead of the net2280 from
> kernel.org, the effective file transfer rate increases 1Gbps.

do you want to debug that and find the culprit since you're already at
it ?

> 
> 
> 3) Patch:
> ---------
> 
> 
> 
> From 9b5ee9330c5c02cf51328c350036c1dac998b732 Mon Sep 17 00:00:00 2001
> From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> Date: Thu, 25 Sep 2014 16:17:20 -0400
> Subject: [PATCH 2/3] usb: gadget: add USB3 support to the printer driver
> 
> Add SS descriptors to support the capabilities provided by USB3 controller
> drivers; unit tests run using a PLX 3380 [max transfer speed measured of 1Gbps]
> 
> This driver shall fallback to lower operating modes when the higher ones are
> not available.
> 
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> ---
>  drivers/usb/gadget/legacy/printer.c | 65 +++++++++++++++++++++++++++++++++----
>  1 file changed, 59 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
> index 6474081..456730b 100644
> --- a/drivers/usb/gadget/legacy/printer.c
> +++ b/drivers/usb/gadget/legacy/printer.c
> @@ -208,6 +208,43 @@ static struct usb_descriptor_header *hs_printer_function[] = {
>      NULL
>  };
>  
> +/*
> + * Added endpoint descriptors for 3.0 devices
> + */
> +
> +static struct usb_endpoint_descriptor ss_ep_in_desc = {
> +    .bLength =              USB_DT_ENDPOINT_SIZE,
> +    .bDescriptorType =      USB_DT_ENDPOINT,
> +    .bmAttributes =         USB_ENDPOINT_XFER_BULK,
> +    .wMaxPacketSize =       cpu_to_le16(1024),
> +};

all your tabs have been converted into spaces. Perhaps try:

	$ git help send-email

and figure out how to use that ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 15:17     ` Felipe Balbi
@ 2014-11-18 17:52       ` Jorge Ramirez-Ortiz
  2014-11-18 18:00         ` Felipe Balbi
  0 siblings, 1 reply; 14+ messages in thread
From: Jorge Ramirez-Ortiz @ 2014-11-18 17:52 UTC (permalink / raw)
  Cc: felipe Balbi, Greg KH, linux-kernel, linux-usb

On 11/18/2014 10:17 AM, Felipe Balbi wrote:
> Hi,
>
> On Tue, Nov 18, 2014 at 09:19:36AM -0500, Jorge Ramirez-Ortiz wrote:
>> Hi Felipe/Greg
>>
>> Thanks for your comments on my previous attempt.
>> I think I addressed them here.
> no you haven't. Read Documentation/SubmittingPatches, read the mailing
> list archives and you'll see your basic mistake.

For this fundamental mistake, could you not just share with me what I am missing?
I don't see anything wrong other than maybe adding more maintainers to the DL as per the scripts since the feature itself is self explanatory.

     

> you have no clue what these mean, do you ? How about reading the USB
> specification of even http://www.beyondlogic.org/usbnutshell/usb1.shtml


Unfortunately I do.
It was easier to temporarily hack the driver code for a test - while I was at it - rather than modifying the host code.
Since you asked for them, I though you would read the logs and wonder where the funny ids where coming from.
That hack above would have given you an answer: so I kind of know what the ids are for. honestly.
anyway, will send the new logs - it took me a while to find and modify the host test code.


>
> do you want to debug that and find the culprit since you're already at
> it ?

probably: I still need to get used to this process, thanks for bearing with me on this.

I spoke to Ricardo Ribalda three months ago while I was doing this stuff.
but yes, I might work on this -after I finish with this patch!- since I have access to the hardware locally.


>
>>
>> 3) Patch:
>> ---------
>>
>>
>>
>> From 9b5ee9330c5c02cf51328c350036c1dac998b732 Mon Sep 17 00:00:00 2001
>> From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>> Date: Thu, 25 Sep 2014 16:17:20 -0400
>> Subject: [PATCH 2/3] usb: gadget: add USB3 support to the printer driver
>>
>> Add SS descriptors to support the capabilities provided by USB3 controller
>> drivers; unit tests run using a PLX 3380 [max transfer speed measured of 1Gbps]
>>
>> This driver shall fallback to lower operating modes when the higher ones are
>> not available.
>>
>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>> ---
>>  drivers/usb/gadget/legacy/printer.c | 65 +++++++++++++++++++++++++++++++++----
>>  1 file changed, 59 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
>> index 6474081..456730b 100644
>> --- a/drivers/usb/gadget/legacy/printer.c
>> +++ b/drivers/usb/gadget/legacy/printer.c
>> @@ -208,6 +208,43 @@ static struct usb_descriptor_header *hs_printer_function[] = {
>>      NULL
>>  };
>>  
>> +/*
>> + * Added endpoint descriptors for 3.0 devices
>> + */
>> +
>> +static struct usb_endpoint_descriptor ss_ep_in_desc = {
>> +    .bLength =              USB_DT_ENDPOINT_SIZE,
>> +    .bDescriptorType =      USB_DT_ENDPOINT,
>> +    .bmAttributes =         USB_ENDPOINT_XFER_BULK,
>> +    .wMaxPacketSize =       cpu_to_le16(1024),
>> +};
>> As mentioned above, using the usb338x driver from PLX instead of the net2280 from
>> kernel.org, the effective file transfer rate increases 1Gbps.
>>
> all your tabs have been converted into spaces. Perhaps try:
>
> 	$ git help send-email
>
> and figure out how to use that ?
>

crap. really sorry about this!


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 17:52       ` Jorge Ramirez-Ortiz
@ 2014-11-18 18:00         ` Felipe Balbi
  2014-11-18 20:41           ` Jorge Ramirez-Ortiz
  0 siblings, 1 reply; 14+ messages in thread
From: Felipe Balbi @ 2014-11-18 18:00 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz; +Cc: felipe Balbi, Greg KH, linux-kernel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 4387 bytes --]

Hi,

(fix your mailer, lines should be broken at 80-characters.
Documentation/email-clients.txt has tips)

On Tue, Nov 18, 2014 at 12:52:11PM -0500, Jorge Ramirez-Ortiz wrote:
> On 11/18/2014 10:17 AM, Felipe Balbi wrote:
> > Hi,
> >
> > On Tue, Nov 18, 2014 at 09:19:36AM -0500, Jorge Ramirez-Ortiz wrote:
> >> Hi Felipe/Greg
> >>
> >> Thanks for your comments on my previous attempt.
> >> I think I addressed them here.
> > no you haven't. Read Documentation/SubmittingPatches, read the mailing
> > list archives and you'll see your basic mistake.
> 
> For this fundamental mistake, could you not just share with me what I
> am missing?
> I don't see anything wrong other than maybe adding more maintainers to
> the DL as per the scripts since the feature itself is self
> explanatory.

Try to save your email from the mailing list and apply it with git am,
it should be very easy to see the problem.

If you also look at the mailing list archives for other patch
submissions (as I suggested) you'll easily see what your mistake is.

> > you have no clue what these mean, do you ? How about reading the USB
> > specification of even http://www.beyondlogic.org/usbnutshell/usb1.shtml
> 
> 
> Unfortunately I do.
> It was easier to temporarily hack the driver code for a test - while I
> was at it - rather than modifying the host code.
> Since you asked for them, I though you would read the logs and wonder
> where the funny ids where coming from.

why do you even need to hack the host driver for these ? The driver
shows a Printer Class interface and the linux host side driver should
bind to it without any issues.

> That hack above would have given you an answer: so I kind of know what
> the ids are for. honestly.  anyway, will send the new logs - it took
> me a while to find and modify the host test code.

Which host test code ? Why don't you just use lpr or even cat file >
/dev/lp0 or something like that ?

> > do you want to debug that and find the culprit since you're already at
> > it ?
> 
> probably: I still need to get used to this process, thanks for bearing
> with me on this.

no problem.

> I spoke to Ricardo Ribalda three months ago while I was doing this
> stuff.  but yes, I might work on this -after I finish with this
> patch!- since I have access to the hardware locally.

cool, that'll help.

> >> 3) Patch:
> >> ---------
> >>
> >>
> >>
> >> From 9b5ee9330c5c02cf51328c350036c1dac998b732 Mon Sep 17 00:00:00 2001
> >> From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> >> Date: Thu, 25 Sep 2014 16:17:20 -0400
> >> Subject: [PATCH 2/3] usb: gadget: add USB3 support to the printer driver
> >>
> >> Add SS descriptors to support the capabilities provided by USB3 controller
> >> drivers; unit tests run using a PLX 3380 [max transfer speed measured of 1Gbps]
> >>
> >> This driver shall fallback to lower operating modes when the higher ones are
> >> not available.
> >>
> >> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

hint:

Everything up until this point will go to commit log.

> >> ---
> >>  drivers/usb/gadget/legacy/printer.c | 65 +++++++++++++++++++++++++++++++++----
> >>  1 file changed, 59 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
> >> index 6474081..456730b 100644
> >> --- a/drivers/usb/gadget/legacy/printer.c
> >> +++ b/drivers/usb/gadget/legacy/printer.c
> >> @@ -208,6 +208,43 @@ static struct usb_descriptor_header *hs_printer_function[] = {
> >>      NULL
> >>  };
> >>  
> >> +/*
> >> + * Added endpoint descriptors for 3.0 devices
> >> + */
> >> +
> >> +static struct usb_endpoint_descriptor ss_ep_in_desc = {
> >> +    .bLength =              USB_DT_ENDPOINT_SIZE,
> >> +    .bDescriptorType =      USB_DT_ENDPOINT,
> >> +    .bmAttributes =         USB_ENDPOINT_XFER_BULK,
> >> +    .wMaxPacketSize =       cpu_to_le16(1024),
> >> +};
> >> As mentioned above, using the usb338x driver from PLX instead of the net2280 from
> >> kernel.org, the effective file transfer rate increases 1Gbps.
> >>
> > all your tabs have been converted into spaces. Perhaps try:
> >
> > 	$ git help send-email
> >
> > and figure out how to use that ?
> >
> 
> crap. really sorry about this!

np

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 18:00         ` Felipe Balbi
@ 2014-11-18 20:41           ` Jorge Ramirez-Ortiz
  2014-11-18 20:47             ` Felipe Balbi
  0 siblings, 1 reply; 14+ messages in thread
From: Jorge Ramirez-Ortiz @ 2014-11-18 20:41 UTC (permalink / raw)
  To: balbi; +Cc: Greg KH, linux-kernel, linux-usb

On 11/18/2014 01:00 PM, Felipe Balbi wrote:
> Hi,
>
> (fix your mailer, lines should be broken at 80-characters.
> Documentation/email-clients.txt has tips)
>
> On Tue, Nov 18, 2014 at 12:52:11PM -0500, Jorge Ramirez-Ortiz wrote:
>> On 11/18/2014 10:17 AM, Felipe Balbi wrote:
>>> Hi,
>>>
>>> On Tue, Nov 18, 2014 at 09:19:36AM -0500, Jorge Ramirez-Ortiz wrote:
>>>> Hi Felipe/Greg
>>>>
>>>> Thanks for your comments on my previous attempt.
>>>> I think I addressed them here.
>>> no you haven't. Read Documentation/SubmittingPatches, read the mailing
>>> list archives and you'll see your basic mistake.
>> For this fundamental mistake, could you not just share with me what I
>> am missing?
>> I don't see anything wrong other than maybe adding more maintainers to
>> the DL as per the scripts since the feature itself is self
>> explanatory.
> Try to save your email from the mailing list and apply it with git am,
> it should be very easy to see the problem.
>
> If you also look at the mailing list archives for other patch
> submissions (as I suggested) you'll easily see what your mistake is.

thanks, I get it now.

>
>>> you have no clue what these mean, do you ? How about reading the USB
>>> specification of even http://www.beyondlogic.org/usbnutshell/usb1.shtml
>>
>> Unfortunately I do.
>> It was easier to temporarily hack the driver code for a test - while I
>> was at it - rather than modifying the host code.
>> Since you asked for them, I though you would read the logs and wonder
>> where the funny ids where coming from.
> why do you even need to hack the host driver for these ? The driver
> shows a Printer Class interface and the linux host side driver should
> bind to it without any issues.

the hack was on the gadget side.

the usbhost test code in charge of sending the file to the device had the wrong ids.
to save time -since I was modifying the gadget driver code and only for the
tests (it is not part of the final patch) - I hacked those ids on the printer.c
file.
but anyway. lets move on. I removed those, recompiled the usb host code and sent
the new traces.


>
>> That hack above would have given you an answer: so I kind of know what
>> the ids are for. honestly.  anyway, will send the new logs - it took
>> me a while to find and modify the host test code.
> Which host test code ? Why don't you just use lpr or even cat file >
> /dev/lp0 or something like that ?

it is some proprietary code that links libusb -part of a different project: it
was useful as it generated some metrics I was interested in.

>
>>> do you want to debug that and find the culprit since you're already at
>>> it ?
>> probably: I still need to get used to this process, thanks for bearing
>> with me on this.
> no problem.
>
>> I spoke to Ricardo Ribalda three months ago while I was doing this
>> stuff.  but yes, I might work on this -after I finish with this
>> patch!- since I have access to the hardware locally.
> cool, that'll help.

notice that the original PLX driver was still far from the theoretical 5Gbps
target (I was expecting to measure at least 3Gbps and could only get 1Gbps).
So 1Gbps should be the target to meet on the kernel.org net2280 - do you agree?


>
>>>> 3) Patch:
>>>> ---------
>>>>
>>>>
>>>>
>>>> From 9b5ee9330c5c02cf51328c350036c1dac998b732 Mon Sep 17 00:00:00 2001
>>>> From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
>>>> Date: Thu, 25 Sep 2014 16:17:20 -0400
>>>> Subject: [PATCH 2/3] usb: gadget: add USB3 support to the printer driver
>>>>
>>>> Add SS descriptors to support the capabilities provided by USB3 controller
>>>> drivers; unit tests run using a PLX 3380 [max transfer speed measured of 1Gbps]
>>>>
>>>> This driver shall fallback to lower operating modes when the higher ones are
>>>> not available.
>>>>
>>>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> hint:
>
> Everything up until this point will go to commit log.
>
>>>> ---
>>>>  drivers/usb/gadget/legacy/printer.c | 65 +++++++++++++++++++++++++++++++++----
>>>>  1 file changed, 59 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
>>>> index 6474081..456730b 100644
>>>> --- a/drivers/usb/gadget/legacy/printer.c
>>>> +++ b/drivers/usb/gadget/legacy/printer.c
>>>> @@ -208,6 +208,43 @@ static struct usb_descriptor_header *hs_printer_function[] = {
>>>>      NULL
>>>>  };
>>>>  
>>>> +/*
>>>> + * Added endpoint descriptors for 3.0 devices
>>>> + */
>>>> +
>>>> +static struct usb_endpoint_descriptor ss_ep_in_desc = {
>>>> +    .bLength =              USB_DT_ENDPOINT_SIZE,
>>>> +    .bDescriptorType =      USB_DT_ENDPOINT,
>>>> +    .bmAttributes =         USB_ENDPOINT_XFER_BULK,
>>>> +    .wMaxPacketSize =       cpu_to_le16(1024),
>>>> +};
>>>> As mentioned above, using the usb338x driver from PLX instead of the net2280 from
>>>> kernel.org, the effective file transfer rate increases 1Gbps.
>>>>
>>> all your tabs have been converted into spaces. Perhaps try:
>>>
>>> 	$ git help send-email
>>>
>>> and figure out how to use that ?
>>>
>> crap. really sorry about this!
> np
>

it should be fine now.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 20:41           ` Jorge Ramirez-Ortiz
@ 2014-11-18 20:47             ` Felipe Balbi
  2014-11-18 21:33               ` Jorge Ramirez-Ortiz
  2014-11-18 21:45               ` Paul Zimmerman
  0 siblings, 2 replies; 14+ messages in thread
From: Felipe Balbi @ 2014-11-18 20:47 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz; +Cc: balbi, Greg KH, linux-kernel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 2759 bytes --]

Hi,

On Tue, Nov 18, 2014 at 03:41:43PM -0500, Jorge Ramirez-Ortiz wrote:
> >>> you have no clue what these mean, do you ? How about reading the USB
> >>> specification of even http://www.beyondlogic.org/usbnutshell/usb1.shtml
> >>
> >> Unfortunately I do.
> >> It was easier to temporarily hack the driver code for a test - while I
> >> was at it - rather than modifying the host code.
> >> Since you asked for them, I though you would read the logs and wonder
> >> where the funny ids where coming from.
> > why do you even need to hack the host driver for these ? The driver
> > shows a Printer Class interface and the linux host side driver should
> > bind to it without any issues.
> 
> the hack was on the gadget side.
> 
> the usbhost test code in charge of sending the file to the device had the wrong ids.
> to save time -since I was modifying the gadget driver code and only for the
> tests (it is not part of the final patch) - I hacked those ids on the printer.c
> file.
> but anyway. lets move on. I removed those, recompiled the usb host code and sent
> the new traces.

then the host side needs a fix because it shouldn't really care about
the device ID, rather it should care about the class being printer.

> >> That hack above would have given you an answer: so I kind of know what
> >> the ids are for. honestly.  anyway, will send the new logs - it took
> >> me a while to find and modify the host test code.
> > Which host test code ? Why don't you just use lpr or even cat file >
> > /dev/lp0 or something like that ?
> 
> it is some proprietary code that links libusb -part of a different project: it
> was useful as it generated some metrics I was interested in.

I would be surprised if lpr doesn't work for the same purpose.

> >>> do you want to debug that and find the culprit since you're already at
> >>> it ?
> >> probably: I still need to get used to this process, thanks for bearing
> >> with me on this.
> > no problem.
> >
> >> I spoke to Ricardo Ribalda three months ago while I was doing this
> >> stuff.  but yes, I might work on this -after I finish with this
> >> patch!- since I have access to the hardware locally.
> > cool, that'll help.
> 
> notice that the original PLX driver was still far from the theoretical 5Gbps
> target (I was expecting to measure at least 3Gbps and could only get 1Gbps).
> So 1Gbps should be the target to meet on the kernel.org net2280 - do you agree?

this depends on a whole bunch of things. Mainline is a lot different
from PLX's kernel tree, I'm sure.

It also depends on how many PCIe lanes you're using. Just because USB3
guarantees 5Gbps bandwidth, if you use a 1x PCIe connector, you'll never
get that ;-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 20:47             ` Felipe Balbi
@ 2014-11-18 21:33               ` Jorge Ramirez-Ortiz
  2014-11-19  3:14                 ` Felipe Balbi
  2014-11-18 21:45               ` Paul Zimmerman
  1 sibling, 1 reply; 14+ messages in thread
From: Jorge Ramirez-Ortiz @ 2014-11-18 21:33 UTC (permalink / raw)
  To: balbi; +Cc: Greg KH, linux-kernel, linux-usb

On 11/18/2014 03:47 PM, Felipe Balbi wrote:
> Hi,
>
> On Tue, Nov 18, 2014 at 03:41:43PM -0500, Jorge Ramirez-Ortiz wrote:
>>>>> you have no clue what these mean, do you ? How about reading the USB
>>>>> specification of even http://www.beyondlogic.org/usbnutshell/usb1.shtml
>>>> Unfortunately I do.
>>>> It was easier to temporarily hack the driver code for a test - while I
>>>> was at it - rather than modifying the host code.
>>>> Since you asked for them, I though you would read the logs and wonder
>>>> where the funny ids where coming from.
>>> why do you even need to hack the host driver for these ? The driver
>>> shows a Printer Class interface and the linux host side driver should
>>> bind to it without any issues.
>> the hack was on the gadget side.
>>
>> the usbhost test code in charge of sending the file to the device had the wrong ids.
>> to save time -since I was modifying the gadget driver code and only for the
>> tests (it is not part of the final patch) - I hacked those ids on the printer.c
>> file.
>> but anyway. lets move on. I removed those, recompiled the usb host code and sent
>> the new traces.
> then the host side needs a fix because it shouldn't really care about
> the device ID, rather it should care about the class being printer.

absolutely.
however if you use libusb_open_device_with_vid_pid then well, these things happen...

>
>>>> That hack above would have given you an answer: so I kind of know what
>>>> the ids are for. honestly.  anyway, will send the new logs - it took
>>>> me a while to find and modify the host test code.
>>> Which host test code ? Why don't you just use lpr or even cat file >
>>> /dev/lp0 or something like that ?
>> it is some proprietary code that links libusb -part of a different project: it
>> was useful as it generated some metrics I was interested in.
> I would be surprised if lpr doesn't work for the same purpose.
>
>>>>> do you want to debug that and find the culprit since you're already at
>>>>> it ?
>>>> probably: I still need to get used to this process, thanks for bearing
>>>> with me on this.
>>> no problem.
>>>
>>>> I spoke to Ricardo Ribalda three months ago while I was doing this
>>>> stuff.  but yes, I might work on this -after I finish with this
>>>> patch!- since I have access to the hardware locally.
>>> cool, that'll help.
>> notice that the original PLX driver was still far from the theoretical 5Gbps
>> target (I was expecting to measure at least 3Gbps and could only get 1Gbps).
>> So 1Gbps should be the target to meet on the kernel.org net2280 - do you agree?
> this depends on a whole bunch of things. Mainline is a lot different
> from PLX's kernel tree, I'm sure.
>
> It also depends on how many PCIe lanes you're using. Just because USB3
> guarantees 5Gbps bandwidth, if you use a 1x PCIe connector, you'll never
> get that ;-)
>

yes, that is why I purchased a Lenovo ThinkServer TS140 just for this integration.
it has one x16 Gen3 PCIe slot, one x1 Gen2 PCIe and one x16 Gen2 PCIe (x4 signal).
so this should be enough.

on the host side, I have good server as well.
So really, there is no excuse to not get this right unless there is a problem in
the plx silicon but from the Windows based metrics that I saw I dont think so.
The only think I am missing is the USB3 analyzer I used to have in my previous
company.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 20:47             ` Felipe Balbi
  2014-11-18 21:33               ` Jorge Ramirez-Ortiz
@ 2014-11-18 21:45               ` Paul Zimmerman
  2014-11-19  3:10                 ` Felipe Balbi
  1 sibling, 1 reply; 14+ messages in thread
From: Paul Zimmerman @ 2014-11-18 21:45 UTC (permalink / raw)
  To: balbi, Jorge Ramirez-Ortiz; +Cc: Greg KH, linux-kernel, linux-usb

> From: linux-usb-owner@vger.kernel.org [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Felipe Balbi
> Sent: Tuesday, November 18, 2014 12:47 PM
> 
> On Tue, Nov 18, 2014 at 03:41:43PM -0500, Jorge Ramirez-Ortiz wrote:
> >
> > notice that the original PLX driver was still far from the theoretical 5Gbps
> > target (I was expecting to measure at least 3Gbps and could only get 1Gbps).
> > So 1Gbps should be the target to meet on the kernel.org net2280 - do you agree?
> 
> this depends on a whole bunch of things. Mainline is a lot different
> from PLX's kernel tree, I'm sure.
> 
> It also depends on how many PCIe lanes you're using. Just because USB3
> guarantees 5Gbps bandwidth, if you use a 1x PCIe connector, you'll never
> get that ;-)

Being pedantic, USB3 runs at 4Gbps, not 5Gbps. The signal transitions
on the bus are at 5GT/s (5 giga-transitions per second), but due to the
8b/10b encoding, that equates to 4Gbps data rate.

-- 
Paul


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 21:45               ` Paul Zimmerman
@ 2014-11-19  3:10                 ` Felipe Balbi
  0 siblings, 0 replies; 14+ messages in thread
From: Felipe Balbi @ 2014-11-19  3:10 UTC (permalink / raw)
  To: Paul Zimmerman
  Cc: balbi, Jorge Ramirez-Ortiz, Greg KH, linux-kernel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]

On Tue, Nov 18, 2014 at 09:45:13PM +0000, Paul Zimmerman wrote:
> > From: linux-usb-owner@vger.kernel.org [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Felipe Balbi
> > Sent: Tuesday, November 18, 2014 12:47 PM
> > 
> > On Tue, Nov 18, 2014 at 03:41:43PM -0500, Jorge Ramirez-Ortiz wrote:
> > >
> > > notice that the original PLX driver was still far from the theoretical 5Gbps
> > > target (I was expecting to measure at least 3Gbps and could only get 1Gbps).
> > > So 1Gbps should be the target to meet on the kernel.org net2280 - do you agree?
> > 
> > this depends on a whole bunch of things. Mainline is a lot different
> > from PLX's kernel tree, I'm sure.
> > 
> > It also depends on how many PCIe lanes you're using. Just because USB3
> > guarantees 5Gbps bandwidth, if you use a 1x PCIe connector, you'll never
> > get that ;-)
> 
> Being pedantic, USB3 runs at 4Gbps, not 5Gbps. The signal transitions
> on the bus are at 5GT/s (5 giga-transitions per second), but due to the
> 8b/10b encoding, that equates to 4Gbps data rate.

I stand corrected :-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH]  usb: gadget: USB3 support to the legacy printer driver
  2014-11-18 21:33               ` Jorge Ramirez-Ortiz
@ 2014-11-19  3:14                 ` Felipe Balbi
  0 siblings, 0 replies; 14+ messages in thread
From: Felipe Balbi @ 2014-11-19  3:14 UTC (permalink / raw)
  To: Jorge Ramirez-Ortiz; +Cc: balbi, Greg KH, linux-kernel, linux-usb

[-- Attachment #1: Type: text/plain, Size: 3765 bytes --]

On Tue, Nov 18, 2014 at 04:33:42PM -0500, Jorge Ramirez-Ortiz wrote:
> On 11/18/2014 03:47 PM, Felipe Balbi wrote:
> > Hi,
> >
> > On Tue, Nov 18, 2014 at 03:41:43PM -0500, Jorge Ramirez-Ortiz wrote:
> >>>>> you have no clue what these mean, do you ? How about reading the USB
> >>>>> specification of even http://www.beyondlogic.org/usbnutshell/usb1.shtml
> >>>> Unfortunately I do.
> >>>> It was easier to temporarily hack the driver code for a test - while I
> >>>> was at it - rather than modifying the host code.
> >>>> Since you asked for them, I though you would read the logs and wonder
> >>>> where the funny ids where coming from.
> >>> why do you even need to hack the host driver for these ? The driver
> >>> shows a Printer Class interface and the linux host side driver should
> >>> bind to it without any issues.
> >> the hack was on the gadget side.
> >>
> >> the usbhost test code in charge of sending the file to the device had the wrong ids.
> >> to save time -since I was modifying the gadget driver code and only for the
> >> tests (it is not part of the final patch) - I hacked those ids on the printer.c
> >> file.
> >> but anyway. lets move on. I removed those, recompiled the usb host code and sent
> >> the new traces.
> > then the host side needs a fix because it shouldn't really care about
> > the device ID, rather it should care about the class being printer.
> 
> absolutely.
> however if you use libusb_open_device_with_vid_pid then well, these things happen...

heh :-)

> >>>> That hack above would have given you an answer: so I kind of know what
> >>>> the ids are for. honestly.  anyway, will send the new logs - it took
> >>>> me a while to find and modify the host test code.
> >>> Which host test code ? Why don't you just use lpr or even cat file >
> >>> /dev/lp0 or something like that ?
> >> it is some proprietary code that links libusb -part of a different project: it
> >> was useful as it generated some metrics I was interested in.
> > I would be surprised if lpr doesn't work for the same purpose.
> >
> >>>>> do you want to debug that and find the culprit since you're already at
> >>>>> it ?
> >>>> probably: I still need to get used to this process, thanks for bearing
> >>>> with me on this.
> >>> no problem.
> >>>
> >>>> I spoke to Ricardo Ribalda three months ago while I was doing this
> >>>> stuff.  but yes, I might work on this -after I finish with this
> >>>> patch!- since I have access to the hardware locally.
> >>> cool, that'll help.
> >> notice that the original PLX driver was still far from the theoretical 5Gbps
> >> target (I was expecting to measure at least 3Gbps and could only get 1Gbps).
> >> So 1Gbps should be the target to meet on the kernel.org net2280 - do you agree?
> > this depends on a whole bunch of things. Mainline is a lot different
> > from PLX's kernel tree, I'm sure.
> >
> > It also depends on how many PCIe lanes you're using. Just because USB3
> > guarantees 5Gbps bandwidth, if you use a 1x PCIe connector, you'll never
> > get that ;-)
> >
> 
> yes, that is why I purchased a Lenovo ThinkServer TS140 just for this
> integration.  it has one x16 Gen3 PCIe slot, one x1 Gen2 PCIe and one
> x16 Gen2 PCIe (x4 signal).  so this should be enough.

right, assuming PLX PCIe card actually supports that :-)

> on the host side, I have good server as well.  So really, there is no
> excuse to not get this right unless there is a problem in the plx
> silicon but from the Windows based metrics that I saw I dont think so.
> The only think I am missing is the USB3 analyzer I used to have in my
> previous company.

yeah, that helps a lot indeed. I'm always using my trusty beagle 5000.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-11-19  3:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 23:19 [PATCH] usb: gadget: USB3 support to the legacy printer driver Jorge Ramirez-Ortiz
2014-11-18  0:30 ` Felipe Balbi
2014-11-18  0:54   ` Greg KH
2014-11-18  1:14     ` Jorge Ramirez-Ortiz
2014-11-18 14:19   ` Jorge Ramirez-Ortiz
2014-11-18 15:17     ` Felipe Balbi
2014-11-18 17:52       ` Jorge Ramirez-Ortiz
2014-11-18 18:00         ` Felipe Balbi
2014-11-18 20:41           ` Jorge Ramirez-Ortiz
2014-11-18 20:47             ` Felipe Balbi
2014-11-18 21:33               ` Jorge Ramirez-Ortiz
2014-11-19  3:14                 ` Felipe Balbi
2014-11-18 21:45               ` Paul Zimmerman
2014-11-19  3:10                 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).