Suspend - Resume in Hikey960 platform


#21

Hi Leo,
Thanks! I could now build boot.img that using UEFI+ARM-TF booting image.

Now, it showed the following messages after executing “echo mem>/sys/power/state”
[ 55.007433] PM: suspend entry 1970-01-01 03:52:14.418230201 UTC
[ 55.013407] PM: Syncing filesystems … done.
[ 55.028271] Freezing user space processes … (elapsed 0.002 seconds) done.
[ 55.038191] Freezing remaining freezable tasks … (elapsed 0.001 seconds) done.
[ 55.047252] Suspending console(s) (use no_console_suspend to debug)

However, there is system hang after it. Is it the same bug as you mentioned in https://bugs.96boards.org/show_bug.cgi?id=550 ?


#22

Yes, this is the same issue with bug 550.

Hisilicon provides one ARM-TF patch to fix hang issue; you also need disable I2C runtime PM functions, if I get formal patch for I2C runtime PM patch, will share at here as well.

From: Tao Wang <kevin.wangtao@linaro.org>

clear cpuidle flag when resume from idle, this flag will make
cpu suspend stuck at wfi loop.
---
 plat/hisilicon/hikey960/hikey960_pm.c | 5 +++++
 1 file changed, 5 insertions(+)
 mode change 100644 => 100755 plat/hisilicon/hikey960/hikey960_pm.c

