drm/amdgpu: Fix selfring initialization sequence on soc24
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix selfring initialization sequence on soc24
Move enable_doorbell_selfring_aperture from common_hw_init to common_late_init in soc24, otherwise selfring aperture is initialized with an incorrect doorbell aperture base.
Port changes from this commit from soc21 to soc24:
commit 1c312e816c40 ("drm/amdgpu: Enable doorbell selfring after resize FB BAR")
Signed-off-by David Belanger <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/soc24.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/soc24.c +13 -10
@@ -250,13 +250,6 @@ static void soc24_program_aspm(struct amdgpu_device *adev) adev->nbio.funcs->program_aspm (adev); } -static void soc24_enable_doorbell_aperture (struct amdgpu_device *adev, -bool enable) -{ - adev->nbio.funcs->enable_doorbell_aperture (adev, enable); - adev->nbio.funcs->enable_doorbell_selfring_aperture (adev, enable); -} -const struct amdgpu_ip_block_version soc24_common_ip_block = { .type =AMD_IP_BLOCK_TYPE_COMMON , .major =1 ,
@@ -454,6 +447,11 @@ static int soc24_common_late_init(void *handle)if (amdgpu_sriov_vf (adev))xgpu_nv_mailbox_get_irq (adev); +/* Enable selfring doorbell aperture late because doorbell BAR +* aperture will change if resize BAR successfully in gmc sw_init. +*/ + adev->nbio.funcs->enable_doorbell_selfring_aperture (adev, true); +return 0 ; }
@@ -491,7 +489,7 @@ static int soc24_common_hw_init(void *handle) adev->df.funcs->hw_init (adev);/* enable the doorbell aperture */ -soc24_enable_doorbell_aperture (adev, true); + adev->nbio.funcs->enable_doorbell_aperture (adev, true);return 0 ; }
@@ -500,8 +498,13 @@ static int soc24_common_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; -/* disable the doorbell aperture */ -soc24_enable_doorbell_aperture (adev, false); +/* Disable the doorbell aperture and selfring doorbell aperture +* separately in hw_fini because soc21_enable_doorbell_aperture +* has been removed and there is no need to delay disabling +* selfring doorbell. +*/ + adev->nbio.funcs->enable_doorbell_aperture (adev, false); + adev->nbio.funcs->enable_doorbell_selfring_aperture (adev, false);if (amdgpu_sriov_vf (adev))xgpu_nv_mailbox_put_irq (adev);
Signature · 1 line
2.41.0
Quoted 10 lines · David Belanger
Move
enable_doorbell_selfring_aperturefromcommon_hw_inittocommon_late_initin soc24, otherwise selfring aperture is initialized with an incorrect doorbell aperture base.Port changes from this commit from soc21 to soc24:
commit1c312e816c40("drm/amdgpu: Enable doorbell selfring after resize FB BAR")Signed-off-by David Belanger <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 62 lines
--- drivers/gpu/drm/amd/amdgpu/soc24.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)drivers/gpu/drm/amd/amdgpu/soc24.c +13
-11@@ -250,13 +250,6 @@ static void soc24_program_aspm(struct amdgpu_device *adev) adev->nbio.funcs->program_aspm (adev); } -static void soc24_enable_doorbell_aperture (struct amdgpu_device *adev, -bool enable) -{ - adev->nbio.funcs->enable_doorbell_aperture (adev, enable); - adev->nbio.funcs->enable_doorbell_selfring_aperture (adev, enable); -} -const struct amdgpu_ip_block_version soc24_common_ip_block = { .type =AMD_IP_BLOCK_TYPE_COMMON , .major =1 ,@@ -454,6 +447,11 @@ static int soc24_common_late_init(void *handle)if (amdgpu_sriov_vf (adev))xgpu_nv_mailbox_get_irq (adev); +/* Enable selfring doorbell aperture late because doorbell BAR +* aperture will change if resize BAR successfully in gmc sw_init. +*/ + adev->nbio.funcs->enable_doorbell_selfring_aperture (adev, true); +return 0 ; }@@ -491,7 +489,7 @@ static int soc24_common_hw_init(void *handle) adev->df.funcs->hw_init (adev);/* enable the doorbell aperture */ -soc24_enable_doorbell_aperture (adev, true); + adev->nbio.funcs->enable_doorbell_aperture (adev, true);return 0 ; }@@ -500,8 +498,13 @@ static int soc24_common_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; -/* disable the doorbell aperture */ -soc24_enable_doorbell_aperture (adev, false); +/* Disable the doorbell aperture and selfring doorbell aperture +* separately in hw_fini because soc21_enable_doorbell_aperture +* has been removed and there is no need to delay disabling +* selfring doorbell. +*/ + adev->nbio.funcs->enable_doorbell_aperture (adev, false); + adev->nbio.funcs->enable_doorbell_selfring_aperture (adev, false);if (amdgpu_sriov_vf (adev))xgpu_nv_mailbox_put_irq (adev); --2.41.0