[U-Boot] [PATCH v2 77/80] dm: usb: Add tests for the USB uclass

Joe Hershberger joe.hershberger at gmail.com
Tue Apr 21 07:24:29 CEST 2015


Hi Simon,

On Wed, Mar 25, 2015 at 1:23 PM, Simon Glass <sjg at chromium.org> wrote:
> This adds a simple test for probing and a functional test using the flash
> stick emulator, which tests a large chunk of the USB stack.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>

I'm seeing a seg fault when running the dm tests and bisected it to this patch.

I'm not sure why it's related, but it appears to seg fault on a GPIO test...


U-Boot 2015.04-00280-ge00cb22-dirty (Apr 21 2015 - 00:02:01)

DRAM:  128 MiB
Using default environment

In:    serial
Out:   lcd
Err:   lcd
Net:   eth0: eth at 10002000, eth5: eth at 10003000, eth1: eth at 10004000
Running 53 driver model tests
Test: dm_test_autobind
Test: dm_test_autoprobe
Test: dm_test_bus_child_post_bind
Test: dm_test_bus_child_post_bind_uclass
Test: dm_test_bus_child_pre_probe_uclass
Test: dm_test_bus_children
Device 'c-test at 0': seq 0 is in use by 'd-test'
Device 'c-test at 1': seq 1 is in use by 'f-test'
Test: dm_test_bus_children_funcs
Test: dm_test_bus_children_iterators
Test: dm_test_bus_parent_data
Test: dm_test_bus_parent_data_uclass
Test: dm_test_bus_parent_ops
Test: dm_test_bus_parent_platdata
Test: dm_test_bus_parent_platdata_uclass
Test: dm_test_children
Test: dm_test_device_get_uclass_id
Test: dm_test_eth
Using eth at 10002000 device
Using eth at 10003000 device
Using eth at 10004000 device
Test: dm_test_eth_alias
Using eth at 10002000 device
Using eth at 10004000 device
Using eth at 10002000 device
Using eth at 10003000 device
Test: dm_test_eth_prime
Using eth at 10003000 device
Using eth at 10002000 device
Test: dm_test_eth_rotate

Error: eth at 10004000 address not set.

Error: eth at 10004000 address not set.
Using eth at 10002000 device

Error: eth at 10004000 address not set.

Error: eth at 10004000 address not set.
Using eth at 10004000 device
Test: dm_test_fdt
Test: dm_test_fdt_offset
Test: dm_test_fdt_pre_reloc
Test: dm_test_fdt_uclass_seq
Test: dm_test_gpio
extra-gpios: get_value: error: gpio b5 not reserved
Test: dm_test_gpio_anon
Test: dm_test_gpio_copy
Test: dm_test_gpio_leak
extra-gpios: get_value: error: gpio b5 not reserved

Program received signal SIGSEGV, Segmentation fault.
0x000009ec in ?? ()
(gdb) bt
#0  0x000009ec in ?? ()
#1  0x0806a0aa in uclass_destroy (uc=0xb5abd228) at
/home/joe/u-boot/drivers/core/uclass.c:109
#2  0x080a29e1 in dm_leak_check_end (dms=0x8106870) at
/home/joe/u-boot/test/dm/core.c:89
#3  0x080a46a6 in dm_test_gpio_leak (dms=0x8106870) at
/home/joe/u-boot/test/dm/gpio.c:173
#4  0x080a0ed2 in dm_test_main (test_name=0x0) at
/home/joe/u-boot/test/dm/test-main.c:103
#5  0x0809e9fb in do_dm (cmdtp=0x80c0250, flag=0, argc=135022648,
argv=0xb5abbd40) at /home/joe/u-boot/test/dm/cmd_dm.c:150
#6  0x08065d6b in cmd_process (flag=0, argc=2, argv=0xb5abbd40,
repeatable=0x80c5fc4, ticks=0x0) at
/home/joe/u-boot/common/command.c:493
#7  0x0804d6fb in run_list_real (pi=0xb5abbc88) at
/home/joe/u-boot/common/cli_hush.c:1656
#8  0x0804dce4 in parse_stream_outer (inp=0xbffff0e8, flag=2) at
/home/joe/u-boot/common/cli_hush.c:2003
#9  0x0804df1d in parse_string_outer (s=0xbffff513 "dm test", flag=2)
at /home/joe/u-boot/common/cli_hush.c:3248
#10 0x0804a855 in sandbox_main_loop_init () at
/home/joe/u-boot/arch/sandbox/cpu/start.c:85
#11 0x0804e65b in run_main_loop () at /home/joe/u-boot/common/board_r.c:682
#12 0x0808f082 in initcall_run_list (init_sequence=0x80c1f68) at
/home/joe/u-boot/lib/initcall.c:27
#13 0x0804e798 in board_init_r (new_gd=0xb5ab9f14, dest_addr=0) at
/home/joe/u-boot/common/board_r.c:916
#14 0x0804a810 in main (argc=Cannot access memory at address 0x0
) at /home/joe/u-boot/arch/sandbox/cpu/start.c:276
(gdb) f 1
#1  0x0806a0aa in uclass_destroy (uc=0xb5abd228) at
/home/joe/u-boot/drivers/core/uclass.c:109
109                     ret = device_unbind(dev);
(gdb) l -
99      int uclass_destroy(struct uclass *uc)
100     {
101             struct uclass_driver *uc_drv;
102             struct udevice *dev, *tmp;
103             int ret;
104
105             list_for_each_entry_safe(dev, tmp, &uc->dev_head, uclass_node) {
106                     ret = device_remove(dev);
107                     if (ret)
108                             return ret;
(gdb) l
109                     ret = device_unbind(dev);
110                     if (ret)
111                             return ret;
112             }
113
114             uc_drv = uc->uc_drv;
115             if (uc_drv->destroy)
116                     uc_drv->destroy(uc);
117             list_del(&uc->sibling_node);
118             if (uc_drv->priv_auto_alloc_size)
(gdb)


Thoughts?
-Joe


More information about the U-Boot mailing list