octeon - panic: _dmamap_sync: ran off map

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

octeon - panic: _dmamap_sync: ran off map

Allen Smith
Saw a note recently about how octeon folks should run -current to catch
stuff before release so I tried upgrading from 6.5 to a 6.6 snapshot as 6.6
release has that issue that causes pppoe to panic.

I see the following panic with the snapshot bsd and boot, but not with 6.6.
release bsd and boot.

Here is the boot log from my EdgeRouter 4.

---
Octeon ubnt_e300(ram)# usb reset; fatload usb 0 ${loadaddr} boot;
bootoctlinux rootdev=sd0 numcores=4
(Re)start USB...
USB0:   Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
USB1:   Starting the controller
USB XHCI 1.00
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
reading boot
3129228 bytes read in 254 ms (11.7 MiB/s)
Allocating memory for ELF segment: addr: 0xffffffff82000000 (adjusted to:
0x2000000), size 0x32f2e0
## Loading big-endian Linux kernel with entry point: 0xffffffff82000000 ...
Bootloader: Done loading app on coremask:
 0xf
Starting cores:
 0xf
bootmem desc 0x6c108 version 3.0
avail phys mem 0x0000000000100000 - 0x0000000002000000
skipped
avail phys mem 0x000000000232f2e0 - 0x000000000fdb0e00
avail phys mem 0x000000000fdb3480 - 0x000000000fdc1c90
avail phys mem 0x000000000fdc1d00 - 0x000000000fdc2500
avail phys mem 0x000000000ffb5d00 - 0x000000000ffb5ff0
avail phys mem 0x000000000ffd5d00 - 0x000000000ffd5d80
avail phys mem 0x000000000fff5100 - 0x000000000fff5140
avail phys mem 0x000000000fff5280 - 0x000000000fff52e0
avail phys mem 0x0000000020000000 - 0x000000004effe4c0
avail phys mem 0x000000004effef80 - 0x000000004f000000
Total DRAM Size 0x0000000040000000
mem_layout[0] page 0x00000000000008CC -> 0x0000000000003F6CInitial setup
done, switching console.
boot_desc->desc_ver:7
boot_desc->desc_size:400
boot_desc->stack_top:0
boot_desc->heap_start:0
boot_desc->heap_end:0
boot_desc->argc:3
boot_desc->flags:0x5
boot_desc->core_mask:0xf
boot_desc->dram_size:1024
boot_desc->phy_mem_desc_addr:0
boot_desc->debugger_flag_addr:0xec4
boot_desc->eclock:1000000000
boot_desc->boot_info_addr:0x4effecd0
boot_info->ver_major:1
boot_info->ver_minor:4
boot_info->stack_top:0
boot_info->heap_start:0
boot_info->heap_end:0
boot_info->boot_desc_addr:0
boot_info->exception_base_addr:0x1000
boot_info->stack_size:0
boot_info->flags:0x5
boot_info->core_mask:0xf
boot_info->dram_size:1024
boot_info->phys_mem_desc_addr:0x6c108
boot_info->debugger_flags_addr:0
boot_info->eclock:1000000000
boot_info->dclock:533000000
boot_info->board_type:20300
boot_info->board_rev_major:0
boot_info->board_rev_minor:14
boot_info->mac_addr_count:4
boot_info->cf_common_addr:0
boot_info->cf_attr_addr:0
boot_info->led_display_addr:0
boot_info->dfaclock:0
boot_info->config_flags:0x9
boot_info->fdt_addr:0xfdb0e00
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2020 OpenBSD. All rights reserved.
https://www.OpenBSD.org

OpenBSD 6.6-current (BOOT) #131: Fri Feb 28 14:02:55 MST 2020
    [hidden email]:/usr/src/sys/arch/octeon/compile/BOOT
real mem = 1073741824 (1024MB)
avail mem = 1008369664 (961MB)
mainbus0 at root: board 20300 rev 0.14
cpu0 at mainbus0: CN70xx/CN71xx CPU rev 0.2 1000 MHz, CN70xx/CN71xx FPU rev
0.0
cpu0: cache L1-I 78KB 39 way D 32KB 32 way, L2 1024KB 8 way
clock0 at mainbus0: int 5
iobus0 at mainbus0
simplebus0 at iobus0: "soc"
octciu0 at simplebus0
octcib0 at simplebus0: max-bits 23
octcib1 at simplebus0: max-bits 12
octcib2 at simplebus0: max-bits 6
octcib3 at simplebus0: max-bits 15
octcib4 at simplebus0: max-bits 4
octcib5 at simplebus0: max-bits 11
octcib6 at simplebus0: max-bits 11
"gpio-controller" at simplebus0 not configured
"bootbus" at simplebus0 not configured
"mdio" at simplebus0 not configured
"pip" at simplebus0 not configured
octsctl0 at simplebus0: disabled
octxctl0 at simplebus0: DWC3 rev 0x250a
xhci0 at octxctl0, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev
3.00/1.00 addr 1
octxctl1 at simplebus0: DWC3 rev 0x250a
xhci1 at octxctl1, xHCI 1.0
usb1 at xhci1: USB revision 3.0
uhub1 at usb1 configuration 1 interface 0 "Generic xHCI root hub" rev
3.00/1.00 addr 1
"i2c" at simplebus0 not configured
"i2c" at simplebus0 not configured
com0 at simplebus0: ns16550a, 64 byte fifo
com0: console
com1 at simplebus0: ns16550a, 64 byte fifo
com1: probed fifo depth: 0 bytes
octmmc0 at simplebus0
sdmmc0 at octmmc0: 8-bit, mmc high-speed
sdmmc1 at octmmc0: 8-bit, mmc high-speed
"spi" at simplebus0 not configured
"ocla0" at simplebus0 not configured
"dma-engine" at simplebus0 not configured
"dma-engine" at simplebus0 not configured
octpcie0 at iobus0: 3 ports
octpcie0 port 0: link timeout
octpcie0 port 1: link timeout
octpcie0 port 2: reset timeout
uhub2 at uhub0 port 1 configuration 1 interface 0 "Terminus Technology USB
2.0 Hub" rev 2.00/1.11 addr 2
umass0 at uhub2 port 1 configuration 1 interface 0 "Samsung Flash Drive"
rev 2.10/11.00 addr 3
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <Samsung, Flash Drive, 1100> removable
serial.090c1000418120001168
panic: _dmamap_sync: ran off map!
syncing disks... done
System restart.

