Hi Felipe,

I tried today's version of linux-next tree (commit id
b1714a88bee1ae, "Add linux-next specific files for 20130222").
My PXA based platform bugs on bootup. I have no console available on my
platform, just a JTAG, so this is the info I have :
 - I'm using a Mitac MIO A701 board (arch/arm/mach-pxa/mioa701.c)
 - on gadget side, I'm using g_ether + pxa27x_udc

So far, I didn't have any composite driver enabled (as the PXA suffer from a
severe hardware defect, see comment in header of pxa27x_udc.c).

Now, what I gathered from the JTAG is in [1].
You can see that in sysfs_create_file(), the first argument has :
&dev->kobj->sd == NULL.

And of course in fs/sysfs/file.c :
        BUG_ON(!kobj || !kobj->sd || !attr);

Therefore, I hit a BUG.

Could you tell me what changed recently that triggers this ? I saw in my .config
CONFIG_USB_LIBCOMPOSITE=y which looks a bit suspect to me, but I'm sure you'll
tell me what recent change prevents my platform from booting.

Cheers.

--
Robert

[1]: JTAG + GDB analysis
1597            ret = device_create_file(&gadget->dev, &dev_attr_suspended);
(gdb) bt
#0  composite_dev_prepare (composite=0xc04fdb6c, cdev=0xc39a8660) at 
drivers/usb/gadget/composite.c:1597
#1  0xc024cf80 in composite_bind (gadget=0xc04f4020, gdriver=0xc04fdb94) at 
drivers/usb/gadget/composite.c:1660
#2  0xc024ae2c in udc_bind_to_driver (udc=0xc3a10ec0, driver=0xc39a85a0) at 
drivers/usb/gadget/udc-core.c:272
#3  0xc024af40 in usb_gadget_probe_driver (driver=0xc04fdb94) at 
drivers/usb/gadget/udc-core.c:337
#4  0xc024c718 in usb_composite_probe (driver=0xc04fdb6c) at 
drivers/usb/gadget/composite.c:1793
#5  0xc04aac68 in init () at drivers/usb/gadget/ether.c:366
#6  0xc0008608 in do_one_initcall (fn=0xc04aac54 <init>) at init/main.c:690
#7  0xc0496318 in do_initcall_level () at init/main.c:761
#8  do_initcalls () at init/main.c:769
#9  do_basic_setup () at init/main.c:788
#10 kernel_init_freeable () at init/main.c:890
#11 0xc038e2e4 in kernel_init (unused=0xc39fe800) at init/main.c:822
#12 0xc0009320 in ret_from_fork () at arch/arm/kernel/entry-common.S:92
Backtrace stopped: frame did not save the PC
(gdb) p composite
$1 = (struct usb_composite_driver *) 0xc04fdb6c
(gdb) p *composite
$2 = {name = 0xc045e2d0 "g_ether", dev = 0xc04f46e0, strings = 0xc04f4988, 
max_speed = USB_SPEED_SUPER, needs_serial = 0, bind = 0xc04aac70 <eth_bind>, 
unbind = 0, disconnect = 0, 
  suspend = 0, resume = 0, gadget_driver = {function = 0xc045e2d0 "g_ether", 
max_speed = USB_SPEED_SUPER, bind = 0xc024cf04 <composite_bind>, unbind = 
0xc024cdc4 <composite_unbind>, 
    setup = 0xc024d498 <composite_setup>, disconnect = 0xc024c8ac 
<composite_disconnect>, suspend = 0xc024c7f8 <composite_suspend>, resume = 
0xc024c740 <composite_resume>, driver = {
      name = 0xc045e2d0 "g_ether", bus = 0x0, owner = 0x0, mod_name = 0x0, 
suppress_bind_attrs = false, of_match_table = 0x0, acpi_match_table = 0x0, 
probe = 0, remove = 0, shutdown = 0, 
      suspend = 0, resume = 0, groups = 0x0, pm = 0x0, p = 0x0}}}
