This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRA829V-Q1: mtdoops: Cannot write from panic without panic_write

Part Number: DRA829V-Q1

Hi,

I am trying to use mtdoops, but the panic_write functionality is missing.

In kernel cmdline I have this:

mtdoops.mtddev=8

During bootup:
kernel: mtdoops: ready 0, 1 (no erase)
kernel: mtdoops: Attached to MTD device 8

Then I trigger a panic:
# echo c > /proc/sysrq-trigger

..which ends up with the error message:
"mtdoops: Cannot write from panic without panic_write"

How can I get the needed panic_write functionality?

  • Hi Tobias,

    A few details will below will be helpful for us to reproduce the issue:

    • The SDK version you are using?
    • Boot media?
    • Is this a custom board?

    I tried on TI DRA829-EVM:

    echo c > /proc/sysrq-trigger
    [ 8100.637705] sysrq: Trigger a crash
    [ 8100.641116] Kernel panic - not syncing: sysrq triggered crash
    [ 8100.646846] CPU: 1 PID: 1360 Comm: sh Tainted: G           O       6.1.33-g8f7f371be2 #1
    [ 8100.654917] Hardware name: Texas Instruments J721e EVM (DT)
    [ 8100.660471] Call trace:
    [ 8100.662905]  dump_backtrace.part.0+0xdc/0xf0
    [ 8100.667172]  show_stack+0x18/0x30
    [ 8100.670476]  dump_stack_lvl+0x68/0x84
    [ 8100.674128]  dump_stack+0x18/0x34
    [ 8100.677431]  panic+0x184/0x344
    [ 8100.680475]  sysrq_handle_crash+0x1c/0x20
    [ 8100.684474]  __handle_sysrq+0x8c/0x19c
    [ 8100.688211]  write_sysrq_trigger+0x74/0xa0
    [ 8100.692294]  proc_reg_write+0xa4/0x100
    [ 8100.696032]  vfs_write+0xc4/0x2b0
    [ 8100.699337]  ksys_write+0x68/0xf4
    [ 8100.702639]  __arm64_sys_write+0x1c/0x2c
    [ 8100.706548]  invoke_syscall+0x48/0x114
    [ 8100.710286]  el0_svc_common.constprop.0+0xd4/0xfc
    [ 8100.714974]  do_el0_svc+0x30/0xd0
    [ 8100.718277]  el0_svc+0x2c/0x84
    [ 8100.721319]  el0t_64_sync_handler+0xbc/0x140
    [ 8100.725573]  el0t_64_sync+0x18c/0x190
    [ 8100.729222] SMP: stopping secondary CPUs
    [ 8100.733140] Kernel Offset: disabled
    [ 8100.736613] CPU features: 0x20000,20028084,0000420b
    [ 8100.741475] Memory Limit: none
    [ 8100.744518] ---[ end Kernel panic - not syncing: sysrq triggered crash ]---

    No issues seen.

    - Keerthy

  • Hi,

    Thanks for trying to assist me on this.

    Looks like you do not have mtdoops enabled though?

    To enable you would need this in kernel config:
    CONFIG_MTD_OOPS=y

    And you need an MTD partition (/dev/mtd8 in my case) that is "pointed to" in kernel cmdline:

    mtdoops.mtddev=8

    If you would do that, I guess you would be able to see the same error as me?

     

    Booting from QSPI/eMMC on a custom board.

    Building using Bitbake/Yocto, using a kernel provided by TI: git://git.ti.com/ti-linux-kernel/ti-linux-kernel

    BR

    Tobias

  • Hi Tobias,

    I checked with our NOR expert.

    Spi-nor framework does not have the support now for the panic_write. It seems like drivers/mtd/nand/raw/nand_base.c
    Nand driver has support:

    mtd->_panic_write = panic_nand_write;

    That said no support on spi-nor.

    Best Regards,
    Keerthy

  • Hi,

    Yes, I was expecting that the panic_write was not supported, since I got the error message

    and did not see any panic_ functions in the driver.

    Thanks for confirming.

    Unfortunately not possible to switch to NAND memory.

    So now I will hope that someone has implemented the panic_ functions for NOR, and is willing to share :)

    BR

    Tobias

  • Tobias,

    It's not part of the spi-nor framework. So closing this.

    Best Regards,

    Keerthy