YiPeng Chai fac53471d0 drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled
V1:
  The psp_cmd_submit_buf function is called by psp_hw_fini to send
TA unload messages to psp to terminate ras, asd and tmr. But when
amdgpu is uninstalled, drm_dev_unplug is called earlier than
psp_hw_fini in amdgpu_pci_remove, the calling order as follows:
static void amdgpu_pci_remove(struct pci_dev *pdev) {
	drm_dev_unplug
	......
	amdgpu_driver_unload_kms->amdgpu_device_fini_hw->...
		->.hw_fini->psp_hw_fini->...
		->psp_ta_unload->psp_cmd_submit_buf
	......
}
The program will return when calling drm_dev_enter in psp_cmd_submit_buf.

So the call to drm_dev_enter in psp_cmd_submit_buf should be
removed, so that the TA unload messages can be sent to the psp
when amdgpu is uninstalled.

V2:
1. Restore psp_cmd_submit_buf to its original code.
2. Move drm_dev_unplug call after amdgpu_driver_unload_kms in
   amdgpu_pci_remove.
3. Since amdgpu_device_fini_hw is called by amdgpu_driver_unload_kms,
   remove the unplug check to release device mmio resource in
   amdgpu_device_fini_hw before calling drm_dev_unplug.

Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2022-09-07 22:21:00 -04:00
..
2022-07-13 14:17:35 +10:00
2022-06-20 23:53:55 +03:00
2022-07-22 15:51:31 +10:00
2022-07-12 17:01:42 +10:00
2022-06-15 19:12:17 +02:00
2022-07-13 10:54:56 +10:00
2022-07-12 16:50:05 +10:00
2022-07-13 10:54:56 +10:00
2022-06-20 23:53:55 +03:00
2022-06-12 22:10:50 -01:00
2022-07-13 10:54:56 +10:00
2022-07-13 10:54:56 +10:00
2022-06-28 07:56:32 +02:00
2022-03-24 16:19:43 -07:00
2022-02-07 16:35:35 -08:00
2022-05-04 14:09:34 +02:00
2022-04-07 12:53:53 +02:00
2022-07-13 10:54:56 +10:00
2022-02-25 05:50:18 +10:00
2022-04-12 09:27:20 +03:00