Skip to content

Kernel Oops / segfault when loading dw_apb_raw_uart (piVCCU DKMS) on Armbian 6.12.58-current-sunxi (armv7l, Banana Pi M2+ / H3) #573

@maxl95

Description

@maxl95

Hi,
I’m trying to run piVCCU on a Banana Pi M2+ (Allwinner H3, armv7l) with Armbian and I can reproduce a kernel Oops when the piVCCU UART driver (dw_apb_raw_uart) is loaded.
I created a new DTS file based on the Orange Pi H3 and adapted detect_board.inc. After that, I generated the packages using create_devicetree_armbian.sh and create_modules_dkms.sh and then installed them successfully. After I load the dw_apb_raw_uart module, the kernel oops attached below occurs.
Maybe someone can lend me a hand so that I can get the problem under control. I would be very grateful for that!
If any further relevant information is needed, I will of course be happy to provide it.

Environment:

  • Board: Banana Pi M2+ (Allwinner H3)
  • Armbian: Armbian 25.11.2 trixie
  • Kernel: 6.12.58-current-sunxi
  • Architecture: armv7l
  • piVCCU modules: pivccu-modules-dkms 1.0.87

custom DTS-File:

/dts-v1/;
/plugin/;

/ {
  compatible = "sinovoip,bpi-m2-plus", "allwinner,sun8i-h3";

  fragment@0 {
    target = <&uart3>;
    __overlay__ {
      pinctrl-names = "default";
      pinctrl-0 = <&uart3_pins>;
      status = "okay";
      compatible = "pivccu,dw_apb";
      pivccu,reset-gpios = <&pio 0 10 0>, <&pio 0 16 0>;
      pivccu,rtc = <&rpi_rf_mod_rtc>;
    };
  };


  fragment@1 {
    target = <&i2c0>;
    __overlay__ {
      #address-cells = <1>;
      #size-cells = <0>;
      status = "okay";

      rpi_rf_mod_rtc: rx8130@32 {
        compatible = "epson,rx8130-legacy";
        reg = <0x32>;
        status = "okay";
        aux-voltage-chargeable = <1>;
        enable-external-capacitor;
      };
    };
  };
};

edited detect_board.inc:

if [ ! -z "$1" ]; then
  DEV_TREE_COMPATIBLE="$1"
elif [ -e /proc/device-tree/compatible ]; then
  DEV_TREE_COMPATIBLE=$(strings /proc/device-tree/compatible)
fi

if [ ! -z "$DEV_TREE_COMPATIBLE" ]; then
  for str in $DEV_TREE_COMPATIBLE; do
    case $str in
      xunlong,orangepi-one|xunlong,orangepi-lite|xunlong,orangepi-plus|xunlong,orangepi-plus2e|xunlong,orangepi-2|xunlong,orangepi-pc|xunlong,orangepi-pc-plus)
        OVERLAY_MODE='overlay'
        OVERLAY_FILE='pivccu-orangepi-h3.dtbo'
        break
        ;;
      xunlong,orangepi-zero|xunlong,orangepi-r1)
        OVERLAY_MODE='overlay'
        OVERLAY_FILE='pivccu-orangepi-h2plus.dtbo'
        break
        ;;
      xunlong,orangepi-zero-plus)
        OVERLAY_MODE='overlay'
        OVERLAY_FILE='pivccu-orangepi-h5.dtbo'
        break
        ;;
      lemaker,bananapi)
        OVERLAY_MODE='overlay'
        OVERLAY_FILE='pivccu-bananapi-m1.dtbo'
        break;
        ;;
      sinovoip,bpi-m2-plus)
        OVERLAY_MODE='overlay'
        OVERLAY_FILE='pivccu-bananapi-m2plus.dtbo'
        break
        ;;
      lemaker,bananapro)
        OVERLAY_MODE='overlay'
        OVERLAY_FILE='pivccu-bananapi-pro.dtbo'
        break;
        ;;
      asus,rk3288-tinker|asus,rk3288-tinker-s)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/tinkerboard.dts.include'
        FDT_FILE='rk3288-tinker.dtb rk3288-tinker-s.dtb'
        break
        ;;
      pine64,rock64)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/rock64.dts.include'
        FDT_FILE='rockchip/rk3328-rock64.dtb'
        break
        ;;
      pine64,rockpro64)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/rockpro64.dts.include'
        FDT_FILE='rockchip/rk3399-rockpro64.dtb'
        break
        ;;
      hardkernel,odroid-c2)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/odroidc2.dts.include'
        FDT_FILE='amlogic/meson-gxbb-odroidc2.dtb'
        break
        ;;
      hardkernel,odroid-c4)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/odroidc4.dts.include'
        FDT_FILE='amlogic/meson-sm1-odroid-c4.dtb'
        break
        ;;
      libretech,cc|libretech,aml-s905x-cc)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/lepotato.dts.include'
        FDT_FILE='amlogic/meson-gxl-s905x-libretech-cc.dtb'
        break
        ;;
      friendlyelec,nanopc-t4|friendlyarm,nanopc-t4)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/nanopct4.dts.include'
        FDT_FILE='rockchip/rk3399-nanopc-t4.dtb'
        break
        ;;
      friendlyelec,nanopi-m4|friendlyarm,nanopi-m4)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/nanopim4.dts.include'
        FDT_FILE='rockchip/rk3399-nanopi-m4.dtb'
        break
        ;;
      radxa,rockpi4)
        OVERLAY_MODE='patch'
        INCLUDE_FILE='/var/lib/piVCCU/dts/rockpi4.dts.include'
        FDT_FILE='rockchip/rk3399-rock-pi-4.dtb'
        break
        ;;
    esac
  done
