Rex Zhu
eb4900aa4c
drm/amdgpu: Fix kernel NULL pointer dereference in dpm functions
...
caused by
'commit 83e3c4615872 ("drm/amdgpu: Remove wrapper layer of smu ip functions")'
BUG: unable to handle kernel NULL pointer dereference at 00000000000005d8
[ 313.241459] IP: ci_dpm_read_sensor+0x37/0xf0 [amdgpu]
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:44:50 -05:00
Rex Zhu
81ce8bea03
drm/amdgpu: Fix kernel NULL pointer dereference when amdgpu fini
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:44:21 -05:00
Mikita Lipski
e5b03032e3
drm/amdgpu - Disable all irqs before disabling all CRTCs
...
By moving amdgpu_irq_disable_all earlier in the sequence
fixes an issue with disabling pflip interrupts:
*ERROR* dal_irq_service_dummy_ack: called for non-implemented irq source
Earlier patch fixed a memory corruption and revealed irq
warnings.This way it seems to be there no obvious issues
with unloading the module.
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:44:12 -05:00
Mikita Lipski
088e7c1617
drm/amdgpu: Disable irq on device before destroying it
...
Disable irq on devices before destroying them. That prevents
use-after-free memory access when unloading the driver.
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:44:03 -05:00
Mikita Lipski
ff97cba8c1
drm/amdgpu: Use atomic function to disable crtcs with dc enabled
...
This change fixes the deadlock when unloading the driver with displays
connected.
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com >
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:42 -05:00
Tom St Denis
864917a3b8
drm/amd/amdgpu: fix offset into page with amdgpu_iomem debugfs file
...
The offset inside the page wasn't included in the copy call meaning
the start of the page was being read/written instead.
Reported-by: Jay Cornwall <Jay.Cornwall@amd.com >
Signed-off-by: Tom St Denis <tom.stdenis@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:34 -05:00
Hawking Zhang
bd08a8d9e8
drm/amdgpu/nbio6: Correct PCIE_INDEX/DATA pair used for smn register accessing
...
PCIE_INDEX2/DATA2 pair will be used for smn register accessing since from vega.
PCIE_INDEX/DATA pair should be reserved for smu
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:25 -05:00
Andrey Grodzovsky
f004938f78
drm/amd/powerplay: Fix NULL pointer deref on driver unbind.
...
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:05 -05:00
Alex Deucher
e3ecdffac9
drm/amdgpu: add documentation for amdgpu_device.c
...
Add kernel doc for the functions in amdgpu_device.c
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:43:05 -05:00
Alex Deucher
3ac952b10d
drm/amdgpu: add VCN to firmware query interface
...
Need to be able to query the VCN firmware version from
userspace to determine supported features, etc.
Reviewed-by: Huang Rui <ray.huang@amd.com >
Acked-by: Leo Liu <leo.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-20 23:42:49 -05:00
Rex Zhu
690dc62662
drm/amd/pp: Remove unneeded void * casts for Vega10
...
Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:38:31 -05:00
Rex Zhu
2538090cb6
drm/amd/pp: Delete get_xclk function in powerplay (v2)
...
use asic's callback function get_xclk in amdgpu
v2: squash in removal of leftover debug info
(drm/amd/pp: Delete debug info in smu7_hwmgr.c) (Rex)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:38:31 -05:00
Rex Zhu
c7d30b40a2
drm/amd/pp: Clean up header file for Vega10
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:35:37 -05:00
Rex Zhu
3f9ca14a1d
drm/amd/pp: Move functions to smu backend table for vega10
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:35:30 -05:00
Rex Zhu
9281c1f8a4
drm/amd/pp: Mark bunches of functins in vega10_smumgr.c static
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:35:22 -05:00
Rex Zhu
0b10f20022
drm/amd/pp: Remove dead functions in vega10_smumgr.c
...
use smc_table_manager function to copy/save tables to/from smu.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:35:15 -05:00
Rex Zhu
699f47951e
drm/amdgpu: Delete dead code when early init
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-19 13:34:46 -05:00
Harry Wentland
6da2b9332c
amdgpu/dm: Default PRE_VEGA ASIC support to 'y'
...
Even though we default PRE_VEGA support to 'n' upstream in amd-staging
we want to keep it enabled by default.
Signed-off-by: Harry Wentland <harry.wentland@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-16 16:16:50 -05:00
Rex Zhu
59156faf81
drm/amd/pp: Remove the cgs wrapper for notify smu version on APU
...
Refine commit f49e9bac19 ("drm/amd/pp: Get and save Rv smu version")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-16 16:16:49 -05:00
Shirish S
6f4969ef0a
drm/amd/display: fix dereferencing possible ERR_PTR()
...
This patch fixes static checker warning caused by
"36cc549d5986: "drm/amd/display: disable CRTCs with
NULL FB on their primary plane (V2)"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Shirish S <shirish.s@amd.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-16 16:16:49 -05:00
Clark Zheng
5e9a4f0873
drm/amd/display: Refine disable VGA
...
bad case won't follow normal sense, it will not enable vga1 as usual, but vga2,3,4 is on.
Signed-off-by: Clark Zheng <clark.zheng@amd.com >
Reviewed-by: Tony Cheng <tony.cheng@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-16 16:16:49 -05:00
Andrey Grodzovsky
64350f1b7f
drm/amdgpu: Improve documentation of bo_ptr in amdgpu_bo_create_kernel
...
and amdgpu_bo_create_reserved.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 14:34:15 -05:00
Michel Dänzer
a3f73c8cf4
drm/radeon: Don't turn off DP sink when disconnected
...
Turning off the sink in this case causes various issues, because
userspace expects it to stay on until it turns it off explicitly.
Instead, turn the sink off and back on when a display is connected
again. This dance seems necessary for link training to work correctly.
Bugzilla: https://bugs.freedesktop.org/105308
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 10:38:40 -05:00
Rex Zhu
34e40f6338
drm/amd/pp: Rename file name cz_* to smu8_*
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:58:56 -05:00
Rex Zhu
47ce4a9f84
drm/amd/pp: Replace function/struct name cz_* with smu8_*
...
hw ip smu8 was used on CZ/ST,
so use smu8 as the prefix of the function/struct name in powerplay.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:58:47 -05:00
Rex Zhu
ce1ace35b7
drm/amd/pp: Remove unneeded void * casts in cz_hwmgr.c/cz_smumgr.c
...
Removes unneeded void * casts for the following pointers:
hwmgr->backend
hwmgr->smu_backend
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:58:37 -05:00
Rex Zhu
2bfc270cbf
drm/amd/pp: Mv cz uvd/vce pg/dpm functions to cz_hwmgr.c
...
1. delete cz_clockpowergating.c/.h files
2. mark uvd/vce dpm/pg functions static
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:58:24 -05:00
Rex Zhu
bcd8377b6f
drm/amd/pp: Remove dead header file pp_asicblocks.h
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:58:16 -05:00
Rex Zhu
015aae53d0
drm/amd/pp: Delete dead code on cz_clockpowergating.c
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:58:08 -05:00
Rex Zhu
2dac5936e5
drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c
...
make it symmetric with amdgpu_ucode_init_bo in amd_powerplay.c
refine the "commit b22558bb4ff8fc9fe925222f90297d7a03a5fb20"
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:58 -05:00
Rex Zhu
b905090d2b
drm/amdgpu: Remove wrapper layer of smu ip functions
...
1. delete amdgpu_powerplay.c used for wrapping smu ip functions
2. delete struct pp_instance,
3. make struct hwmgr as the smu hw handle.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:50 -05:00
Rex Zhu
5b2a3d2c15
drm/amdgpu: Don't compared ip_block_type with ip_block_index
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:41 -05:00
Rex Zhu
5771632723
drm/amdgpu: Plus NULL function pointer check
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:32 -05:00
Rex Zhu
8e68627958
drm/amd/pp: Move helper functions to smu_help.c
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:21 -05:00
Rex Zhu
c425688520
drm/amd/pp: Replace rv_* with smu10_*
...
Powerplay is for the hw ip smu, for RV, smu10 is used,
so use smu10 as the prefix of the files name/function name.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:12 -05:00
Rex Zhu
567cc73a1b
drm/amd/pp: Fix function parameter not correct
...
caused by "commit dcefb7668e5b4fb56099b16d1790cd3056322b03"
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:57:02 -05:00
Rex Zhu
0d8a81d926
drm/amd/pp: Add rv_copy_table_from/to_smc to smu backend function table
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:56:53 -05:00
Rex Zhu
56088be9af
drm/amd/pp: Add new smu backend function smc_table_manager
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:56:44 -05:00
Rex Zhu
7a67f4559d
drm/amd/pp: Mark internal functions as static in rv_smumgr.c
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:56:36 -05:00
Rex Zhu
88c1a70d58
drm/amd/pp: Add rv_read_arg_from_smc to smu backend function table
...
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:56:29 -05:00
Rex Zhu
52911e0356
drm/amd/pp: Remove meanless return value check in RV
...
In send_message_to_smu helper functions,
Print out the error code for debug if smu failed to response.
The helper functions always return true, so no need to
check their return value.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:56:21 -05:00
Rex Zhu
7f8e66b603
drm/amd/pp: Delete is_smc_ram_running function on RV
...
1. There is a race condition when another ip also use same register pairs
2. check once at boot up by GetDriverIfVersion message is sufficient
to check SMU health. so delete is_smc_ram_running check.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:56:11 -05:00
Rex Zhu
847e82615b
drm/amd/pp: Clean up header file include
...
smu7_smumgr.h should not be included in rv and vega, The common functions
for all smu7 asics are put in smu_smumgr.c.
Not include cgs interface in smumgr.c. the code used cgs interface has been
deleted.
Not include smu_ucode_xfer_vi.h in rv/vega
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:55:56 -05:00
Rex Zhu
fd06518d57
drm/amd/pp: Fix memory leak in error path in smumgr
...
Free the backend structure if we fail to allocate device memory.
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:55:46 -05:00
Rex Zhu
116af45059
drm/amd/pp: Simplified the avfs btc state on smu7
...
AVFS feature support/not support is enough to driver.
so remove the complex define of the avfs btc state.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:55:38 -05:00
Andrey Grodzovsky
3bb271f3ca
drm/amd/powerplay: Fix KASAN user after free on driver unload.
...
Reusing local handle to initialize BO without resetting it to
NULL is wrong since it causes amdgpu_bo_create_reserved to skip
new BO creation and just reuse the given pointer for pinning.
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-15 09:55:03 -05:00
Feifei Xu
2f51d6e8e4
drm/amdgpu/sdma4: Remove unused header file from sdma_v4_0.c
...
Remove mmhub header files inclusion which not used.
Signed-off-by: Feifei Xu <Feifei.Xu@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:19 -05:00
Alex Deucher
fcb7d51571
drm/amdgpu/sdma4: use num_instances for clock/powergating config
...
Rather then relying on the asic type for the second instance.
Makes it more consistent with the rest of the code.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com >
2018-03-14 16:01:18 -05:00
Alex Deucher
da42960918
drm/amdgpu: remove trailing whitespace from soc15ip.h
...
no intended functional change.
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:18 -05:00
Alex Deucher
a423f79ad7
drm/amdgpu/powerplay/vega10: fix memory leak in error path
...
Free the backend structure if we fail to allocate device
memory.
Reviewed-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2018-03-14 16:01:18 -05:00