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.

SK-AM62B: kernel set cpu1/2/3 offline success but set online fail

Part Number: SK-AM62B

reproduce steps:

  1. # cat /proc/cmdline
    console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=PARTUUID=df340b09-02 rw rootfstype=ext4 rootwait
  2. # uname -a
    Linux am62xx-evm 5.10.168-rt83-gc1a1291911 #1 SMP PREEMPT_RT Fri Feb 24 05:50:07 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
  3. already see CONFIG_HOTPLUG_CPU=y in /proc/config.gz
  4. # cat /sys/devices/system/cpu/cpu2/online
    1
    # echo 0 >   /sys/devices/system/cpu/cpu2/online
    # cat /sys/devices/system/cpu/cpu2/online
    0
    # echo 1 > /sys/devices/system/cpu/cpu2/online
    -sh: echo: write error: Input/output error
  5. kernel show following message in step 4.
    [ 4908.895237] IRQ 224: no longer affine to CPU2
    [ 4908.895502] CPU2: shutdown
    [ 4908.896538] psci: CPU2 killed (polled 0 ms)
    [ 5001.957377] CPU2: failed to come online
    [ 5001.957404] CPU2: failed in unknown state : 0x0
  6. echo 1 > /sys/devices/system/cpu/cpu2/online
    -sh: echo: write error: Invalid argument
  7. kernel show followin message in stap 6.
    [ 5323.501777] psci: failed to boot CPU2 (-22)
    [ 5323.501801] CPU2: failed to boot: -22
  • Hi Chunhung,

    This is an known issue in SDK v8.6. It will be fixed in SDK v9.0.

  • Hi Bin,

    Is it related to security feature?

    CPU on Fail:

    2AP1LMS
    XAM6254A TCGHAALW
    SITARA
    G1

    CPU on OK:

    2BP1HFS
    AM6254A TCGGAALW
    SITARA
    G1

  • Hi Chunhung,

    Do you mean the function is broken on the first device, but not on the second one? I don't think it is related to security feature, it should be just a software bug.

  • Do you mean the function is broken on the first device, but not on the second one?

    => Yes, this function FAILED on chip 2AP1LMS XAM6254A TCGHAALW, but PASS on chip 2BP1HFS AM6254A TCGGAALW

  • I don't have a board with "TCGGAALW" device to validate this, but not sure why it would pass on security device. I think this function works in SDK8.3 but broken on SDK8.6.

  • I encountered a similar problem when testing rtcwakeup on sk-am62evm, using the SDK8.5 image to test according to the document, the following printing appeared and the system was stuck in about ten seconds. Is this a known problem

    root@am62xx-evm:~# rtcwake -s 10 -m mem
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Dec 14 12:12:19 2022
    [ 23.392854] PM: suspend entry (deep)
    [ 23.396656] Filesystems sync: 0.000 seconds
    [ 23.406860] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [ 23.415654] OOM killer disabled.
    [ 23.418925] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [ 23.427696] printk: Suspending console(s) (use no_console_suspend to debug)
    I/ˋV,TUnitializing
    I/TC: Secondary CPU 1 switching to normal world boot
    I/TC: Secondary CPU 2 initializing
    I/TC: Secondary CPU 2 switching to normal world boot
    I/TC: Secondary CPU 3 initializing
    I/TC: Secondary CPU 3 switching to normal world boot
    [ 23.603358] Disabling non-boot CPUs ...
    [ 23.607081] CPU1: shutdown
    [ 23.607122] psci: CPU1 killed (polled 0 ms)
    [ 23.615767] CPU2: shutdown
    [ 23.616864] psci: CPU2 killed (polled 0 ms)
    [ 23.624752] CPU3: shutdown
    [ 23.624790] psci: CPU3 killed (polled 0 ms)
    [ 23.630339] Enabling non-boot CPUs ...
    [ 28.726466] CPU1: failed to come online
    [ 28.726489] CPU1: failed in unknown state : 0x0
    [ 28.729738] Error taking CPU1 up: -5
    [ 33.846453] CPU2: failed to come online
    [ 33.846477] CPU2: failed in unknown state : 0x0
    [ 33.849112] Error taking CPU2 up: -5
    [ 38.966451] CPU3: failed to come online
    [ 38.966473] CPU3: failed in unknown state : 0x0
    [ 38.968989] Error taking CPU3 up: -5
    [ 39.770469] am65-cpsw-nuss 8000000.ethernet: down msc_sl e0000000 tmo 0
    [ 39.775840] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    [ 39.794622] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)
    [ 39.794686] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
    [ 39.798738] am65-cpsw-nuss 8000000.ethernet: down msc_sl e0000000 tmo 0
    [ 39.812531] am65-cpsw-nuss 8000000.ethernet eth1: PHY [8000f00.mdio:01] driver [TI DP83867] (irq=POLL)
    [ 39.812575] am65-cpsw-nuss 8000000.ethernet eth1: configuring for phy/rgmii-rxid link mode
    [ 40.125327] OOM killer enabled.
    [ 40.129069] Restarting tasks ... done.
    [ 40.485896] PM: suspend exit
    root@am62xx-evm:~# ls