fi

case "$OVERLAY_MODE" in
  patch)
    CONFIG_FDT_FILE=`grep -e '^fdt_file=' /boot/armbianEnv.txt | cut -d= -f2`
    if [ ! -z "$CONFIG_FDT_FILE" ]; then
      FDT_FILE=$CONFIG_FDT_FILE
    fi

    CONFIG_FDT_FILE=`grep -e '^fdtfile=' /boot/armbianEnv.txt | cut -d= -f2`
    if [ ! -z "$CONFIG_FDT_FILE" ]; then
      FDT_FILE=$CONFIG_FDT_FILE
    fi

    if [ -z "$FDT_FILE" ]; then
      echo "piVCCU: Error! Current FDT could not be determined"
      exit
    fi

    if [ -z "$INCLUDE_FILE" ]; then
      echo "piVCCU: Error! Hardware platform is not supported"
      exit
    fi
    ;;

  overlay)
    if [ -z "$OVERLAY_FILE" ]; then
      echo "piVCCU: Error! Hardware platform is not supported"
      exit
    fi
    OVERLAY=`basename "$OVERLAY_FILE" .dtbo`
    ;;

  *)
    echo "piVCCU: Error! Hardware platform is not supported"
    exit
    ;;
esac

Kernel-oops:

root@BPI-M2plus:~# modprobe dw_apb_raw_uart
[  421.420663] Internal error: Oops: 5 [#1] SMP THUMB2
[  421.425630] Modules linked in: generic_raw_uart(O) aes_arm_bs crypto_simd aes_arm ccm brcmfmac_wcc snd_soc_hdmi_codec hci_uart btrtl btbcm bluetooth lima ecdh_generic sunxi_cir ecc rtl8187 gpu_sched dw_hdmi_i2s_audio eeprom_93cx6 dw_hdmi_cec drm_shmem_helper mac80211 libarc4 brcmfmac sun8i_thermal brcmutil sunxi_cedrus(C) v4l2_mem2mem binfmt_misc videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc display_connector cpufreq_dt zram 842_decompress 842_compress cfg80211 rfkill evdev usb_f_eem g_ether usb_f_rndis u_ether libcomposite nfnetlink ip_tables x_tables autofs4 sunxi phy_generic pwrseq_simple uio_pdrv_genirq gpio_keys uio realtek ac200_phy
[  421.486120] CPU: 2 UID: 0 PID: 1644 Comm: modprobe Tainted: G         C O       6.12.58-current-sunxi #1
[  421.495707] Tainted: [C]=CRAP, [O]=OOT_MODULE
[  421.500108] Hardware name: Allwinner sun8i Family
[  421.504845] PC is at resolve_symbol+0xd8/0x2d0
[  421.509356] LR is at bsearch+0x2f/0x40
[  421.513154] pc : [<c0193f54>]    lr : [<c05fe853>]    psr: 30070033
[  421.519458] sp : f1f6dda8  ip : 00000007  fp : f14edc64
[  421.524720] r10: bfb9c8e7  r9 : bfb9c00c  r8 : f14ecc4c
[  421.529976] r7 : f1f6de68  r6 : bfb9a504  r5 : bfb9a240  r4 : bfc20240
[  421.536507] r3 : 7f7b4a91  r2 : 00000000  r1 : bfb9c8e7  r0 : 00000001
[  421.543040] Flags: nzCV  IRQs on  FIQs on  Mode SVC_32  ISA Thumb  Segment none
[  421.550372] Control: 50c5387d  Table: 4685c06a  DAC: 00000051
[  421.556142] Register r0 information: non-paged memory
[  421.561235] Register r1 information: 1-page vmalloc region starting at 0xbfb9c000 allocated at load_module+0x525/0x16ec
[  421.572106] Register r2 information: NULL pointer
[  421.576845] Register r3 information: non-paged memory
[  421.581903] Register r4 information: 1-page vmalloc region starting at 0xbfc20000 allocated at load_module+0x525/0x16ec
[  421.592705] Register r5 information: 1-page vmalloc region starting at 0xbfb9a000 allocated at load_module+0x525/0x16ec
[  421.603500] Register r6 information: 1-page vmalloc region starting at 0xbfb9a000 allocated at load_module+0x525/0x16ec
[  421.614295] Register r7 information: 2-page vmalloc region starting at 0xf1f6c000 allocated at kernel_clone+0x47/0x2a0
[  421.625009] Register r8 information: 3-page vmalloc region starting at 0xf14eb000 allocated at kernel_read_file+0x1e3/0x21c
[  421.636158] Register r9 information: 1-page vmalloc region starting at 0xbfb9c000 allocated at load_module+0x525/0x16ec
[  421.646953] Register r10 information: 1-page vmalloc region starting at 0xbfb9c000 allocated at load_module+0x525/0x16ec
[  421.657834] Register r11 information: 3-page vmalloc region starting at 0xf14eb000 allocated at kernel_read_file+0x1e3/0x21c
[  421.669064] Register r12 information: non-paged memory
[  421.674210] Process modprobe (pid: 1644, stack limit = 0x00f6e06f)
[  421.680399] Stack: (0xf1f6dda8 to 0xf1f6e000)
[  421.684764] dda0:                   c01932ad f14ecc4c 00000101 bfb9a240 00000000 bfb9c00c
[  421.692947] ddc0: 00000000 80a2e18a c01932ad bfc20240 f14ecc4c 0000004c 00000750 bfc2024c
[  421.701129] dde0: bfc264c4 f1f6dee8 f14edc64 c0195583 f1f6de98 00000000 00000000 c02ed345
[  421.709313] de00: c18e0378 00000000 00000001 c5450000 bfc2033c bfc20240 00000000 c0e526ac
[  421.717495] de20: c0e526f4 00000000 00000000 c1781a98 0000001c 00000001 00000000 004452c0
[  421.725677] de40: 00000000 00000000 00000000 00004004 00000000 c0322d69 00000000 80a2e18a
[  421.733860] de60: 00000000 7fffd323 6e72656b 00006c65 00000000 00000000 00000000 00000000
[  421.742042] de80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  421.750225] dea0: 00000000 80a2e18a 00001168 00000000 f14eb000 004452c0 c4a33840 c4a33840
[  421.758409] dec0: 00000000 c18e0388 004452c0 c0196043 f1f6dee4 7fffffff 00000000 00000002
[  421.766591] dee0: c5b883f8 f14eb000 f14ec037 f14eb9f0 f14eb000 00002cdc f14ed6c4 f14ed544
[  421.774774] df00: f14ec89c 00000548 00000678 00000e0c 000007ec 00000000 00000dfc 00000024
[  421.782957] df20: 00000025 0000000f 00000000 0000001c 00000000 80a2e18a 0000007d c18e0378
[  421.791139] df40: 00000001 c019632b 00000000 00000000 0113b428 c5b883f8 000a0000 c5b883f8
[  421.799321] df60: 00000000 c18e057c 00000000 00000000 f1f6df70 f1f6df70 fffffffc 80a2e18a
[  421.807505] df80: 00000006 0043f613 00000000 6120cd00 0000017b c01002a0 c5450000 0000017b
[  421.815689] dfa0: 00000000 c0100061 0043f613 00000000 00000004 004452c0 00000000 0113b560
[  421.823871] dfc0: 0043f613 00000000 6120cd00 0000017b 0113b428 0113b380 00000000 00000000
[  421.832055] dfe0: be9a5098 be9a5088 0043ff89 b6bb32d2 40070030 00000004 00000000 00000000
[  421.840233] Call trace:
[  421.840248]  resolve_symbol from load_module+0xc87/0x16ec
[  421.848199]  load_module from init_module_from_file+0x5b/0x84
[  421.853962]  init_module_from_file from sys_finit_module+0x13b/0x210
[  421.860332]  sys_finit_module from ret_fast_syscall+0x1/0x5c
[  421.866004] Exception stack(0xf1f6dfa8 to 0xf1f6dff0)
[  421.871063] dfa0:                   0043f613 00000000 00000004 004452c0 00000000 0113b560
[  421.879246] dfc0: 0043f613 00000000 6120cd00 0000017b 0113b428 0113b380 00000000 00000000
[  421.887427] dfe0: be9a5098 be9a5088 0043ff89 b6bb32d2
[  421.892488] Code: e050 681b 42b3 d04d (691a) 4294
[  421.897353] ---[ end trace 0000000000000000 ]---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions