[#4141] usb gadget zero test NO. 14 fails in PIO mode

Document created by Aaronwu Employee on Aug 29, 2013
Version 1Show Document
  • View in full screen mode

[#4141] usb gadget zero test NO. 14 fails in PIO mode

Submitted By: Vivi Li

Open Date

2008-06-03 04:01:05     Close Date

2009-09-28 02:18:30

Priority:

Medium     Assignee:

Cliff Cai

Status:

Closed     Fixed In Release:

N/A

Found In Release:

2008R1-RC8     Release:

Category:

Tests     Board:

N/A

Processor:

ALL     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

08r1-rc8

App binary format:

N/A     

Summary: usb gadget zero test NO. 14 fails in PIO mode

Details:

 

For usb gadget zero test NO. 14, it will fail for BF548-EZKIT and BF527-EZKIT.

 

--

root@adam:/home/test# sudo ./src/testusb -D /proc/bus/usb/005/007 -t14 -c 15000 -s 256 -v 1

unknown speed   /proc/bus/usb/005/007

/proc/bus/usb/005/007 test 14 --> 75 (Value too large for defined data type)

--

 

Follow-ups

 

--- Bryan Wu                                                 2008-06-24 06:01:00

After digging into this bug, I found this bug happened randomly. But with the

Lecory USB analyzer, I captured that the last IN packet is wrong in the

CONTROL-OUT transfer. We need to flush the fifo when the whole packet transfer

finished.

 

Please find the snapshot of the USB capture data.

 

I fixed this bug both in 08R1 branch and in svn trunk with introducing flush

fifo operation in the musb_g_ep0_giveback function.

 

On bf548-ezkit:

---

Linux version 2.6.22.19-ADI-2008R1-svn4874 (roc@roc-desktop) (gcc version 4.1.2

(ADI svn)) #45 Tue Jun 24 17:45:44 CST 2008

early printk enabled on early_BFuart0

Hardware Trace Active and Enabled

Reset caused by Software reset

Blackfin support (C) 2004-2007 Analog Devices, Inc.

Compiled for ADSP-BF548 Rev 0.0

Warning: Compiled for Rev 0, but running on Rev 1

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 525 MHz core clock and 131 MHz System Clock

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  text      = 0x00001000-0x0018f080

  rodata    = 0x00190000-0x0020f66c

  data      = 0x00210000-0x0022a000

    stack   = 0x00210000-0x00212000

  init      = 0x0022a000-0x00a08000

  bss       = 0x00a08000-0x00a199f0

  available = 0x00a199f0-0x03dff000

  DMA Zone  = 0x03e00000-0x04000000

Instruction Cache Enabled

Data Cache Enabled (write-through)

Built 1 zonelists.  Total pages: 15748

Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart1,57600

console=tty0 console=ttyBF0,57600

ip=192.168.0.66:192.168.0.55:192.168.0.1:255.25f

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 256 (order: 8, 1024 bytes)

console handover: boot [early_BFuart0] -> real [ttyBF0]

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory available: 52564k/65536k RAM, (8056k init code, 1592k kernel code, 690k

data, 2048k dma, 584k reserved)

Blackfin Scratchpad data SRAM: 4 KB

Blackfin Data A SRAM: 16 KB (15 KB free)

Blackfin Data B SRAM: 16 KB (16 KB free)

Blackfin Instruction SRAM: 48 KB (42 KB free)

Security Framework v1.0.0 initialized

Mount-cache hash table entries: 512

NET: Registered protocol family 16

Blackfin GPIO Controller

Blackfin DMA Controller

ezkit_init(): registering device resources

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

musb_hdrc: version 6.0, musb-dma, peripheral, debug=0

musb_hdrc: USB Peripheral mode controller at ffc03c00 using DMA, IRQ 82

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bf54x-lq043: FrameBuffer initializing...

dma_alloc_init: dma_page @ 0x00e42000 - 512 pages at 0x03e00000

bfin-otp: initialized

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc02000 (irq = 48) is a BFIN-UART

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

smsc911x: Driver version 2007-07-13.

register bfin atapi driver

scsi0 : pata-bf54x

ata1: PATA max UDMA/66 cmd 0x00000000 ctl 0xffc03800 bmdma 0x00000000 irq 68

ata1.00: ATA-6: TOSHIBA MK4032GAX, AD101A, max UDMA/100

ata1.00: 78140160 sectors, multi 16: LBA48

ata1.00: configured for UDMA/66

blk_queue_max_hw_segments: set to minimum 1

scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MK4032GA AD10 PQ: 0 ANSI: 5

sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors (40008 MB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support

DPO or FUA

sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors (40008 MB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support

DPO or FUA

sda: sda1

sd 0:0:0:0: [sda] Attached SCSI disk

physmap platform flash device: 00400000 at 20000000

physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank

NOR chip too large to fit in mapping. Attempting to cope...

Intel/Sharp Extended Query Table at 0x010A

  Unknown Intel/Sharp Extended Query version 1.5.

gen_probe: No supported Vendor Command Set found

physmap-flash physmap-flash.0: map_probe failed

BF5xx on-chip NAND FLash Controller Driver, Version 1.2 (c) 2007 Analog

Devices, Inc.

bf5xx-nand bf5xx-nand.0: page_size=256, data_width=8, wr_dly=3, rd_dly=3

NAND device: Manufacturer ID: 0x20, Chip ID: 0xda (ST Micro NAND 256MiB 3,3V

8-bit)

Creating 2 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x00000000-0x00400000 : "Linux Kernel"

0x00400000-0x10000000 : "File System"

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0,

regs_base@ffc00500, dma channel@4

bfin-spi bfin-spi.1: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0,

regs_base@ffc02300, dma channel@5

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

input: bf54x-keys as /class/input/input0

bf54x-keys: Blackfin BF54x Keypad registered IRQ 76

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

i2c-bfin-twi i2c-bfin-twi.1: Blackfin BF5xx on-chip I2C TWI Contoller Driver,

Version 1.8, regs_base@ffc02200

usbcore: registered new interface driver usbhid

drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver

Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50

2006 UTC).

ASoC version 0.13.1

dma rx:0 tx:1, err irq:10, regs:ffc00800

AD1980 SoC Audio Codec

asoc: AC97 <-> bf5xx-ac97 mapping ok

ALSA device list:

  #0: bf5xx-board (AD1980)

TCP cubic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

rtc-bfin rtc-bfin: setting the system clock to 1970-01-01 10:36:34 (38194)

eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175

eth0: SMSC911x MAC Address: 00:e0:22:fe:b9:55

eth0: link down

IP-Config: Complete:

      device=eth0, addr=192.168.0.66, mask=255.255.255.0, gw=192.168.0.1,

     host=BFIN, domain=, nis-domain=(none),

     bootserver=192.168.0.55, rootserver=192.168.0.55, rootpath=

Freeing unused kernel memory: 8056k freed

eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            -   blackfin.uclinux.org/

\    YP"    `| 8P  `.          -   docs.blackfin.uclinux.org/

/     \.___.d|    .'           -   www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    -   www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.4.1 (2008-06-23 11:20:44 CST) Built-in shell (msh)

Enter 'help' for a list of built-in commands.

 

root:/> modprobe g_zero

zero gadget: Gadget Zero, version: St Patrick's Day 2004

zero gadget: using musb_hdrc, OUT ep6out IN ep5in

root:/> zero gadget: high speed config #3: source and sink data

---

 

On Linux host

---

$ sudo ./src/testusb -D /proc/bus/usb/005/012 -t14 -c 15000 -s 256 -v 1

unknown speed   /proc/bus/usb/005/012

/proc/bus/usb/005/012 test 14,    3.751470 secs

---

 

-Bryan

 

--- Vivi Li                                                  2008-06-26 23:04:05

Still failed when I test it on bf548-ezkit 08r1 branch.

 

--

root:/> version

kernel:    Linux release 2.6.22.19-ADI-2008R1-svn4897, build #39 Fri Jun 27

09:54:52 CST 2008

toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)

user-dist: release svn-6817, build #14 Fri Jun 27 09:52:59 CST 2008

root:/> modprobe g_zero autoresume=5

zero gadget: Gadget Zero, version: St Patrick's Day 2004

zero gadget: using musb_hdrc, OUT ep6out IN ep5in

root:/> zero gadget: high speed config #3: source and sink data

root:/> lsmod

Module                  Size  Used by

g_zero                  8884  0

root:/> dmesg

Linux version 2.6.22.19-ADI-2008R1-svn4897 (test@Linux165-ViviLi) (gcc version

4.1.2 (ADI svn)) #39 Fri Jun 27 09:54:52 CST 2008

early printk enabled on early_BFuart0

Hardware Trace Active and Enabled

Reset caused by Software reset

Blackfin support (C) 2004-2007 Analog Devices, Inc.

Compiled for ADSP-BF548 Rev 0.0

Warning: Compiled for Rev 0, but running on Rev 1

Blackfin Linux support by   blackfin.uclinux.org/

Processor Speed: 525 MHz core clock and 131 MHz System Clock

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  text      = 0x00001000-0x0018ef50

  rodata    = 0x0018f000-0x0020e6c0

  data      = 0x0020f000-0x0022a000

    stack   = 0x00210000-0x00212000

  init      = 0x0022a000-0x005d4000

  bss       = 0x005d4000-0x005e59f0

  available = 0x005e59f0-0x03dff000

  DMA Zone  = 0x03e00000-0x04000000

On node 0 totalpages: 15871

  DMA zone: 123 pages used for memmap

  DMA zone: 0 pages reserved

  DMA zone: 15748 pages, LIFO batch:3

  Normal zone: 0 pages used for memmap

Instruction Cache Enabled

Data Cache Enabled (write-through)

Built 1 zonelists.  Total pages: 15748

Kernel command line: root=/dev/mtdblock0 rw earlyprintk=serial,uart0,57600

ip=10.100.4.50:10.100.4.174:10.100.4.174:255.255.255.0:BFIN:ethf

Configuring Blackfin Priority Driven Interrupts

PID hash table entries: 256 (order: 8, 1024 bytes)

console handover: boot [early_BFuart0] -> real [ttyBF0]

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Kernel managed physical pages: 15871

Memory available: 56868k/65536k RAM, (3752k init code, 1591k kernel code, 691k

data, 2048k dma, 584k reserved)

Blackfin Scratchpad data SRAM: 4 KB

Blackfin Data A SRAM: 16 KB (15 KB free)

Blackfin Data B SRAM: 16 KB (16 KB free)

Blackfin Instruction SRAM: 48 KB (42 KB free)

Calibrating delay loop... 1046.52 BogoMIPS (lpj=2093056)

Security Framework v1.0.0 initialized

Mount-cache hash table entries: 512

NET: Registered protocol family 16

Blackfin GPIO Controller

Blackfin DMA Controller

ezkit_init(): registering device resources

SCSI subsystem initialized

libata version 2.21 loaded.

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

musb_hdrc: version 6.0, musb-dma, peripheral, debug=0

musb_hdrc: ConfigData=0x00 (UTMI-8)

musb_hdrc: hw_ep 0shared, max 64

musb_hdrc: hw_ep 1tx, max 128

musb_hdrc: hw_ep 1rx, max 128

musb_hdrc: hw_ep 2tx, max 128

musb_hdrc: hw_ep 2rx, max 128

musb_hdrc: hw_ep 3tx, max 128

musb_hdrc: hw_ep 3rx, max 128

musb_hdrc: hw_ep 4tx, max 128

musb_hdrc: hw_ep 4rx, max 128

musb_hdrc: hw_ep 5tx, max 1024

musb_hdrc: hw_ep 5rx, max 1024

musb_hdrc: hw_ep 6tx, max 1024

musb_hdrc: hw_ep 6rx, max 1024

musb_hdrc: hw_ep 7tx, max 1024

musb_hdrc: hw_ep 7rx, max 1024

musb_hdrc: USB Peripheral mode controller at ffc03c00 using DMA, IRQ 82

NET: Registered protocol family 2

IP route cache hash table entries: 1024 (order: 0, 4096 bytes)

TCP established hash table entries: 2048 (order: 2, 16384 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

io scheduler noop registered

io scheduler anticipatory registered (default)

io scheduler cfq registered

bf54x-lq043: FrameBuffer initializing...

dma_alloc_init: dma_page @ 0x0314f000 - 512 pages at 0x03e00000

bfin-otp: initialized

bfin-wdt: initialized: timeout=20 sec (nowayout=0)

Serial: Blackfin serial driver

bfin-uart.1: ttyBF0 at MMIO 0xffc02000 (irq = 48) is a BFIN-UART

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize

smsc911x: Driver version 2007-07-13.

register bfin atapi driver

scsi0 : pata-bf54x

ata1: PATA max UDMA/66 cmd 0x00000000 ctl 0xffc03800 bmdma 0x00000000 irq 68

ata1.00: ATA-6: TOSHIBA MK4032GAX, AD101A, max UDMA/100

ata1.00: 78140160 sectors, multi 16: LBA48

ata1.00: configured for UDMA/66

blk_queue_max_hw_segments: set to minimum 1

scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MK4032GA AD10 PQ: 0 ANSI: 5

sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors (40008 MB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support

DPO or FUA

sd 0:0:0:0: [sda] 78140160 512-byte hardware sectors (40008 MB)

sd 0:0:0:0: [sda] Write Protect is off

sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00

sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support

DPO or FUA

sda: sda1

sd 0:0:0:0: [sda] Attached SCSI disk

physmap platform flash device: 00400000 at 20000000

physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank

NOR chip too large to fit in mapping. Attempting to cope...

Intel/Sharp Extended Query Table at 0x010A

  Unknown Intel/Sharp Extended Query version 1.5.

gen_probe: No supported Vendor Command Set found

physmap-flash physmap-flash.0: map_probe failed

BF5xx on-chip NAND FLash Controller Driver, Version 1.2 (c) 2007 Analog

Devices, Inc.

bf5xx-nand bf5xx-nand.0: page_size=256, data_width=8, wr_dly=3, rd_dly=3

NAND device: Manufacturer ID: 0x20, Chip ID: 0xda (ST Micro NAND 256MiB 3,3V

8-bit)

Creating 2 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x00000000-0x00400000 : "Linux Kernel"

0x00400000-0x10000000 : "File System"

bfin-spi bfin-spi.0: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0,

regs_base@ffc00500, dma channel@4

bfin-spi bfin-spi.1: Blackfin BF5xx on-chip SPI Contoller Driver, Version 1.0,

regs_base@ffc02300, dma channel@5

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

input: bf54x-keys as /class/input/input0

bf54x-keys: Blackfin BF54x Keypad registered IRQ 76

rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0

i2c /dev entries driver

i2c-bfin-twi i2c-bfin-twi.1: Blackfin BF5xx on-chip I2C TWI Contoller Driver,

Version 1.8, regs_base@ffc02200

usbcore: registered new interface driver usbhid

drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver

Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50

2006 UTC).

ASoC version 0.13.1

dma rx:0 tx:1, err irq:10, regs:ffc00800

AD1980 SoC Audio Codec

asoc: AC97 <-> bf5xx-ac97 mapping ok

ALSA device list:

  #0: bf5xx-board (AD1980)

TCP cubic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

Setting up Blackfin MMR debugfs

rtc-bfin rtc-bfin: setting the system clock to 1970-01-01 03:33:28 (12808)

eth0: SMSC911x/921x identified at 0x24000000, IRQ: 175

eth0: SMSC911x MAC Address: 00:e0:22:fe:b9:55

eth0: link down

IP-Config: Complete:

      device=eth0, addr=10.100.4.50, mask=255.255.255.0, gw=10.100.4.174,

     host=BFIN, domain=, nis-domain=(none),

     bootserver=10.100.4.174, rootserver=10.100.4.174, rootpath=

Freeing unused kernel memory: 3752k freed

eth0: link up, 100Mbps, full-duplex, lpa 0x41E1

zero gadget: Gadget Zero, version: St Patrick's Day 2004

zero gadget: using musb_hdrc, OUT ep6out IN ep5in

zero gadget: buflen 4096

zero gadget: high speed config #3: source and sink data

zero gadget: reset config

zero gadget: buflen 4096

zero gadget: high speed config #3: source and sink data

root:/>

 

 

root@adam-desktop2:/home/test/work/cruise/checkouts/uclinux-dist/testsuites/usbdev#

sudo ./src/testusb -D /proc/bus/usb/005/009 -t14 -c 15000 -s 256 -v 1

unknown speed   /proc/bus/usb/005/009

/proc/bus/usb/005/009 test 14 --> 75 (Value too large for defined data

type)

--

 

--- Vivi Li                                                  2009-03-13 02:27:49

It fails for both DMA/PIO mode.

 

--- Sonic Zhang                                              2009-04-03 06:01:53

Can't replicated in kernel SVN 6173.

 

--- Vivi Li                                                  2009-06-18 03:38:46

I still see this bug on bf548/bf527, with both DMA/PIO mode.

 

--- Cliff Cai                                                2009-06-23 02:54:37

This test is to send pattern data( to simulate vendor data) to control

endpoint(CONTROL OUT).Host will repeatedly send a variable length(around 256)

packet to device untill the loop count reaches 15000.When the problem occurs, I

also see a non-zero packet is sent to host after host sends an IN token to

initilate the status stage.Per spec,the device should return a zero-length data

packet to indicate the completion of the transfer.

 

Cliff

 

 

 

--- Cliff Cai                                                2009-07-08 21:54:41

Vivi,

Since this pressure test is meaningless in the real word.So,we can change some

parameters for the test.setting the loop count to 50 and packet size to 512 is

enough for real use.

 

sudo ./src/testusb -D /proc/bus/usb/005/0xx -t14 -c 50

-s 256 -v 1

 

thanks

 

Cliff

 

--- Robin Getz                                               2009-07-09 12:07:00

sorry - I disagree

 

Pressure test are there to ensure robustness.

 

Changing the test (which runs everywhere else) means our implementation may

eventually (and randomly) fail during real world uses.

 

As you pointed out - the specs say : " the device should return a

zero-length data packet to indicate the completion of the transfer", and we

are not doing that. (we are sending non-zero packet).

 

With things like USB - there is no "almost" meet the spec - there is

meet or not meet.

 

Today - we do not meet the spec.

 

-Robin

 

--- Sonic Zhang                                              2009-07-09 23:14:14

Yes. So, the hardware designers should make a decision if they want to meet the

spec or let it alone as no real device use it in this way.

 

--- Cliff Cai                                                2009-08-25 01:43:10

fixed now,there is an anomaly while read packet with odd size from the EP0 FIFO

address,the workaround is to read the last byte of packet with odd size at place

FIFO+4.

 

Cliff

 

--- Michael Hennerich                                        2009-08-25 06:00:28

I wonder if we need this fix in the 2009R1 branch as well?

 

--- Vivi Li                                                  2009-09-03 05:23:36

It's ok now on trunk.

 

--- Cliff Cai                                                2009-09-03 22:52:42

the fix has been applied to 2009R1 branch as well.

 

Cliff

 

--- Vivi Li                                                  2009-09-28 02:18:30

OK now. Close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

t14.zip    application/zip    1957654    Bryan Wu

4141.JPG    image/jpeg    127106    Bryan Wu

Attachments

Outcomes