Re: [PATCH V3] USB: Add LVS Test device driver

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

 



Hi Greg,



On Wed, May 28, 2014 at 4:18 AM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sat, May 24, 2014 at 05:09:02PM +0530, Pratyush Anand wrote:
> > OTG3 and EH Compliance Plan 1.0 talks about Super Speed OTG Verification
> > system (SS-OVS) which consists of an excersizer and analyzer.
> >
> > USB Compliance Suite from Lecroy or Ellisys can act as such SS-OVS for
> > Link Layer Validation (LVS).
> >
> > Some modifications are needed for an embedded Linux USB host to pass all
> > these tests.  Most of these tests require just Link to be in U0. They do
> > not work with default Linux USB stack since, default stack does port
> > reset and then starts sending setup packet, which is not expected by
> > Link Layer Validation (LVS) device of Lecroy Compliance Suit.  Then,
> > There are many Link Layer Tests which need host to generate specific
> > traffic.
> >
> > This patch supports specific traffic generation cases. As of now all the
> > host Lecroy Link Layer-USBIF tests (except TD7.26) passes
> > with this patch for single run using  Lecroy USB Compliance Suite
> > Version 1.98 Build 239 and Lecroy USB Protocol Analyzer version 4.80
> > Build 1603. Therefore patch seems to be a good candidate for inclusion.
> > Further modification can be done on top of it.
> >
> > lvstest driver will not bind to any device by default. It can bind
> > manually to a super speed USB host controller root hub. Therefore, regular
> > hub driver must be unbound before this driver is bound. For example, if
> > 2-0:1.0 is the xhci root hub, then execute following to unbind hub driver.
> >
> >  echo 2-0:1.0 > /sys/bus/usb/drivers/hub/unbind
> >
> > Then write Linux Foundation's vendor ID which is used by root hubs and
> > SS root hub's device ID into new_id file. Writing IDs into new_id file
> > will also bind the lvs driver with any available SS root hub interfaces.
> >
> >  echo "1D6B 3" > /sys/bus/usb/drivers/lvs/new_id
> >
> > Now connect LVS device with root hub port.
> >
> > Test case specific traffic can be generated as follows whenever needed:
> >
> > 1. To issue "Get Device descriptor" command for TD.7.06:
> >  echo  > /sys/bus/usb/devices/2-0\:1.0/get_dev_desc
> >
> > 2. To set U1 timeout to 127 for TD.7.18
> >  echo 127 > /sys/bus/usb/devices/2-0\:1.0/u1_timeout
> >
> > 3. To set U2 timeout to 0 for TD.7.18
> >  echo 0 > /sys/bus/usb/devices/2-0\:1.0/u2_timeout
> >
> > 4. To issue "Hot Reset" for TD.7.29
> >  echo  > /sys/bus/usb/devices/2-0\:1.0/hot_reset
> >
> > 5. To issue "U3 Entry" for TD.7.35
> >  echo  > /sys/bus/usb/devices/2-0\:1.0/u3_entry
> >
> > 6. To issue "U3 Exit" for TD.7.36
> >  echo  > /sys/bus/usb/devices/2-0\:1.0/u3_exit
> >
> > Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx>
> > Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> > ---
> >  Documentation/ABI/testing/sysfs-bus-usb-lvstest |  47 +++
> >  drivers/usb/misc/Kconfig                        |   7 +
> >  drivers/usb/misc/Makefile                       |   1 +
> >  drivers/usb/misc/lvstest.c                      | 452 ++++++++++++++++++++++++
> >  4 files changed, 507 insertions(+)
> >  create mode 100644 Documentation/ABI/testing/sysfs-bus-usb-lvstest
> >  create mode 100644 drivers/usb/misc/lvstest.c
>
> Did you build this code?


Yes..built and tested on hardware.

>
>
> It fails for me with:
>
> In file included from drivers/usb/misc/lvstest.c:16:0:
> include/linux/module.h:138:40: error: ‘__mod_usb__lvs_id_table_device_table’ aliased to undefined symbol ‘lvs_id_table’
>    extern const struct type##_device_id __mod_##type##__##name##_device_table \
>                                         ^
> drivers/usb/misc/lvstest.c:431:1: note: in expansion of macro ‘MODULE_DEVICE_TABLE’
>  MODULE_DEVICE_TABLE(usb, lvs_id_table);
>  ^
>
>
> > +MODULE_DEVICE_TABLE(usb, lvs_id_table);
>
> Yeah, that line is the problem, and proof you didn't build this :(


Oh..its side effect of working with older kernels :(
My test board works with 3.10 kernel.  I cherry-picked couple of
patches from latest kernel
for DEVICE_ATTR_XX and then built and tested.

I will compile with latest kernel and then will backport to my older
kernel to test with hardware.

Regards
Pratyush

>
>
> > +static struct usb_driver lvs_driver = {
> > +     .name =         "lvs",
> > +     .probe =        lvs_rh_probe,
> > +     .disconnect =   lvs_rh_disconnect,
> > +};
> > +
> > +static int __init lvs_init(void)
> > +{
> > +     return usb_register(&lvs_driver);
> > +}
> > +module_init(lvs_init);
> > +
> > +static void __exit lvs_exit(void)
> > +{
> > +     usb_deregister(&lvs_driver);
> > +}
> > +module_exit(lvs_exit);
>
> Use module_usb_driver() instead of these two functions please.
>
> And test your code.
>
> bah,
>
> greg k-h
> --
> 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
--
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