#9601: [attansic_l1] crashes on boot -------------------------------------------+---------------------------- Reporter: bob_ok | Owner: 3dEyes Type: bug | Status: new Priority: normal | Milestone: R1 Component: Drivers/Network/attansic_l1 | Version: R1/Development Resolution: | Keywords: Blocked By: | Blocking: Has a Patch: 0 | Platform: x86 -------------------------------------------+---------------------------- Comment (by mmlr): The following (normalized) syslog snipped was recovered: {{{ vesa: vesa_init() completed successfully! vesa: acc: vesa.accelerant attansic_l1: init_driver(0xcd9a4c90) [attansic_l1] (age) bus_alloc_resource(3, [16], 0x0, 0xffffffff, 0x1,0x2) add_memory_type_range(3519, 0xfebc0000, 0x20000, 0) set MTRRs to: mtrr: 0: base: 0xee000, size: 0x1000, type: 0 mtrr: 1: base: 0xc7fb0000, size: 0x10000, type: 0 mtrr: 2: base: 0xc7fc0000, size: 0x40000, type: 0 mtrr: 3: base: 0xe0000000, size: 0x20000000, type: 0 mtrr: 4: base: 0xc8000000, size: 0x8000000, type: 1 [attansic_l1] (age) PCI device revision : 0x00b0 [attansic_l1] (age) Chip id/revision : 0x9006 [attansic_l1] (age) 1280 Tx FIFO, 2364 Rx FIFO [attansic_l1] (age) MSIX count : 0 [attansic_l1] (age) MSI count : 1 allocate_io_interrupt_vectors: allocated 1 vectors starting from 24 msi_allocate_vectors: allocated 1 vectors starting from 24 [attansic_l1] (age) Using 1 MSI messages. [attansic_l1] (age) bus_alloc_resource(1, [1], 0x0, 0xffffffff, 0x1,0x2) [attansic_l1] (age) Read request size : 512 bytes. [attansic_l1] (age) TLP payload size : 128 bytes. [attansic_l1] (age) could not load DMA'able memory for Rx ring. add_memory_type_range(3524, 0x90000, 0x70000, 0) set MTRRs to: mtrr: 0: base: 0x90000, size: 0x10000, type: 0 mtrr: 1: base: 0xa0000, size: 0x20000, type: 0 mtrr: 2: base: 0xc0000, size: 0x40000, type: 0 mtrr: 3: base: 0xc7fb0000, size: 0x10000, type: 0 mtrr: 4: base: 0xc7fc0000, size: 0x40000, type: 0 mtrr: 5: base: 0xe0000000, size: 0x20000000, type: 0 mtrr: 6: base: 0xc8000000, size: 0x8000000, type: 1 if_initname(0xcf48e400, age, 3) [attansic_l1] attansic_l1: /dev/net/attansic_l1/0 [attansic_l1] () Found MII: atphy [attansic_l1] () OUI 0x00c82e, model 0x0001, rev. 5 [attansic_l1] () ifmedia_add: Adding Entry... ... msi enabled: 0x0081 loaded driver /boot/system/add-ons/kernel/drivers/dev/net/attansic_l1 etherpci: init_driver init_driver: etherpci not found loaded driver /boot/system/add-ons/kernel/drivers/dev/net/pegasus sis19x:00.24.724:init_hardware::SiS19X:init_hardware() remove_memory_type_range(3524, 0x90000, 0x70000, 0) set MTRRs to: mtrr: 0: base: 0xee000, size: 0x1000, type: 0 mtrr: 1: base: 0xc7fb0000, size: 0x10000, type: 0 mtrr: 2: base: 0xc7fc0000, size: 0x40000, type: 0 mtrr: 3: base: 0xe0000000, size: 0x20000000, type: Entry... }}} The relevant line being: {{{ [attansic_l1] (age) could not load DMA'able memory for Rx ring. }}} Which points to [[http://cgit.haiku-os.org/haiku/tree/src/add- ons/kernel/drivers/network/attansic_l1/dev/age/if_age.c#n1009 | if_age.c line 1009]] which obviously hides the error by not setting an error if the address is 0. The bus_dmamap_load() call on line 1004 calls into [[http://cgit.haiku- os.org/haiku/tree/src/libs/compat/freebsd_network/fbsd_busdma_x86.c#n711 | fbsd_busdma_x86.c line 711]] which in turn calls into _bus_dmamap_load_buffer() on line 569 of that file. Something other than EINPROGRESS and ENOMEM goes on there, as those two would be returned as result in bus_dmamap_load(). The other errors are only sent to the supplied callback. The callback is age_dmamap_cb() on line 794 of the former file and in the error case simply returns immediately, leaving the ctx->age_busaddr at it's previous value of 0 (set in 1003). Hence error = 0, age_busaddr = 0, resulting in the error message, but not actually failing the init. To actually debug the reason for the bus_dmamap_load() failure, adding some debug output to the driver before the call or enabling debug output in fbsd_busdma_x86.c should be tried. A panic at the point of the callback in the error case would be helpful as well. Note that it doesn't seem to be a general problem with bus_dmamap_load(), as the same call for the tx ring a couple lines higher seems to work, as do the following calls judging by the lack of their error messages. Note the RX ring size calculated from [[http://cgit.haiku- os.org/haiku/tree/src/add- ons/kernel/drivers/network/attansic_l1/dev/age/if_agevar.h#n123 | if_agevar.h line 123]] where AGE_RX_RING_CNT is the same as AGE_TX_RING_CNT at 256 each and sizeof(struct rx_desc) from [[http://cgit .haiku-os.org/haiku/tree/src/add- ons/kernel/drivers/network/attansic_l1/dev/age/if_agereg.h#n610 | if_agereg.h line 610]] being 6 bytes = 1536 bytes. Note that the TX ring is 2048 due to tx_desc being 8 bytes. So possibly an alignment/block size issue? -- Ticket URL: <http://dev.haiku-os.org/ticket/9601#comment:1> Haiku <http://dev.haiku-os.org> Haiku - the operating system.