The most recent situation is that the null pointer exception
is only reported from repeated reboot test on rk3588_EDGE_SDK,
not on rk3588_Linux_SDK or rk3588_Android_SDK.
Change-Id: I1e5ce9eb9fd32c29294e115e6014a8114c896754
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
The system calls pm_runtime_get_noresume() to prevent device
from entering to runtime suspend status when reboot, and the
pm_runtime_put_sync_suspend() is called in a delay work,
so when reboot the power domain may be power on,
but the regulator is disabled, it's not allowed.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ie25451ddf4fc866e93e7272a8d9a809919a96e1d
When system resume, all power domains will power on in
dpm_noirq_resume_devices(), if vdd gpu is disabled before system
suspend, the pd gpu will failed to power on when system resume,
the detail as follows:
rockchip-pm-domain fd8d8000.power-management:power-controller: failed to get ack on domain 'gpu', target_idle = 0, target_ack = 0, val=0x8080f
Kernel panic - not syncing: panic_on_set_idle set ...
CPU: 0 PID: 1947 Comm: Binder:352_2 Not tainted 5.10.66 #960
Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT)
Call trace:
dump_backtrace+0x0/0x1c8
show_stack+0x1c/0x2c
dump_stack_lvl+0xdc/0x12c
dump_stack+0x1c/0x64
panic+0x150/0x3a4
rockchip_pmu_set_idle_request+0x1f8/0x1fc
rockchip_pd_power+0x11c/0x1e0
rockchip_pd_power_on+0x28/0x38
genpd_sync_power_on+0xf4/0x134
genpd_resume_noirq+0x70/0xd0
device_resume_noirq+0x1a8/0x410
dpm_noirq_resume_devices+0x100/0x55c
dpm_resume_noirq+0x18/0x34
suspend_enter+0x33c/0x52c
suspend_devices_and_enter+0xec/0x338
enter_state+0x12c/0x3f8
pm_suspend+0x60/0xcc
state_store+0x108/0x148
kobj_attr_store+0x1c/0x34
sysfs_kf_write+0x40/0x58
kernfs_fop_write_iter+0xf0/0x194
vfs_write+0x328/0x390
ksys_write+0x78/0xe8
__arm64_sys_write+0x20/0x30
el0_svc_common+0xc0/0x23c
do_el0_svc+0x28/0x88
el0_svc+0x14/0x24
el0_sync_handler+0x88/0xec
el0_sync+0x1a8/0x1c0
SMP: stopping secondary CPUs
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I89f80d37ab2cc61c715bce3f8a25c26552918922
In mail 'RE: <rock-chips>: G610: Valhall Android DDK r36:
Does device driver warning log "Could not get a valid AS for group ..." matter?',
zhigang.yao@arm.com declared that it should not be a warning:
"This is expected behavior.
GPU has a limited present HW address space resource,
max is 16, and is implementation specific, (8 on Odin?).
So if there are more than 16 (8 on Odin) process,
some of it might not get a valid present address space,
and the warning would be printed as you have observed."
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Ic8324c37461776672d516b472db66549d91fe552
When call pm_runtime_get_sync(), the runtime callback will change clock
source to normal pll, but now pm_runtime_get_sync() is called in a delay
work and the wakelock seems to be invalid on linux system,
so when suspend the pm_runtime_get_sync() may not be called.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I0a951b455c10158ca63d747e35e9001cdbdde91c
If use savedefconfig to update defconfig, PM_DEVFREQ and DEVFREQ_THERMAL
will be removed, and dmc and opp_select also depend on PM_DEVFREQ,
enable them default.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ied5ac8e70fe195294df2752160ce6e56360f2db8
In order to get target read margin and scmi clk earlier,
and it will also be used in later submissions.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I75bd79dc4963fa0dcc73d7c66a696e1cc0c177b7
The warning logs fixed are "GPU activity takes longer than time interval, ...".
This fix is provided as 496f5e3.diff by Zhigang.Yao@arm.com of support_mali.
The original commit message within 496f5e3.diff:
{
From 496f5e37a803266e71cbf7b6eb5871fe2fcd8931 Mon Sep 17 00:00:00 2001
From: Tu Vuong <tu.vuong@arm.com>
Date: Wed, 09 Feb 2022 09:31:20 +0000
Subject: [PATCH] GPUCORE-30123 Fix incorrect dmesg warning for unexpected GPU activities
The DVFS utilisation calculation detects when the GPU has expended more
cycles than expected compared to the actual time passed. This margin was
not sufficient as it didn't take into account the worst-case scenario
where samples are taken TIMER_DEFAULT_VALUE_MS apart.
}
Change-Id: I16bb904fd77006f6ab1e4419e44a9834550e4c07
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
The panic was triggered
by running "cat /sys/kernel/debug/mali0/ipa_current_power".
It is fixed by enlarging KBASE_IPA_BLOCK_TYPE_NUM according to the fact
that we set 4 clks for GPU in rk3588 dts.
Change-Id: I3a87f6f2d25cf296d95d033d3d98c51666ea482d
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
The bug was found in the case of that system suspend process was broken off
for USB ADB being connected.
This fix is provided by Zhigang.Yao@arm.com of support_mali.
Related RK redmine case:
https://redmine.rock-chips.com/issues/334539
Change-Id: I4772ed901a7fe54884a79a53b3ca9f6fd7beed40
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
1. change clock rate and read margin only when pd is on.
2. change clock source to normal pll before power down pd.
3. change clock source back to pvtpll and restore clock rate
and read margin after power on pd.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I2028866fdd70909814aaba7ef6d3af3bf764eb87
Add support to change memory read margin according to voltage when
register system monitor.
Change-Id: Id1d78432b6a83bbb09b4438146a0197dc914347b
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
In addition, fix a bug of calling KBASE_KTRACE_ADD() too early.
Change-Id: I843f340526275b50ae7d1ec6a7a68963e081e219
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Add support to get soc info and set voltage read margin.
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I254a92ba124655e3efc4922a7425c1f13d384adf
drivers/gpu/arm/bifrost/mali_kbase_core_linux.c:2955:6: warning: no previous prototype for function 'kbasep_ktrace_dump_wrapper' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_irq_linux.c:182:13: warning: no previous prototype for function 'kbase_gpu_irq_test_handler' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_irq_linux.c:210:5: warning: no previous prototype for function 'kbase_set_custom_irq_handler' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:241:5: warning: no previous prototype for function 'rk_kbase_device_runtime_init' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:246:6: warning: no previous prototype for function 'rk_kbase_device_runtime_disable' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:266:5: warning: no previous prototype for function 'kbase_platform_early_init' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:274:6: warning: no previous prototype for function 'kbase_platform_rk_shutdown' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c:460:5: warning: no previous prototype for function 'kbase_platform_rk_init_opp_table' [-Wmissing-prototypes]
drivers/gpu/arm/bifrost/ipa/mali_kbase_ipa.c:399:5: warning: no previous prototype for function 'kbase_scale_static_power' [-Wmissing-prototypes]
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I47be45c9ac2b7f9eedec1977d358b535f7fbd795
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: Icb1e4a388e6e8720036b6a1d85a13b5e2491cf4d
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Picked from ./platform/devicetree/.
This makes GPU utilisation info available and resolve the warning log below:
[ 19.641700][ T83] WARNING: CPU: 0 PID: 83 at drivers/gpu/arm/bifrost/csf/ipa_control/mali_kbase_csf_ipa_control.c:239 kbase_ipa_control_handle_gpu_power_off+0x128/0x198
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: I7ce8d0f52d6340659b2c9ca9692c48043e1060c1
Including modifications under drivers/base/ from the new DDK.
Resolve lots of conflicts.
Fix compilation errors when CONFIG_DEBUG_FS is disabled.
Change-Id: I69f9ac87d927441d0b92b8dac8b704922aeb6a0a
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Include a new directory include/uapi/gpu/arm/bifrost/,
which includes some header files of bifrost device driver.
In the original part of g6, the path is include/uapi/gpu/arm/midgard/.
I changed the "midgard" to "bifrost", and modified the paths of the header files in .c files.
I resolved some conflicts between modifications form ARM and RK, manually.
In addition, introduce source files of protected_memory_allocator
that might be needed by bifrost_device_driver into build system.
Further more, to avoid errors when building in GKI mode,
add "WITH Linux-syscall-note" to SPDX tag of uapi headers.
Change-Id: I09d500a0fdbc5da352c81dc4fcfbffb5b7f907f5
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Because they are no longer useful,
after rk3288/rk3399 Android and Linux device
use the same midgard_device_driver "drivers/gpu/arm/midgard".
Change-Id: I7ccc3c99fdfdde5a0ea12a7f3e1931fd5f1ce4cb
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Make $(src) as absolute path if it isn't already, by prefixing $(srctree).
Fix build module with "O=dir".
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I50a809faee21afd66d8f2025d05602a8a85293df
Make $(src) as absolute path if it isn't already, by prefixing $(srctree).
Fix build module with "O=dir".
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I4e6d1f252e51956dc264e544ebbf7cf774a39c5d
[ 4.128429] WARNING: CPU: 0 PID: 247 at drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:1772 kbase_mmap+0x380/0xa78
...
Treat VM_FAULT_NOPAGE as success of calling vmf_insert_pfn().
Take https://android.googlesource.com/kernel/hikey-modules/+/refs/heads/android12-5.10/midgard/mali_kbase_mem_linux.c as a reference.
Fixes: 970017f88e ("MALI: midgard: Fix all compile errors under kernel 5.10")
Change-Id: Ie0562d8024e58031ba8126aab42dc7005f08b071
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
dmesg log from bootup:
...
[ 0.988106] mali fde60000.gpu: GPU identified as 0x2 arch 7.4.0 r1p0 status 0
[ 0.988199] mali fde60000.gpu: No memory group manager is configured
[ 0.989228] mali fde60000.gpu: Probed as mali0
[root@RK356X:/]# cat ./sys/devices/platform/fde60000.gpu/gpuinfo
Mali-G52 1 cores r1p0 0x7402
[root@RK356X:/]# ls /sys/class/devfreq/fde60000.gpu/
available_frequencies governor name target_freq
available_governors load polling_interval timer
cur_freq max_freq power trans_stat
device min_freq subsystem uevent
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I1669385cd2609fbe8ba4507f777e904e1f6c6961