(gdb) p *cdev
$3 = {gadget = 0xc04f4020, req = 0xc39a85a0, config = 0x0, suspended = 0, desc 
= {bLength = 0 '\000', bDescriptorType = 0 '\000', bcdUSB = 0, bDeviceClass = 0 
'\000', 
    bDeviceSubClass = 0 '\000', bDeviceProtocol = 0 '\000', bMaxPacketSize0 = 0 
'\000', idVendor = 0, idProduct = 0, bcdDevice = 0, iManufacturer = 0 '\000', 
iProduct = 0 '\000', 
    iSerialNumber = 0 '\000', bNumConfigurations = 0 '\000'}, configs = {next = 
0xc39a8680, prev = 0xc39a8680}, gstrings = {next = 0xc39a8688, prev = 
0xc39a8688}, driver = 0x0, 
  next_string_id = 0 '\000', def_manufacturer = 0x0, deactivations = 0, 
delayed_status = 0, lock = {{rlock = {raw_lock = {<No data fields>}}}}}
(gdb) p *gadget
$4 = {ops = 0xc03ba528, ep0 = 0xc04f413c, ep_list = {next = 0xc04f4180, prev = 
0xc04f4260}, speed = USB_SPEED_FULL, max_speed = USB_SPEED_UNKNOWN, 
sg_supported = 0, is_otg = 0, 
  is_a_peripheral = 0, b_hnp_enable = 0, a_hnp_support = 0, a_alt_hnp_support = 
0, name = 0xc03ba370 "pxa27x_udc", dev = {parent = 0xc04d4328, p = 0xc39a8600, 
kobj = {name = 0x0, entry = {
        next = 0xc04f404c, prev = 0xc04f404c}, parent = 0x0, kset = 0xc3822be0, 
ktype = 0xc04f2078, sd = 0x0, kref = {refcount = {counter = 1}}, 
state_initialized = 1, state_in_sysfs = 0, 
      state_add_uevent_sent = 0, state_remove_uevent_sent = 0, uevent_suppress 
= 0}, init_name = 0xc045e180 "gadget", type = 0x0, mutex = {count = {counter = 
1}, wait_lock = {{rlock = {
            raw_lock = {<No data fields>}}}}, wait_list = {next = 0xc04f4078, 
prev = 0xc04f4078}}, bus = 0x0, driver = 0x0, platform_data = 0x0, power = 
{power_state = {event = -1}, 
      can_wakeup = 0, async_suspend = 0, is_prepared = false, is_suspended = 
false, ignore_children = false, early_init = true, lock = {{rlock = {raw_lock = 
{<No data fields>}}}}, entry = {
        next = 0xc04f4094, prev = 0xc04f4094}, completion = {done = 2147483647, 
wait = {lock = {{rlock = {raw_lock = {<No data fields>}}}}, task_list = {next = 
0xc04f40a0, 
            prev = 0xc04f40a0}}}, wakeup = 0x0, wakeup_path = false, syscore = 
false, subsys_data = 0x0, qos = 0x0}, pm_domain = 0x0, dma_mask = 0x0, 
coherent_dma_mask = 0, dma_parms = 0x0, 
    dma_pools = {next = 0xc04f40cc, prev = 0xc04f40cc}, dma_mem = 0x0, archdata 
= {dma_ops = 0x0}, of_node = 0x0, acpi_node = {<No data fields>}, devt = 0, id 
= 0, devres_lock = {{rlock = {
          raw_lock = {<No data fields>}}}}, devres_head = {next = 0xc04f40e8, 
prev = 0xc04f40e8}, knode_class = {n_klist = 0x0, n_node = {next = 0x0, prev = 
0x0}, n_ref = {refcount = {
          counter = 0}}}, class = 0x0, groups = 0x0, release = 0, iommu_group = 
0x0}, out_epnum = 0, in_epnum = 0}
(gdb) p dev_attr_suspended
$5 = {attr = {name = 0xc045db28 "suspended", mode = 292}, show = 0xc024cde4 
<composite_show_suspended>, store = 0}
(gdb) step
device_create_file (dev=0xc04f4040, attr=0xc04f3f94) at drivers/base/core.c:566
566             if (dev)
(gdb) n
567                     error = sysfs_create_file(&dev->kobj, &attr->attr);
(gdb) p dev
$6 = (struct device *) 0xc04f4040
(gdb) p dev->kobj
$7 = {name = 0x0, entry = {next = 0xc04f404c, prev = 0xc04f404c}, parent = 0x0, 
kset = 0xc3822be0, ktype = 0xc04f2078, sd = 0x0, kref = {refcount = {counter = 
1}}, state_initialized = 1, 
  state_in_sysfs = 0, state_add_uevent_sent = 0, state_remove_uevent_sent = 0, 
uevent_suppress = 0}
(gdb) p attr
$8 = (const struct device_attribute *) 0xc04f3f94
(gdb) p attr->attr
$9 = {name = 0xc045db28 "suspended", mode = 292}


-- 
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to