----

Thanks,
-Allen
Reply | Threaded
Open this post in threaded view
|

Re: octeon - panic: _dmamap_sync: ran off map

Visa Hankala-2
On Sat, Feb 29, 2020 at 12:06:17PM -0700, Allen Smith wrote:
> umass0: using SCSI over Bulk-Only
> scsibus0 at umass0: 2 targets, initiator 0
> sd0 at scsibus0 targ 1 lun 0: <Samsung, Flash Drive, 1100> removable
> serial.090c1000418120001168
> panic: _dmamap_sync: ran off map!

This is caused by wrong endianess. The diff below fixes the byte
swapping of trb_flags and trb_status in xhci(4). Tested with umass only,
isochronous transfer mode is untested.

OK?

Index: dev/usb/xhci.c
===================================================================
RCS file: src/sys/dev/usb/xhci.c,v
retrieving revision 1.112
diff -u -p -r1.112 xhci.c
--- dev/usb/xhci.c 22 Feb 2020 14:01:35 -0000 1.112
+++ dev/usb/xhci.c 1 Mar 2020 11:20:47 -0000
@@ -821,9 +821,10 @@ xhci_xfer_length_generic(struct xhci_xfe
     ((xx->index + xp->ring.ntrb) - xx->ntrb) % (xp->ring.ntrb - 1);
 
  while (1) {
- type = xp->ring.trbs[trb0_idx].trb_flags & XHCI_TRB_TYPE_MASK;
+ type = letoh32(xp->ring.trbs[trb0_idx].trb_flags) &
+    XHCI_TRB_TYPE_MASK;
  if (type == XHCI_TRB_TYPE_NORMAL || type == XHCI_TRB_TYPE_DATA)
- len += le32toh(XHCI_TRB_LEN(
+ len += XHCI_TRB_LEN(letoh32(
     xp->ring.trbs[trb0_idx].trb_status));
  if (trb0_idx == trb_idx)
  break;
@@ -930,8 +931,8 @@ xhci_event_xfer_isoc(struct usbd_xfer *x
 
  /* Find the according frame index for this TRB. */
  while (trb0_idx != trb_idx) {
- if ((xp->ring.trbs[trb0_idx].trb_flags & XHCI_TRB_TYPE_MASK) ==
-    XHCI_TRB_TYPE_ISOCH)
+ if ((letoh32(xp->ring.trbs[trb0_idx].trb_flags) &
+    XHCI_TRB_TYPE_MASK) == XHCI_TRB_TYPE_ISOCH)
  frame_idx++;
  if (trb0_idx++ == (xp->ring.ntrb - 1))
  trb0_idx = 0;
@@ -942,7 +943,7 @@ xhci_event_xfer_isoc(struct usbd_xfer *x
  * check if the first TRB needs accounting since it might not have
  * raised an interrupt in case of full data received.
  */
- if ((xp->ring.trbs[trb_idx].trb_flags & XHCI_TRB_TYPE_MASK) ==
+ if ((letoh32(xp->ring.trbs[trb_idx].trb_flags) & XHCI_TRB_TYPE_MASK) ==
     XHCI_TRB_TYPE_NORMAL) {
  frame_idx--;
  if (trb_idx == 0)
@@ -950,13 +951,13 @@ xhci_event_xfer_isoc(struct usbd_xfer *x
  else
  trb0_idx = trb_idx - 1;
  if (xfer->frlengths[frame_idx] == 0) {
- xfer->frlengths[frame_idx] =
-    XHCI_TRB_LEN(xp->ring.trbs[trb0_idx].trb_status);
+ xfer->frlengths[frame_idx] = XHCI_TRB_LEN(letoh32(
+    xp->ring.trbs[trb0_idx].trb_status));
  }
  }
 
  xfer->frlengths[frame_idx] +=
-    XHCI_TRB_LEN(xp->ring.trbs[trb_idx].trb_status) - remain;
+    XHCI_TRB_LEN(letoh32(xp->ring.trbs[trb_idx].trb_status)) - remain;
  xfer->actlen += xfer->frlengths[frame_idx];
 
  if (xx->index != trb_idx)