diff --git a/plat/hisilicon/hikey960/hikey960_pm.c b/plat/hisilicon/hikey960/hikey960_pm.c
old mode 100644
new mode 100755
index 3447c9f..212358e
--- a/plat/hisilicon/hikey960/hikey960_pm.c
+++ b/plat/hisilicon/hikey960/hikey960_pm.c
@@ -250,9 +250,14 @@ static void
 hikey960_pwr_domain_suspend_finish(const psci_power_state_t *target_state)
 {
        unsigned long mpidr = read_mpidr_el1();
+       unsigned int core = mpidr & MPIDR_CPU_MASK;
        unsigned int cluster =
                (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS;

+       hisi_cpuidle_lock(cluster, core);
+       hisi_clear_cpuidle_flag(cluster, core);
+       hisi_cpuidle_unlock(cluster, core);
+
        /* Nothing to be done on waking up from retention from CPU level */
        if (CORE_PWR_STATE(target_state) != PLAT_MAX_OFF_STATE)
                return;

#23

Hi Leo-yan,

I followed all steps mentioned in below link to switch to UEFI+ARM-TF booting images.
README-ATF-UEFI-build-from-source.md

I am Getting below error on normal boot -

C0R,V0x00000017 e:66
iomcu_subsys_init
boot_c0 PROFILE 4
slave0 irq0:0x00000004
slave1 irq0:0x00000004
NOTICE: Booting Trusted Firmware
NOTICE: BL1: v1.4(release):v1.4-338-g8705ec8
NOTICE: BL1: Built : 12:49:55, Nov 9 2017
ERROR: Failed to load BL2 firmware.

I am not seeing below prompt on console-
When prompt ‘.’ is displayed on console, press hotkey ‘f’ in keyboard. Then Android fastboot app is running.
The timeout of prompt ‘.’ is 10 seconds.

And also prm_ptable.img is not found.
$sudo fastboot flash ptable prm_ptable.img

I am able to able to generate boot.img with your ramdisk image.
Not sure what I am doing wrong here, please suggest.

Thanks


#24

Hi @Anonymous,

I am sorry if this is introduced by regression of sec_xloader.img, from the log I think the first thing should try is to rolllback to use one older sec_xloader.img. So could you try below sec_xloader.img:

http://builds.96boards.org/snapshots/reference-platform/components/uefi-staging/23/hikey960/release/sec_xloader.img

And also prm_ptable.img is not found.
$sudo fastboot flash ptable prm_ptable.img

Could you check if the script has executed below code?

With this command, you should can see prm_table.img in the folder “l-loader”.


#25

Hi Leo-yan,

Same error is seen with below sec_xloader.img also :
http://builds.96boards.org/snapshots/reference-platform/components/uefi-staging/23/hikey960/release/sec_xloader.img

And prm_ptable.img is present in ‘l-loader’ folder.
But on trying to flash - fastboot flash ptable prm_ptable.img
Its getting stuck, not proceeding further -

target reported max download size of 134217728 bytes
sending ‘ptable’ (24 KB)…
fastboot flash ptable prm_ptable.img

Thanks


#26

@Anonymous, I can reproduce this issue now. Will come back if have any finding.


#27

I think the root cause is below patch in OpenPlatformPkg; You could firstly revert this patch and I verified after reverting the system can boot well.

BTW, I fill one bug for this: https://bugs.96boards.org/show_bug.cgi?id=645.

commit 38853ff1b484ce971fa80aacecf818119e40aba2
Author: Haojian Zhuang <haojian.zhuang@linaro.org>
Date:   Tue Nov 7 13:29:03 2017 +0800

    Drivers/DwUsb3Dxe: increate data buffer from 512B to 128KB
    
    Increase the data buffer from 512B to 128KB. It could improve
    the performance of usb transmission.
    
    Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

#28

Hi Leo-yan,

Thanks for your inputs.
As you suggested, reverted the above patch then system boots up.
But system is going to suspend state but not resuming back, even after applying your patch to “plat/hisilicon/hikey960/hikey960_pm.c” file.
Please suggest.

Logs :
hikey960:/ # echo +5 > /sys/class/rtc/rtc1/wakealarm
hikey960:/ #
hikey960:/ # echo mem > /sys/power/state
[ 70.334658] PM: suspend entry 1970-01-01 00:01:17.782428116 UTC
[ 70.340774] PM: Syncing filesystems … done.
[ 70.349545] Freezing user space processes … (elapsed 0.001 seconds) done.
[ 70.358583] Freezing remaining freezable tasks … (elapsed 0.001 seconds) done.
[ 70.367940] Suspending console(s) (use no_console_suspend to debug)

Thanks,
Anil


#29

Hi Anil,

Before kernel 4.4 can suspend/resume, I can reproduce this issue at my side, thanks for reporting!

  • Checked kernel 4.9 and latest ARM-TF, all the patches have been merged into repository;
  • Tried to set “dev->pm_runtime_disabled” to true in file drivers/i2c/busses/i2c-designware-platdrv.c, but the issue still exists;
  • Tried to set “no_console_suspend” in command line, the issue still exists;
  • The log sometimes reports the RCU stall, so I firstly hotplugged off all secondary CPUs, still cannot resume back;

John have filed one bug for this: https://bugs.96boards.org/show_bug.cgi?id=611, I will dig into this as well and come back if have any update.


#30

Hi Leo-yan,

Before kernel 4.4 can suspend/resume, I can reproduce this issue at my side, thanks for reporting!

Do you mean it works with kernel 4.4? I tried with 4.4.82 the same issue is seen.

Thanks


#31

Hi Leo-yan,

With UEFI+ARM-TF booting images, pci device is not getting enumerated.
lspci is not showing connected pci device.
Please suggest.

Thanks


#32

Hi @Anonymous, could you file a bug with more detailed info for pci device (e.g. Kernel version, Android or Debian or OE, etc, which PCI device) [1]? Or you could give more info at here and I file bug with these info.

I checked PCI with landing team, it’s likely PCI has been missed for testing with UEFI-ARM-TF.

[1] https://bugs.96boards.org/enter_bug.cgi?product=HiKey960


#33

Hi @Anonymous,

Now can narrow down suspend stuck issue is related with GPIO19, so at my side I can use below patch as workaround for suspend/resume flow:

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 6e3c143..ed2dbfe 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -379,6 +379,8 @@ static int pl061_suspend(struct device *dev)
        struct pl061_gpio *chip = dev_get_drvdata(dev);
        int offset;
 
+       return 0;
+
        chip->csave_regs.gpio_data = 0;
        chip->csave_regs.gpio_dir = readb(chip->base + GPIODIR);
        chip->csave_regs.gpio_is = readb(chip->base + GPIOIS);
@@ -400,6 +402,8 @@ static int pl061_resume(struct device *dev)
        struct pl061_gpio *chip = dev_get_drvdata(dev);
        int offset;
 
+       return 0;
+
        for (offset = 0; offset < PL061_GPIO_NR; offset++) {
                if (chip->csave_regs.gpio_dir & (BIT(offset)))
                        pl061_direction_output(&chip->gc, offset,

I checked the clock setting for GPIO19, the clock has been enabled properly. So this means except this clock setting, there have other configurations we are missing so cannot access GPIO19 registers properly. I have updated bug tracking: https://bugs.96boards.org/show_bug.cgi?id=611 for following up investigation.


#34

Hi Leo-yan,

Thanks for your support.
I will verify on my side and update you now.

Thanks


#35

Hi Leo-yan,

With above patch also I am seeing the same issue.
System is not resuming back.

echo mem > /sys/power/state
[ 56.847815] PM: suspend entry 1970-01-01 00:02:17.507680722 UTC
[ 56.854043] PM: Syncing filesystems … done.
[ 56.868432] Freezing user space processes … (elapsed 0.002 seconds) done.
[ 56.879627] Freezing remaining freezable tasks … (elapsed 0.002 seconds) done.
[ 56.889395] Suspending console(s) (use no_console_suspend to debug)

Thanks


#36

Hi @Anonymous,

You could enable below debugging configurations for debugging suspend/resume flow:

  1. Enable debug configurations in kernel config:

CONFIG_PM_DEBUG=y
CONFIG_PM_SLEEP_DEBUG=y

  1. Disable console suspend by using kernel command line:

In the file bootimg-960.cfg, you need add “no_console_suspend” at the line of cmdline:

cmdline = loglevel=15 androidboot.hardware=hikey960 androidboot.selinux=permissive firmware_class.path=/system/etc/firmware no_console_suspend

  1. After system boot up, you need enable debugging switch by:

echo 1 > /sys/power/pm_print_times

  1. After system suspend, you could see which callback functions is called and introduce hang issue.

#37

Ah, have you disconnect USB OTG cable?

At my side, I need connect USB OTG cable so USB cannot be suspended, so if you connect USB you can see the CPU can execute system suspend flow and can resume back.


#38

Hi Leo-yan,

I have connected both USB OTG and serial cable.
I am seeing below error now :

130|hikey960:/ #
130|hikey960:/ # echo 10 > /sys/class/rtc/rtc1/wakealarm
hikey960:/ #
hikey960:/ # echo mem > /sys/power/state
[ 112.279694] PM: suspend entry 1970-01-01 00:02:11.248019776 UTC
[ 112.285890] PM: Syncing filesystems … done.
[ 112.298098] Freezing user space processes … (elapsed 0.002 seconds) done.
[ 112.307863] Freezing remaining freezable tasks … (elapsed 0.002 seconds) done.
[ 112.317863] hisi_dwc3_prepare: device state.
[ 112.322248] [dwc3_otg_work]+
[ 112.325217] [dwc3_otg_stop_peripheral]+
[ 112.329294] android_work: sent uevent USB_STATE=DISCONNECTED
[ 112.335101] [dwc3_otg_stop_peripheral]-
[ 112.339018] [dwc3_suspend_device]+
[ 112.342623] [dwc3_runtime_idle]+
[ 112.345895] [dwc3_runtime_suspend]+
[ 112.349423] [dwc3_runtime_suspend]-
[ 112.352965] [dwc3_runtime_idle]-
[ 112.356228] [dwc3_suspend_device]dwc3_suspend_device: 1
[ 112.361509] [dwc3_suspend_device]-
[ 112.364945] [dwc3_otg_work]-
[ 112.372943] ------------[ cut here ]------------
[ 112.377604] WARNING: at drivers/clk/clk.c:680
[ 112.382000] Modules linked in:
[ 112.385082]
[ 112.386585] CPU: 5 PID: 2124 Comm: sh Not tainted 4.4.82-g8892910-dirty #19
[ 112.393615] Hardware name: HiKey960 (DT)
[ 112.397574] task: ffffffc0b8cec080 task.stack: ffffffc0a9798000
[ 112.403563] PC is at clk_core_disable+0x188/0x190
[ 112.408311] LR is at clk_disable+0x34/0x48
[ 112.412444] pc : [] lr : [] pstate: 80000185
[ 112.419913] sp : ffffffc0a979b990
[ 112.423254] x29: ffffffc0a979b990 x28: 0000000000000000
[ 112.428621] x27: ffffff800930e000 x26: ffffffc0b91a64c8
[ 112.433989] x25: ffffff8008641aa8 x24: ffffff800929fad0
[ 112.439356] x23: ffffff8009009b38 x22: ffffff800863484c
[ 112.444722] x21: ffffffc0b91a6410 x20: 0000000000000100
[ 112.450089] x19: ffffffc03212f100 x18: 0000000000000000
[ 112.455455] x17: 0000000000000000 x16: 0000000000000000
[ 112.460821] x15: 0000000000000016 x14: 0ffffffffffffffe
[ 112.466190] x13: 0000000000000028 x12: 0000000000000006
[ 112.471557] x11: ffffff800929f000 x10: 0000000000000000
[ 112.476924] x9 : ffffff8009275000 x8 : ffffff8009241008
[ 112.482290] x7 : 00000000000083ea x6 : ffffffc0bff52090
[ 112.487657] x5 : 0000000000000000 x4 : 0000000000000000
[ 112.493023] x3 : ffffff8009274000 x2 : ffffff800898a41c
[ 112.498390] x1 : 0000000000000001 x0 : 0000000000000000
[ 112.503759]
[ 112.503759] SP: 0xffffffc0a979b910:
[ 112.508769] b910 0863484c ffffff80 09009b38 ffffff80 0929fad0 ffffff80 08641aa8 ffffff80
[ 112.517056] b930 b91a64c8 ffffffc0 0930e000 ffffff80 00000000 00000000 a979b990 ffffffc0
[ 112.525343] b950 0898c474 ffffff80 a979b990 ffffffc0 0898c17c ffffff80 80000185 00000000
[ 112.533629] b970 09498000 ffffff80 088bcb8c ffffff80 00000000 00000080 0898c468 ffffff80
[ 112.541916] b990 a979b9b0 ffffffc0 0898c474 ffffff80 af4e6400 ffffffc0 00000100 00000000
[ 112.550203] b9b0 a979b9d0 ffffffc0 088bd570 ffffff80 af4e6400 ffffffc0 00000002 00000000
[ 112.558489] b9d0 a979b9f0 ffffffc0 08634884 ffffff80 b91a6410 ffffffc0 ffffffff ffffff80
[ 112.566776] b9f0 a979ba10 ffffffc0 08640718 ffffff80 b91a6410 ffffffc0 0947a750 ffffff80
[ 112.575064]
[ 112.575064] X6: 0xffffffc0bff52010:
[ 112.580073] 2010 08005000 ffffff80 0929fad0 ffffff80 bff4e0a0 ffffffc0 bff52090 ffffffc0
[ 112.588360] 2030 a979b850 ffffffc0 0000001e 00000000 bff52080 ffffffc0 080857fc ffffff80
[ 112.596646] 2050 a979b850 ffffffc0 00000000 00000080 a979b980 ffffffc0 088bc544 ffffff80
[ 112.604934] 2070 60000105 00000000 00000000 00000000 a979b980 ffffffc0 a979b850 ffffffc0
[ 112.613220] 2090 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.621507] 20b0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.629793] 20d0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.638080] 20f0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.646369]
[ 112.646369] X19: 0xffffffc03212f080:
[ 112.651467] f080 00000000 00000000 ffffffff ffffffff 00000000 00000000 00000000 00000000
[ 112.659753] f0a0 00000000 00000000 00000000 00000000 b919dca0 ffffffc0 af9f52a8 ffffffc0
[ 112.668039] f0c0 00000000 00000000 b0372018 ffffffc0 3212cfd0 ffffffc0 3212f1d0 ffffffc0
[ 112.676326] f0e0 00000002 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.684612] f100 090b2300 ffffff80 08d82db8 ffffff80 3212ea00 ffffffc0 00000000 00000000
[ 112.692898] f120 b919db00 ffffffc0 3212ea80 ffffffc0 00000000 00000000 00000001 00000000
[ 112.701184] f140 01e84800 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.709471] f160 00000000 00000000 00000020 00000000 00000000 00000000 00000000 00000000
[ 112.717758]
[ 112.717758] X21: 0xffffffc0b91a6390:
[ 112.722855] 6390 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.731142] 63b0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.739429] 63d0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 112.747715] 63f0 00000000 00000000 00000000 00000000 b91aae00 ffffffc0 ffffffff 00000000
[ 112.756002] 6410 b90b1c10 ffffffc0 b919d300 ffffffc0 b91aae00 ffffffc0 af4e3140 ffffffc0
[ 112.764288] 6430 af4e2038 ffffffc0 b90b1c20 ffffffc0 20b8ab00 ffffffc0 0930d140 ffffff80
[ 112.772575] 6450 b91a7640 ffffffc0 00000006 00000007 00000000 00000000 00000000 00000000
[ 112.780862] 6470 00000000 00000000 b91a6478 ffffffc0 b91a6478 ffffffc0 b8cec080 ffffffc0
[ 112.789149]
[ 112.789149] X26: 0xffffffc0b91a6448:
[ 112.794246] 6448 0930d140 ffffff80 b91a7640 ffffffc0 00000006 00000007 00000000 00000000
[ 112.802533] 6468 00000000 00000000 00000000 00000000 b91a6478 ffffffc0 b91a6478 ffffffc0
[ 112.810819] 6488 b8cec080 ffffffc0 00000000 00000000 0930d710 ffffff80 0933e3e0 ffffff80
[ 112.819106] 64a8 00000000 00000000 af4e3018 ffffffc0 00000000 00000084 01140114 00000000
[ 112.827392] 64c8 0930e348 ffffff80 af4e20d8 ffffffc0 00000000 00000000 00010001 00000000
[ 112.835679] 64e8 b91a64e8 ffffffc0 b91a64e8 ffffffc0 00000000 00000000 00000000 00000000
[ 112.843965] 6508 00000200 dead0000 00000000 00000000 fffef358 00000000 0863f8cc ffffff80
[ 112.852252] 6528 b91a6410 ffffffc0 00000002 ffffffff ffffffff 00000000 00000000 00000000
[ 112.860539]
[ 112.860539] X29: 0xffffffc0a979b910:
[ 112.865636] b910 0863484c ffffff80 09009b38 ffffff80 0929fad0 ffffff80 08641aa8 ffffff80
[ 112.873922] b930 b91a64c8 ffffffc0 0930e000 ffffff80 00000000 00000000 a979b990 ffffffc0
[ 112.882209] b950 0898c474 ffffff80 a979b990 ffffffc0 0898c17c ffffff80 80000185 00000000
[ 112.890495] b970 09498000 ffffff80 088bcb8c ffffff80 00000000 00000080 0898c468 ffffff80
[ 112.898782] b990 a979b9b0 ffffffc0 0898c474 ffffff80 af4e6400 ffffffc0 00000100 00000000
[ 112.907068] b9b0 a979b9d0 ffffffc0 088bd570 ffffff80 af4e6400 ffffffc0 00000002 00000000
[ 112.915355] b9d0 a979b9f0 ffffffc0 08634884 ffffff80 b91a6410 ffffffc0 ffffffff ffffff80
[ 112.923641] b9f0 a979ba10 ffffffc0 08640718 ffffff80 b91a6410 ffffffc0 0947a750 ffffff80
[ 112.931928]
[ 112.933425] —[ end trace 639ca8ad99574f70 ]—
[ 112.938085] Call trace:
[ 112.940550] Exception stack(0xffffffc0a979b7c0 to 0xffffffc0a979b8f0)
[ 112.947056] b7c0: ffffffc03212f100 0000008000000000 ffffffc0a979b990 ffffff800898c17c
[ 112.954964] b7e0: 0000000000000003 0000000000000000 ffffffc0a979b830 ffffff80084e0948
[ 112.962873] b800: ffffffc0a979b980 ffffff80080857b4 ffffffc0bff52080 ffffff8008085818
[ 112.970781] b820: ffffffc0a979b850 0000008000000000 ffffffc0a979b870 ffffff80084b9458
[ 112.978689] b840: ffffffc0a979b910 ffffffc0a979b960 ffffffc0b8cec080 ffffffc0b8cec080
[ 112.986597] b860: 0000000000000000 0000000000000001 ffffff800898a41c ffffff8009274000
[ 112.994506] b880: 0000000000000000 0000000000000000 ffffffc0bff52090 00000000000083ea
[ 113.002414] b8a0: ffffff8009241008 ffffff8009275000 0000000000000000 ffffff800929f000
[ 113.010322] b8c0: 0000000000000006 0000000000000028 0ffffffffffffffe 0000000000000016
[ 113.018229] b8e0: 0000000000000000 0000000000000000
[ 113.023154] [] clk_core_disable+0x188/0x190
[ 113.028956] [] clk_disable+0x34/0x48
[ 113.034148] [] dw_i2c_plat_suspend+0x30/0x48
[ 113.040043] [] platform_pm_suspend+0x38/0x6c
[ 113.045934] [] dpm_run_callback+0x3c/0x1d0
[ 113.051649] [] __device_suspend+0x130/0x3a8
[ 113.057451] [] dpm_suspend+0x124/0x37c
[ 113.062814] [] dpm_suspend_start+0x78/0x84
[ 113.068531] [] suspend_devices_and_enter+0x9c/0x324
[ 113.075034] [] pm_suspend+0x498/0x628
[ 113.080308] [] state_store+0x88/0xa4
[ 113.085497] [] kobj_attr_store+0x14/0x24
[ 113.091039] [] sysfs_kf_write+0x5c/0x6c
[ 113.096490] [] kernfs_fop_write+0xc4/0x188
[ 113.102205] [] __vfs_write+0x48/0x104
[ 113.107480] [] vfs_write+0x98/0x190
[ 113.112580] [] SyS_write+0x54/0xb0
[ 113.117593] [] el0_svc_naked+0x24/0x28
[ 113.123003] ------------[ cut here ]------------
[ 113.127664] WARNING: at drivers/clk/clk.c:575
[ 113.132059] Modules linked in:
[ 113.135142]
[ 113.136644] CPU: 5 PID: 2124 Comm: sh Tainted: G W 4.4.82-g8892910-dirty #19
[ 113.144904] Hardware name: HiKey960 (DT)
[ 113.148862] task: ffffffc0b8cec080 task.stack: ffffffc0a9798000
[ 113.154840] PC is at clk_core_unprepare+0x190/0x1a0
[ 113.159764] LR is at clk_unprepare+0x30/0x40
[ 113.164072] pc : [] lr : [] pstate: 60000105
[ 113.171541] sp : ffffffc0a979b990
[ 113.174883] x29: ffffffc0a979b990 x28: 0000000000000000
[ 113.180254] x27: ffffff800930e000 x26: ffffffc0b91a64c8
[ 113.185623] x25: ffffff8008641aa8 x24: ffffff800929fad0
[ 113.190993] x23: ffffff8009009b38 x22: ffffff800863484c
[ 113.196363] x21: ffffffc0b91a6410 x20: 0000000000000002
[ 113.201732] x19: ffffffc03212f100 x18: 0000000000000000
[ 113.207102] x17: 0000000000000000 x16: 0000000000000000
[ 113.212471] x15: 0000000000000016 x14: 0ffffffffffffffe
[ 113.217841] x13: 0000000000000028 x12: 0000000000000006
[ 113.223210] x11: ffffff800929f000 x10: 00000000000009f0
[ 113.228579] x9 : ffffffc0a979b8b0 x8 : ffffffc0b8cecad0
[ 113.233948] x7 : 0000000000000000 x6 : 0000000000000000
[ 113.239318] x5 : 00000040b6d0d000 x4 : 0000000000000002
[ 113.244688] x3 : 0000000000000002 x2 : 0000000000000000
[ 113.250057] x1 : 0000000000000001 x0 : 0000000000000000
[ 113.255427]
[ 113.255427] SP: 0xffffffc0a979b910:
[ 113.260438] b910 0863484c ffffff80 09009b38 ffffff80 0929fad0 ffffff80 08641aa8 ffffff80
[ 113.268735] b930 b91a64c8 ffffffc0 0930e000 ffffff80 00000000 00000000 a979b990 ffffffc0
[ 113.277032] b950 0898c510 ffffff80 a979b990 ffffffc0 0898bdc8 ffffff80 60000105 00000000
[ 113.285329] b970 a979b990 ffffffc0 0898a2b8 ffffff80 00000000 00000080 00000100 00000000
[ 113.293627] b990 a979b9b0 ffffffc0 0898c510 ffffff80 af4e6400 ffffffc0 00000002 00000000
[ 113.301923] b9b0 a979b9d0 ffffffc0 088bd578 ffffff80 af4e6400 ffffffc0 00000002 00000000
[ 113.310220] b9d0 a979b9f0 ffffffc0 08634884 ffffff80 b91a6410 ffffffc0 ffffffff ffffff80
[ 113.318518] b9f0 a979ba10 ffffffc0 08640718 ffffff80 b91a6410 ffffffc0 0947a750 ffffff80
[ 113.326817]
[ 113.326817] X8: 0xffffffc0b8ceca50:
[ 113.331828] ca50 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
[ 113.340124] ca70 89dae180 ffffffc0 b8cec080 ffffffc0 bff58200 ffffffc0 b8cec080 ffffffc0
[ 113.348421] ca90 ad314b40 ffffffc0 00000001 00000000 b8cec6e8 ffffffc0 bff58200 ffffffc0
[ 113.356718] cab0 08c8c7a4 ffffff80 08ca8000 ffffff80 a979b8b0 ffffffc0 a979b8b0 ffffffc0
[ 113.365016] cad0 08087164 ffffff80 b7ffaa40 0000007f 00000000 00000000 00000000 00000000
[ 113.373313] caf0 00000000 00000000 00000000 00000000 b766d6c0 0000007f 65016d01 6f006d01
[ 113.381610] cb10 00000000 00000000 6f686365 00000000 00000000 80200800 00000000 00200000
[ 113.389907] cb30 80200802 80200802 00000000 80200802 00000000 00000000 00000000 00000000
[ 113.398205]
[ 113.398205] X9: 0xffffffc0a979b830:
[ 113.403216] b830 bff58200 ffffffc0 bff58200 ffffffc0 a979b860 ffffffc0 08c90620 ffffff80
[ 113.411514] b850 bff58200 ffffffc0 bff58200 ffffffc0 00000000 00000000 00000001 00000000
[ 113.419809] b870 00000000 00000000 00000002 00000000 00000002 00000000 b6d0d000 00000040
[ 113.428107] b890 00000000 00000000 00000000 00000000 b8cecad0 ffffffc0 a979b8b0 ffffffc0
[ 113.436404] b8b0 000009f0 00000000 0929f000 ffffff80 00000006 00000000 00000028 00000000
[ 113.444701] b8d0 fffffffe 0fffffff 00000016 00000000 00000000 00000000 00000000 00000000
[ 113.452997] b8f0 00000000 00000000 3212f100 ffffffc0 00000002 00000000 b91a6410 ffffffc0
[ 113.461294] b910 0863484c ffffff80 09009b38 ffffff80 0929fad0 ffffff80 08641aa8 ffffff80
[ 113.469593]
[ 113.469593] X19: 0xffffffc03212f080:
[ 113.474692] f080 00000000 00000000 ffffffff ffffffff 00000000 00000000 00000000 00000000
[ 113.482989] f0a0 00000000 00000000 00000000 00000000 b919dca0 ffffffc0 af9f52a8 ffffffc0
[ 113.491285] f0c0 00000000 00000000 b0372018 ffffffc0 3212cfd0 ffffffc0 3212f1d0 ffffffc0
[ 113.499583] f0e0 00000002 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 113.507880] f100 090b2300 ffffff80 08d82db8 ffffff80 3212ea00 ffffffc0 00000000 00000000
[ 113.516177] f120 b919db00 ffffffc0 3212ea80 ffffffc0 00000000 00000000 00000001 00000000
[ 113.524475] f140 01e84800 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 113.532771] f160 00000000 00000000 00000020 00000000 00000000 00000000 00000000 00000000
[ 113.541068]
[ 113.541068] X21: 0xffffffc0b91a6390:
[ 113.546167] 6390 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 113.554464] 63b0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 113.562761] 63d0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 113.571058] 63f0 00000000 00000000 00000000 00000000 b91aae00 ffffffc0 ffffffff 00000000
[ 113.579356] 6410 b90b1c10 ffffffc0 b919d300 ffffffc0 b91aae00 ffffffc0 af4e3140 ffffffc0
[ 113.587653] 6430 af4e2038 ffffffc0 b90b1c20 ffffffc0 20b8ab00 ffffffc0 0930d140 ffffff80
[ 113.595951] 6450 b91a7640 ffffffc0 00000006 00000007 00000000 00000000 00000000 00000000
[ 113.604247] 6470 00000000 00000000 b91a6478 ffffffc0 b91a6478 ffffffc0 b8cec080 ffffffc0
[ 113.612546]
[ 113.612546] X26: 0xffffffc0b91a6448:
[ 113.617644] 6448 0930d140 ffffff80 b91a7640 ffffffc0 00000006 00000007 00000000 00000000
[ 113.625942] 6468 00000000 00000000 00000000 00000000 b91a6478 ffffffc0 b91a6478 ffffffc0
[ 113.634239] 6488 b8cec080 ffffffc0 00000000 00000000 0930d710 ffffff80 0933e3e0 ffffff80
[ 113.642537] 64a8 00000000 00000000 af4e3018 ffffffc0 00000000 00000084 01140114 00000000
[ 113.650833] 64c8 0930e348 ffffff80 af4e20d8 ffffffc0 00000000 00000000 00010001 00000000
[ 113.659131] 64e8 b91a64e8 ffffffc0 b91a64e8 ffffffc0 00000000 00000000 00000000 00000000
[ 113.667427] 6508 00000200 dead0000 00000000 00000000 fffef358 00000000 0863f8cc ffffff80
[ 113.675725] 6528 b91a6410 ffffffc0 00000002 ffffffff ffffffff 00000000 00000000 00000000
[ 113.684023]
[ 113.684023] X29: 0xffffffc0a979b910:
[ 113.689122] b910 0863484c ffffff80 09009b38 ffffff80 0929fad0 ffffff80 08641aa8 ffffff80
[ 113.697419] b930 b91a64c8 ffffffc0 0930e000 ffffff80 00000000 00000000 a979b990 ffffffc0
[ 113.705716] b950 0898c510 ffffff80 a979b990 ffffffc0 0898bdc8 ffffff80 60000105 00000000
[ 113.714014] b970 a979b990 ffffffc0 0898a2b8 ffffff80 00000000 00000080 00000100 00000000
[ 113.722310] b990 a979b9b0 ffffffc0 0898c510 ffffff80 af4e6400 ffffffc0 00000002 00000000
[ 113.730607] b9b0 a979b9d0 ffffffc0 088bd578 ffffff80 af4e6400 ffffffc0 00000002 00000000
[ 113.738904] b9d0 a979b9f0 ffffffc0 08634884 ffffff80 b91a6410 ffffffc0 ffffffff ffffff80
[ 113.747201] b9f0 a979ba10 ffffffc0 08640718 ffffff80 b91a6410 ffffffc0 0947a750 ffffff80
[ 113.755497]
[ 113.756996] —[ end trace 639ca8ad99574f71 ]—
[ 113.761655] Call trace:
[ 113.764119] Exception stack(0xffffffc0a979b7c0 to 0xffffffc0a979b8f0)
[ 113.770624] b7c0: ffffffc03212f100 0000008000000000 ffffffc0a979b990 ffffff800898bdc8
[ 113.778534] b7e0: ffffffc0bff58270 ffffffc0b8cec080 ffffffc0a979b870 ffffff8008102f80
[ 113.786444] b800: ffffffc0ad23ec00 ffffffc0bff58200 ffffffc0bff58200 ffffffc0b8cec080
[ 113.794353] b820: ffffffc0a979b860 ffffff8008c90614 ffffffc0bff58200 ffffffc0bff58200
[ 113.802262] b840: ffffffc0a979b860 ffffff8008c90620 ffffffc0bff58200 ffffffc0bff58200
[ 113.810171] b860: 0000000000000000 0000000000000001 0000000000000000 0000000000000002
[ 113.818081] b880: 0000000000000002 00000040b6d0d000 0000000000000000 0000000000000000
[ 113.825990] b8a0: ffffffc0b8cecad0 ffffffc0a979b8b0 00000000000009f0 ffffff800929f000
[ 113.833899] b8c0: 0000000000000006 0000000000000028 0ffffffffffffffe 0000000000000016
[ 113.841808] b8e0: 0000000000000000 0000000000000000
[ 113.846732] [] clk_core_unprepare+0x190/0x1a0
[ 113.852710] [] clk_unprepare+0x30/0x40
[ 113.858076] [] dw_i2c_plat_suspend+0x38/0x48
[ 113.863966] [] platform_pm_suspend+0x38/0x6c
[ 113.869858] [] dpm_run_callback+0x3c/0x1d0
[ 113.875572] [] __device_suspend+0x130/0x3a8
[ 113.881375] [] dpm_suspend+0x124/0x37c
[ 113.886738] [] dpm_suspend_start+0x78/0x84
[ 113.892454] [] suspend_devices_and_enter+0x9c/0x324
[ 113.898959] [] pm_suspend+0x498/0x628
[ 113.904234] [] state_store+0x88/0xa4
[ 113.909421] [] kobj_attr_store+0x14/0x24
[ 113.914960] [] sysfs_kf_write+0x5c/0x6c
[ 113.920410] [] kernfs_fop_write+0xc4/0x188
[ 113.926125] [] __vfs_write+0x48/0x104
[ 113.931401] [] vfs_write+0x98/0x190
[ 113.936501] [] SyS_write+0x54/0xb0
[ 113.941513] [] el0_svc_naked+0x24/0x28
[ 113.947534] sd 0:0:0:3: [sdd] Synchronizing SCSI cache
[ 113.947708] sd 0:0:0:2: [sdc] Synchronizing SCSI cache
[ 113.948133] mali e82c0000.mali: kbase_device_suspend: suspend +
[ 113.948428] mali e82c0000.mali: kbase_device_suspend: suspend -
[ 113.949491] sd 0:0:0:1: [sdb] Synchronizing SCSI cache
[ 113.950132] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 113.976002] [USB3][hisi_dwc3_suspend]+
[ 113.976006] [USB3][hi3660_usb3phy_shutdown]+
[ 113.976009] [USB3][set_hisi_dwc3_power_flag]get dwc3 lock
[ 113.976011] [USB3][set_hisi_dwc3_power_flag]set hisi_dwc3_power_flag 0
[ 113.976013] [USB3][set_hisi_dwc3_power_flag]put dwc3 lock
[ 113.990601] [USB3][hi3660_usb3phy_shutdown]-
[ 113.990604] [USB3][hisi_dwc3_suspend]-
[ 114.029803] PM: suspend of devices complete after 1661.346 msecs
[ 114.037067] PM: late suspend of devices complete after 1.183 msecs
[ 114.045137] PM: noirq suspend of devices complete after 1.811 msecs
[ 114.051557] Disabling non-boot CPUs …
[ 114.058622] CPU6: update max cpu_capacity 1023
[ 114.075437] CPU1: shutdown
[ 114.078176] psci: CPU1 killed.
[ 114.098652] CPU0: update max cpu_capacity 402
[ 114.119282] CPU7: update max cpu_capacity 1023
[ 114.119304] CPU2: shutdown
[ 114.126600] psci: CPU2 killed.
[ 114.167219] CPU6: update max cpu_capacity 1023
[ 114.167240] CPU3: shutdown
[ 114.174527] psci: CPU3 killed.
[ 114.207017] CPU5: update max cpu_capacity 1023
[ 114.207031] CPU4: shutdown
[ 114.214345] psci: CPU4 killed.

Thanks


#39

Just curious, if you have connected any I2C device on low speed port? Please check if below patch is in your local code base.

commit 036c100b58f742289dfab088a60e35717ec056f4
Author: Ulf Hansson ulf.hansson@linaro.org
Date: Wed Aug 9 15:28:22 2017 +0200

i2c: designware: Fix system suspend

commit a23318feeff662c8d25d21623daebdd2e55ec221 upstream.

As a workaround, you could try below patch for I2C suspend/resume:

> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index e630d4f..07e7c70 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -270,6 +270,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
>  	ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
>  	adap->dev.of_node = pdev->dev.of_node;
>  
> +	dev->pm_runtime_disabled = true;
> +
>  	if (dev->pm_runtime_disabled) {
>  		pm_runtime_forbid(&pdev->dev);
>  	} else {

#40

Hi Leo-yan,

Thanks for all your support.
Suspend-resume is working fine after applying above patch.

Just curious, if you have connected any I2C device on low speed port?
No.
But pci device is not working with UEFI bootloader.

Thanks